Ejemplo n.º 1
2
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();
}
Ejemplo n.º 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();
}
Ejemplo n.º 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();
}
Ejemplo n.º 4
0
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();
}
Ejemplo n.º 5
0
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();
}
Ejemplo n.º 6
0
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();
}
Ejemplo n.º 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;
}
Ejemplo n.º 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
}
Ejemplo n.º 9
0
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();
}
Ejemplo n.º 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();
}
Ejemplo n.º 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();
}
Ejemplo n.º 12
0
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();
}
Ejemplo n.º 13
0
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();
}
Ejemplo n.º 14
0
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();
}
Ejemplo n.º 15
0
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();
}
Ejemplo n.º 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();
}
Ejemplo n.º 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();
}
Ejemplo n.º 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();
}
Ejemplo n.º 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();
}
Ejemplo n.º 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();
}
Ejemplo n.º 21
0
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();
}
Ejemplo n.º 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();
}
Ejemplo n.º 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();
}
Ejemplo n.º 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();
}
Ejemplo n.º 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();
}
Ejemplo n.º 26
0
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();
}
Ejemplo n.º 27
0
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();
}
Ejemplo n.º 28
0
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();
}
Ejemplo n.º 29
0
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();
}
Ejemplo n.º 30
0
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();
}