예제 #1
2
파일: main.cpp 프로젝트: evgeny-t/QtSamples
int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);

    Controller controller; //
    QtQuick2ApplicationViewer viewer;

    viewer.rootContext()->
            setContextProperty("controller", &controller); //
    viewer.installEventFilter(&controller);
    viewer.setMainQmlFile(QStringLiteral("qml/QCloseConfirm/main.qml"));

    viewer.showExpanded();

    return app.exec();
}
예제 #2
0
int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);


    qDebug()<<"QGuiApplication";

    qmlRegisterType<LogicChannel>("LogicAnalyer", 1, 0, "LogicChannel");
    qmlRegisterType<LogicSeries>("LogicAnalyer", 1, 0, "LogicSeries");
    qmlRegisterType<LogicAcquirerSimulator>("LogicAnalyer", 1, 0, "LogicAcquirerSimulator");
    qmlRegisterType<Timeline>("LogicAnalyer", 1, 0, "Timeline");
    qmlRegisterType<Timescale>("LogicAnalyer", 1, 0, "Timescale");

    qmlRegisterType<LogicAcquirerSimulator>("LogicAnalyer", 1, 0, "QuickItemDemo0");


    qDebug()<<"qmlRegisterType";

    QtQuick2ApplicationViewer viewer;
    viewer.setMainQmlFile(QStringLiteral("qml/LogicAnalyser/LogicAnalyser.qml"));
//    viewer.setMainQmlFile(QStringLiteral("qml/LogicAnalyser/testQml.qml"));
    viewer.showExpanded();
//    QVariant
    return app.exec();
}
예제 #3
0
int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);

    QtQuick2ApplicationViewer viewer;

    //Logic logic(":/aggettivi.txt",  viewer.rootContext());
    Logic logic(":/indeterminativo",  viewer.rootContext());
    ExerciseVocabularyAnswer vocabulary(":/parole.txt");

    TwoSetExercise set;
    set.load("/tmp/sets.xml");

    set.print();
    viewer.rootContext()->setContextProperty("logic", &logic);
    viewer.rootContext()->setContextProperty("vocabulary", &vocabulary);

    viewer.rootContext()->setContextProperty("setexercise", &set);

    //viewer.addImportPath("qml/educazionik-framework/");
    viewer.setMainQmlFile(QStringLiteral("qml/educazionik-framework/main.qml"));
    viewer.showExpanded();

    return app.exec();
}
예제 #4
0
파일: main.cpp 프로젝트: rabits/salticidae
int main(int argc, char *argv[])
{
    qDebug("[Salticidae] Init Salticidae v%s", PROJECT_VERSION);

    QCoreApplication::setOrganizationName("Rabits");
    QCoreApplication::setOrganizationDomain("rabits.org");
    QCoreApplication::setApplicationName("salticidae");
    QCoreApplication::setApplicationVersion(PROJECT_VERSION);

    QGuiApplication app(argc, argv);

    Eyes::registerQmlTypes();
    PluginManager::initPlugins();

    QtQuick2ApplicationViewer viewer;

    Eyes::I()->initContext(viewer, &app);

    qDebug("[Salticidae] Loading qml");
    viewer.setSource(QUrl("qrc:/qml/salticidae/main.qml"));
    QObject::connect(viewer.engine(), SIGNAL(quit()), &viewer, SLOT(close()));

    Eyes::I()->initRoot(viewer);

    qDebug("[Salticidae] Init done, starting");

    viewer.showExpanded();
    return app.exec();
}
int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);

    QString fileName;
    if (app.arguments().length() > 1) {
        fileName = app.arguments().at(1);
    } else {
        qWarning() << "Pass extracted json memory info dump as argument";
        return 0;
    }

    QtQuick2ApplicationViewer viewer;

    QFile jsonFile(fileName);
    if (!jsonFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
        qWarning() << "Failed to open file:" << fileName;
        return 0;
    }

    viewer.setTitle(fileName);
    viewer.engine()->rootContext()->setContextProperty("jsonFile", QString(jsonFile.readAll()));
    viewer.setMainQmlFile(QStringLiteral("qml/memory-dump-reader.qml"));
    viewer.showExpanded();

    return app.exec();
}
예제 #6
0
파일: main.cpp 프로젝트: blazern/dumb-home
int main(int argc, char * argv[])
{
    qsrand(QTime::currentTime().msec());

    qmlRegisterType<QmlMapInterface>("DumbHome", 1, 0, "QmlMapInterface");
    qmlRegisterType<MapObjectQmlWrapper>("DumbHome", 1, 0, "MapObjectQmlWrapper");

    QGuiApplication app(argc, argv);

    QtQuick2ApplicationViewer viewer;
    viewer.setMainQmlFile(QStringLiteral("qmlsrc/code-if-wanna-live/main.qml"));
    viewer.showExpanded();

    Map * const map = createMap();
    World world(map, new MapPhysics(*map));

    PlayerActionsQmlReceiver playerActionsQmlReceiver(world.getMap());
    viewer.rootContext()->setContextProperty("playerActionsReceiver", &playerActionsQmlReceiver);

    QmlMapInterface * const qmlMapInterface =
            viewer.rootObject()->findChild<QmlMapInterface*>("qmlMapInterface");

    if (qmlMapInterface != nullptr)
    {
        qmlMapInterface->setMap(world.getMap());
        world.getMapPhysics().addListener(*qmlMapInterface);
    }

    return app.exec();
}
예제 #7
0
int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    QLocalSocket localSocket;
    localSocket.connectToServer("bloggerQml", QIODevice::ReadOnly);
    if(localSocket.waitForConnected(5000))
    {
        // there is already an application running
        qDebug() << "Application is already running.";
        QMessageBox::information(0, QObject::tr("Erro"), QObject::tr("A aplicação já está a ser executada."), QMessageBox::Ok);
        return 0;
    }
    QLocalServer localServer;
    localServer.listen("bloggerQml");

    BloggerLoader bloggerloader;
    bloggerloader.loadBlogsFromFile();

    BloggerProxyModel model;
    model.setSourceModel(bloggerloader.model());

    Helper helper;
    QtQuick2ApplicationViewer viewer;
    viewer.rootContext()->setContextProperty("blogsModel", &model);
    viewer.rootContext()->setContextProperty("helper", &helper);
    viewer.rootContext()->setContextProperty("bloggerloader", &bloggerloader);

    viewer.setMainQmlFile(QStringLiteral("qml/blogerQML/main.qml"));
    viewer.showExpanded();

    int res = app.exec();
    bloggerloader.saveDB();
    return res;
}
예제 #8
0
int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv); // Create the base application class

    QtQuick2ApplicationViewer viewer; // create the QML viewer window



    // The below code will eventually be wrapped in a top level class
    // Initialize the flyweight
    //Create first Variable "A"
    Var* current_var(nullptr);
    CalculationFlyWeight flyweight;
    QString token(flyweight.insertCalculation("0","A",current_var));

    // Initialize the InputEventHandle class connects QML user input -> C++ Backend logic
    InputEventHandler in(&flyweight,viewer.engine()->rootContext(),&viewer,nullptr,current_var);

    // Make the Event Handler visible as QObject& in QML
    viewer.engine()->rootContext()->setContextProperty("EventHandler",&in);

    // simulate a user input call to place A as the current variable in the editor
     in.requestVariable(token);
    // set the main qml file

    viewer.setMainQmlFile(QStringLiteral("User_Interface/qml/main.qml"));
    viewer.showExpanded(); // set fullscreen, and visible
    return app.exec(); // run the main Application Event loop
}
예제 #9
0
파일: main.cpp 프로젝트: ittennull/Learn
int main(int argc, char *argv[])
{
	QApplication app(argc, argv);

	QDir::setCurrent(QCoreApplication::applicationDirPath());

	App application;

	qmlRegisterType<App>("App", 1, 0, "App");
	qmlRegisterType<CollectionModel>("CollectionModel", 1, 0, "CollectionModel");
    qmlRegisterType<QStringListModel>("QStringListModel", 1, 0, "QStringListModel");

	QtQuick2ApplicationViewer viewer;
	viewer.rootContext()->setContextProperty("app", &application);
	viewer.rootContext()->setContextProperty("checkModeCpp", &application.getCheckMode());
	viewer.rootContext()->setContextProperty("dictionaryModeCpp", &application.getDictionaryMode());
	viewer.rootContext()->setContextProperty("rememberModeCpp", &application.getRememberMode());
	viewer.setMainQmlFile(QStringLiteral("qml/Learn/main.qml"));
	viewer.showExpanded();

	viewer.setIcon(QIcon(":/new/g/dictionary-icon.png"));
    viewer.setTitle("Learn");

    application.setWindow(&viewer);

    return app.exec();
}
예제 #10
0
int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);

    QtQuick2ApplicationViewer viewer;
    viewer.setMainQmlFile(QStringLiteral("qml/samegame/main.qml"));
    viewer.showExpanded();

    return app.exec();
}
예제 #11
0
int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);
    qmlRegisterType<KinectCamera>("KinectCamera",1,0,"KinectCamera");
    QtQuick2ApplicationViewer viewer;
    viewer.setMainQmlFile(QStringLiteral("qml/kinecttest/main.qml"));
    viewer.showExpanded();

    return app.exec();
}
예제 #12
0
파일: main.cpp 프로젝트: ndesai/qml-qmqtt
int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);

    QtQuick2ApplicationViewer viewer;
    qmlRegisterType<MQTT>("mqtt", 1, 0, "MQTT");
    viewer.setMainQmlFile(QStringLiteral("qml/mqtt/main.qml"));
    viewer.showExpanded();

    return app.exec();
}
예제 #13
0
파일: main.cpp 프로젝트: kl-cruz/MUP_client
int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);
    QtQuick2ApplicationViewer viewer;
    qmlRegisterType<mupServerHandle>("mupServerHandle", 1, 0, "ServerHandle");
    viewer.setMainQmlFile(QStringLiteral("qml/MUP_qchartjs/main.qml"));

    viewer.showExpanded();

    return app.exec();
}
예제 #14
0
파일: main.cpp 프로젝트: jrepan/pasgen
int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);
    QtQuick2ApplicationViewer viewer;
    Hash hash(viewer.rootContext());

    viewer.rootContext()->setContextProperty("hash", &hash);
    viewer.setMainQmlFile(QStringLiteral("qrc:/qml/pasgen/main.qml"));
    viewer.showExpanded();

    return app.exec();
}
예제 #15
0
파일: main.cpp 프로젝트: osamu-k/QtStudy
int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);

    qmlRegisterType<GameModel>("LifeGame", 1, 0, "GameModel");

    QtQuick2ApplicationViewer viewer;
    viewer.setMainQmlFile(QStringLiteral("qml/LifeGameQML01/main.qml"));
    viewer.showExpanded();

    return app.exec();
}
예제 #16
0
int main(int argc, char *argv[])
{
  QGuiApplication app(argc, argv);

  qmlRegisterType<Triangle>("com.example.qtriangleplugin", 1, 0, "Triangle");

  QtQuick2ApplicationViewer viewer;
  viewer.setMainQmlFile(QStringLiteral("qml/QTriangle/main.qml"));
  viewer.showExpanded();

  return app.exec();
}
예제 #17
0
int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);
    // It is a good Idea to use a URI naming scheme to specify the module package name
    qmlRegisterType<VSXuAccelerometer>("org.vovoid.vsxu", 1, 0, "VSXuAccelerometer");

    QtQuick2ApplicationViewer viewer;
    viewer.setMainQmlFile(QStringLiteral("qml/VSXuDroid/main.qml"));
    viewer.showExpanded();

    return app.exec();
}
예제 #18
0
int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);

    qmlRegisterType<ConwayListModel>("com.minimoog77", 1, 0, "ConwayListModel");

    QtQuick2ApplicationViewer viewer;
    viewer.setMainQmlFile(QStringLiteral("qml/quickconway/main.qml"));
    viewer.showExpanded();

    return app.exec();
}
예제 #19
0
int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);

    QtQuick2ApplicationViewer viewer;
    viewer.setMainQmlFile(QStringLiteral("qml/qtandroidrunner/main.qml"));
    viewer.showExpanded();

    QtAndroidRunner *runner = QtAndroidRunner::instance();
    runner->start(new WebViewInitializer());

    return app.exec();
}
예제 #20
0
int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);
    FishManager* fishManager = new FishManager(&app);

    QtQuick2ApplicationViewer viewer;
    viewer.setMainQmlFile(QStringLiteral("qml/FishRandomizer/main.qml"));
    viewer.showExpanded();
    viewer.rootContext()->setContextProperty("fishManager",fishManager);
    qmlRegisterType<Fish>("Fishes",1,0,"FishObj");

    return app.exec();
}
예제 #21
0
파일: main.cpp 프로젝트: EnderLance/GPlus
int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);


    QtQuick2ApplicationViewer viewer;
    qmlRegisterType<OAuth2>("OAuth2",0,1,"OAuth2");

    viewer.setMainQmlFile(QStringLiteral("qml/OAuthPlayground/main.qml"));
    viewer.showExpanded();

    return app.exec();
}
예제 #22
0
int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);

    QtQuick2ApplicationViewer viewer;

    qmlRegisterType<FileTreeModel>("tk.corvinus.FileTreeModel", 1, 0, "FileTreeModel");

    viewer.setMainQmlFile(QStringLiteral("qml/ImageViewer/main.qml"));
    viewer.showExpanded();

    return app.exec();
}
예제 #23
0
int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);

    QtQuick2ApplicationViewer viewer;

    viewer.addImportPath(QStringLiteral("plugins"));

    viewer.setMainQmlFile(QStringLiteral("qml/Bananas/main.qml"));
    viewer.showExpanded();

    return app.exec();
}
예제 #24
0
int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);
    registryTypes ();

    Box2DPlugin plugin;
    plugin.registerTypes("Box2D");

    QtQuick2ApplicationViewer viewer;
    viewer.setMainQmlFile(QStringLiteral("qml/Arkanoid/main.qml"));
    viewer.showExpanded();

    return app.exec();
}
예제 #25
0
int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);

    QtQuick2ApplicationViewer viewer;
    viewer.setMainQmlFile(QString("qml/main.qml"));
    viewer.setIcon(QIcon("qrc:/res/logo.png"));
    viewer.setMinimumHeight(255);
    viewer.setMaximumHeight(255);
    viewer.setMinimumWidth(660);
    viewer.setMaximumWidth(660);
    viewer.showExpanded();

    return app.exec();
}
예제 #26
0
파일: main.cpp 프로젝트: saidinesh5/Dancer
int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);

#ifdef MEASURE_BPM
    qmlRegisterType<AudioListenerBPM>("com.monkeybusiness.dancer",1,0,"AudioListener");
#else
    qmlRegisterType<AudioListener>("com.monkeybusiness.dancer",1,0,"AudioListener");
#endif

    QtQuick2ApplicationViewer viewer;
    viewer.setMainQmlFile(QStringLiteral("qml/main.qml"));
    viewer.showExpanded();

    return app.exec();
}
예제 #27
0
파일: main.cpp 프로젝트: amapig/QtPractice
int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);
    QtQuick2ApplicationViewer viewer;

    QQmlEngine engine;
    QQmlComponent component(&engine, QUrl::fromLocalFile("qml/Playing/Player.qml"));
    QObject *object = component.create();

    viewer.rootContext()->setContextProperty("player", object);

    viewer.setMainQmlFile(QStringLiteral("qml/Playing/main.qml"));
    viewer.showExpanded();

    return app.exec();
}
예제 #28
0
파일: _main.cpp 프로젝트: Iolana/common
int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);

    QtQuick2ApplicationViewer viewer;

    qmlRegisterType<MindCell>("org.ginosoft.qmlcomponents", 1, 0, "MindCell");

    CellManager cellManager;
    viewer.rootContext()->setContextProperty("cellManager", &cellManager);

    viewer.setMainQmlFile(QStringLiteral("qml/DontMind/main.qml"));
    viewer.showExpanded();

    return app.exec();
}
예제 #29
0
파일: main.cpp 프로젝트: amapig/QtPractice
int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);

    QtQuick2ApplicationViewer viewer;
    viewer.setMainQmlFile(QStringLiteral("qml/testCacheName/main.qml"));
    viewer.showExpanded();

    QSize requestSize;
    requestSize.setHeight(200);
    requestSize.setWidth(200);
    qDebug() << "++++aaaaaaaa" << cacheKey("/home/mengcong/Pictures/1.jpg", requestSize);
    qDebug() << "++++bbbbbbbb" << cacheKey("/home/mengcong/Pictures/1.jpg", requestSize);

    return app.exec();
}
예제 #30
0
파일: main.cpp 프로젝트: barbac/qmlreloader
int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);

    QtQuick2ApplicationViewer viewer;
    viewer.setTitle("tst_reloader");
    QString path;
    if (argc == 2)
        path = argv[1];
    else
        path = QStringLiteral("../qmlreloader/qml/qmlreloader/main.qml");
    viewer.setMainQmlFile(path);
    viewer.showExpanded();

    Reloader reloader(&viewer, path);

    return app.exec();
}