当前位置: 首页>>代码示例>>C++>>正文


C++ QtQuick2ApplicationViewer类代码示例

本文整理汇总了C++中QtQuick2ApplicationViewer的典型用法代码示例。如果您正苦于以下问题:C++ QtQuick2ApplicationViewer类的具体用法?C++ QtQuick2ApplicationViewer怎么用?C++ QtQuick2ApplicationViewer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了QtQuick2ApplicationViewer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

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();
}
开发者ID:rabits,项目名称:salticidae,代码行数:29,代码来源:main.cpp

示例2: main

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();
}
开发者ID:blazern,项目名称:dumb-home,代码行数:30,代码来源:main.cpp

示例3: main

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();
}
开发者ID:eyeye,项目名称:LogicAnalyser,代码行数:25,代码来源:main.cpp

示例4: main

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
}
开发者ID:Tpimp,项目名称:Ubuntu-Phone-Calculator,代码行数:29,代码来源:main.cpp

示例5: main

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();
}
开发者ID:BonoNL,项目名称:sailfish-browser,代码行数:27,代码来源:memory-dump-reader.cpp

示例6: main

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();
}
开发者ID:zing235,项目名称:kinect-test-onlycolor-qml,代码行数:10,代码来源:main.cpp

示例7: main

int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);

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

    return app.exec();
}
开发者ID:raincrash,项目名称:QTApplications,代码行数:10,代码来源:main.cpp

示例8: main

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();
}
开发者ID:ittennull,项目名称:Learn,代码行数:27,代码来源:main.cpp

示例9: main

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();
}
开发者ID:ndesai,项目名称:qml-qmqtt,代码行数:11,代码来源:main.cpp

示例10: main

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();
}
开发者ID:kl-cruz,项目名称:MUP_client,代码行数:11,代码来源:main.cpp

示例11: main

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();
}
开发者ID:minimoog,项目名称:quickconway,代码行数:12,代码来源:main.cpp

示例12: main

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();
}
开发者ID:jrepan,项目名称:pasgen,代码行数:12,代码来源:main.cpp

示例13: main

int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);
    QtQuick2ApplicationViewer viewer;

    qmlRegisterType<OVRVisionItem>("OVRVision", 1, 0, "OVRVision");

    viewer.setMainQmlFile(QStringLiteral("qml/OVRVisionOpenCV/main.qml"));
    viewer.showFullScreen();

    return app.exec();
}
开发者ID:hecomi,项目名称:Outlinus,代码行数:12,代码来源:main.cpp

示例14: main

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();
}
开发者ID:voidstarr,项目名称:vsx_sensor_accelerometer,代码行数:12,代码来源:main.cpp

示例15: main

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();
}
开发者ID:osamu-k,项目名称:QtStudy,代码行数:12,代码来源:main.cpp


注:本文中的QtQuick2ApplicationViewer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。