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


C++ QQmlApplicationEngine::show方法代码示例

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


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

示例1: main

int main(int argc, char *argv[])
{
#if QT_VERSION >= 0x050000
    QGuiApplication app(argc, argv);
    QQmlApplicationEngine engine;
#else
	QApplication app(argc, argv);
	QDeclarativeView engine;
#endif
    Config *config = Config::getConfig();
#ifdef ICS_ANDROID
    loadGeneralConfig(config, "assets:/databases/oiuc.db");
#else
    loadGeneralConfig(config, "databases/oiuc.db");
#endif
     Log *log = Log::getLog();
     log->setFilename(config->getLogDir() + "oiuc.log");
     log->start();
     //prepare for oiuc
     OIUC *oiuc = OIUC::getOIUC();
     oiuc->prepare();
     oiuc->start("6", "6");
     //make sure log file will be flushed after handle the quit signal of application
     QObject::connect(&app, SIGNAL(aboutToQuit()), log, SLOT(flushLog()));
     RadioList *radio_list = RadioList::getRadioListSingleton();
     OIUList *oiu_list = OIUList::getOIUListSingleton();
     engine.rootContext()->setContextProperty("oiuc", oiuc);
     engine.rootContext()->setContextProperty("radioList", radio_list);
     engine.rootContext()->setContextProperty("oiuList", oiu_list);
     engine.rootContext()->setContextProperty("logModel", log->getLogModel());
     writeLog("Start OIUC", SCREENS);
#if QT_VERSION >= 0x050000
	 QString qml_url = "qrc:/";
	 qml_url.append(QString::fromLocal8Bit(QML_GEN_DIR));
	 qml_url.append("/Application.qml");
     engine.load(QUrl(qml_url));
#else
	 QString qml_url = "qrc:///";
	 qml_url.append(QString::fromLocal8Bit(QML_GEN_DIR));
	 qml_url.append("/Application.qml");
	 engine.setSource(QUrl(qml_url));
	 engine.show();
#endif
     return app.exec();
}
开发者ID:mocidis,项目名称:oiuc-v1,代码行数:45,代码来源:main.cpp


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