int main(int argc, char **argv) { #if defined(Q_WS_X11) #if QT_VERSION >= 0x040800 QApplication::setAttribute(Qt::AA_X11InitThreads, true); #else XInitThreads(); QApplication::setAttribute(static_cast<Qt::ApplicationAttribute>(10), true); #endif #endif { QApplication app(argc, argv); { bool isOpenGL = false; for (int index = 1; index < argc; ++index) { if (strcmp(argv[index], "-opengl") == 0) { isOpenGL = true; break; } } QTestRunner runn(isOpenGL, argc, argv); QTimer::singleShot(0, &runn, SLOT(DropInStartup())); // These components must be loaded before app start QString componentPath(DEFAULT_COMPONENTS_PATH); QMozContext::GetInstance()->addComponentManifest(componentPath + QString("/components") + QString("/EmbedLiteBinComponents.manifest")); QMozContext::GetInstance()->addComponentManifest(componentPath + QString("/chrome") + QString("/EmbedLiteJSScripts.manifest")); QMozContext::GetInstance()->addComponentManifest(componentPath + QString("/chrome") + QString("/EmbedLiteOverrides.manifest")); QMozContext::GetInstance()->addComponentManifest(componentPath + QString("/components") + QString("/EmbedLiteJSComponents.manifest")); QMozContext::GetInstance()->runEmbedding(); } app.quit(); } return 0; }
int main(int argc, char **argv) { { QGuiApplication app(argc, argv); { bool isOpenGL = false; for (int index = 1; index < argc; ++index) { if (strcmp(argv[index], "-opengl") == 0) { isOpenGL = true; break; } } QTestRunner runn(isOpenGL, argc, argv); QTimer::singleShot(0, &runn, SLOT(DropInStartup())); // These components must be loaded before app start QString componentPath(DEFAULT_COMPONENTS_PATH); QMozContext::GetInstance()->setCompositorInSeparateThread(true); QMozContext::GetInstance()->addComponentManifest(componentPath + QString("/components") + QString("/EmbedLiteBinComponents.manifest")); QMozContext::GetInstance()->addComponentManifest(componentPath + QString("/chrome") + QString("/EmbedLiteJSScripts.manifest")); QMozContext::GetInstance()->addComponentManifest(componentPath + QString("/chrome") + QString("/EmbedLiteOverrides.manifest")); QMozContext::GetInstance()->addComponentManifest(componentPath + QString("/components") + QString("/EmbedLiteJSComponents.manifest")); QMozContext::GetInstance()->runEmbedding(); } app.quit(); } return 0; }