History

general function to load QML for javascript for tablet

(cherry picked from commit b50e20c5457151368b7ead81bf44ce678de9dbe2)

Dante Ruiz committed 9 years ago

Commit 7db86201 parent 4554d8b2 files · +11 −1Browse files

Showing the changes to libraries/script-engine/src/TabletScriptingInterface.cpp (1 of 2 files). Show all

Unified · Split

libraries/script-engine/src/TabletScriptingInterface.cpp+8−0
@@ -212,6 +212,14 @@ void TabletProxy::gotoMenuScreen() { · 211 unmodified lines
212212 }
213213 }
214214
215+void TabletProxy::loadQMLSource(const QVariant& path) {
216+ if (_qmlTabletRoot) {
217+ if (_state != State::QML) {
218+ QMetaObject::invokeMethod(_qmlTabletRoot, "loadSource", Q_ARG(const QVariant&, path));
219+ _state = State::QML;
220+ }
221+ }
222+}
215223 void TabletProxy::gotoHomeScreen() {
216224 if (_qmlTabletRoot) {
217225 if (_state != State::Home) {