History

Merge branch 'tablet-ui-edit-js' of github.com:sethalves/hifi into menuFix

Dante Ruiz committed 9 years ago

Commit e2479a72 parents d5714bf 319c5f622 files · +773 −608Browse files

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

Unified · Split

libraries/script-engine/src/TabletScriptingInterface.cpp+17−3
@@ -356,8 +356,15 @@ void TabletProxy::pushOntoStack(const QVariant& path) { · 355 unmodified lines
356356 } else {
357357 qCDebug(scriptengine) << "tablet cannot push QML because _qmlTabletRoot doesn't have child stack";
358358 }
359+ } else if (_desktopWindow) {
360+ auto stack = _desktopWindow->asQuickItem()->findChild<QQuickItem*>("stack");
361+ if (stack) {
362+ QMetaObject::invokeMethod(stack, "pushSource", Q_ARG(const QVariant&, path));
363+ } else {
364+ qCDebug(scriptengine) << "tablet cannot push QML because _desktopWindow doesn't have child stack";
365+ }
359366 } else {
360− qCDebug(scriptengine) << "tablet cannot push QML because _qmlTabletRoot is null";
367+ qCDebug(scriptengine) << "tablet cannot push QML because _qmlTabletRoot or _desktopWindow is null";
361368 }
362369 }
363370
@@ -367,10 +374,17 @@ void TabletProxy::popFromStack() { · 3 unmodified lines
367374 if (stack) {
368375 QMetaObject::invokeMethod(stack, "popSource");
369376 } else {
370− qCDebug(scriptengine) << "tablet cannot pop QML because _qmlTabletRoot doesn't have child stack";
377+ qCDebug(scriptengine) << "tablet cannot push QML because _qmlTabletRoot doesn't have child stack";
378+ }
379+ } else if (_desktopWindow) {
380+ auto stack = _desktopWindow->asQuickItem()->findChild<QQuickItem*>("stack");
381+ if (stack) {
382+ QMetaObject::invokeMethod(stack, "popSource");
383+ } else {
384+ qCDebug(scriptengine) << "tablet cannot pop QML because _desktopWindow doesn't have child stack";
371385 }
372386 } else {
373− qCDebug(scriptengine) << "tablet cannot pop QML because _qmlTabletRoot is null";
387+ qCDebug(scriptengine) << "tablet cannot pop QML because _qmlTabletRoot or _desktopWindow is null";
374388 }
375389 }
376390