File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11cmake_minimum_required (VERSION 3.6.0 )
22
33project (glacierapp
4- VERSION 1.0.0
4+ VERSION 1.1
55 DESCRIPTION "Glacier applications wrapper library" )
66list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR } /cmake/modules" )
77
Original file line number Diff line number Diff line change @@ -107,16 +107,20 @@ QQmlApplicationEngine* GlacierApp::engine(QObject* parent)
107107 return s_engine;
108108}
109109
110- QQuickWindow* GlacierApp::showWindow ()
110+ QQuickWindow* GlacierApp::showWindow (QString rootQMLPath )
111111{
112112 QQmlApplicationEngine* engine = GlacierApp::engine (qApp);
113- QString rcMain (" :/" + QCoreApplication::applicationName () + " .qml" );
114- QFile rcFile (rcMain);
113+ if (rootQMLPath.isEmpty ()) {
114+ QString rcMain (" :/" + QCoreApplication::applicationName () + " .qml" );
115+ QFile rcFile (rcMain);
115116
116- if (rcFile.exists ()) {
117- engine->load (" qrc" + rcMain);
117+ if (rcFile.exists ()) {
118+ engine->load (" qrc" + rcMain);
119+ } else {
120+ engine->load (QUrl::fromLocalFile (appDirectory () + QStringLiteral (" %1.qml" ).arg (QCoreApplication::applicationName ())));
121+ }
118122 } else {
119- engine->load (QUrl::fromLocalFile (appDirectory () + QStringLiteral ( " %1.qml " ). arg ( QCoreApplication::applicationName ()) ));
123+ engine->load (QUrl::fromLocalFile (rootQMLPath ));
120124 }
121125
122126 if (engine->rootObjects ().isEmpty ()) {
@@ -157,6 +161,11 @@ QQuickWindow* GlacierApp::showWindow()
157161 return window;
158162}
159163
164+ QQuickWindow *GlacierApp::showWindow ()
165+ {
166+ return showWindow (QString ());
167+ }
168+
160169void GlacierApp::setLanguage (QLocale::Language lang)
161170{
162171#ifdef HAS_MLITE
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ class GlacierApp : public QObject {
3434public:
3535 static QGuiApplication* app (int & argc, char ** argv);
3636 static QQmlApplicationEngine* engine (QObject* parent = nullptr );
37+ static QQuickWindow* showWindow (QString rootQMLPath);
3738 static QQuickWindow* showWindow ();
3839 static void setLanguage (QLocale::Language lang);
3940 static void wipe ();
You can’t perform that action at this time.
0 commit comments