Showing the changes to libraries/script-engine/src/TabletScriptingInterface.cpp (1 of 6 files). Show all
Unified · Split
| @@ -54,10 +54,21 @@ QObject* TabletScriptingInterface::getTablet(const QString& tabletId) { · 53 unmodified lines | |||
| 54 | // allocate a new tablet, add it to the map then return it. | 54 | // allocate a new tablet, add it to the map then return it. |
| 55 | auto tabletProxy = QSharedPointer<TabletProxy>(new TabletProxy(tabletId)); | 55 | auto tabletProxy = QSharedPointer<TabletProxy>(new TabletProxy(tabletId)); |
| 56 | _tabletProxies[tabletId] = tabletProxy; | 56 | _tabletProxies[tabletId] = tabletProxy; |
| 57 | tabletProxy->setToolbarMode(_toolbarMode); | ||
| 57 | return tabletProxy.data(); | 58 | return tabletProxy.data(); |
| 58 | } | 59 | } |
| 59 | } | 60 | } |
| 60 | 61 | ||
| 62 | void TabletScriptingInterface::setToolbarMode(bool toolbarMode) { | ||
| 63 | std::lock_guard<std::mutex> guard(_mutex); | ||
| 64 | |||
| 65 | _toolbarMode = toolbarMode; | ||
| 66 | |||
| 67 | for (auto& iter : _tabletProxies) { | ||
| 68 | iter.second->setToolbarMode(toolbarMode); | ||
| 69 | } | ||
| 70 | } | ||
| 71 | |||
| 61 | void TabletScriptingInterface::setQmlTabletRoot(QString tabletId, QQuickItem* qmlTabletRoot, QObject* qmlOffscreenSurface) { | 72 | void TabletScriptingInterface::setQmlTabletRoot(QString tabletId, QQuickItem* qmlTabletRoot, QObject* qmlOffscreenSurface) { |
| 62 | TabletProxy* tablet = qobject_cast<TabletProxy*>(getTablet(tabletId)); | 73 | TabletProxy* tablet = qobject_cast<TabletProxy*>(getTablet(tabletId)); |
| 63 | if (tablet) { | 74 | if (tablet) { |