Showing the changes to libraries/script-engine/src/TabletScriptingInterface.cpp (1 of 2 files). Show all
Unified · Split
| @@ -49,13 +49,14 @@ QObject* TabletScriptingInterface::getTablet(const QString& tabletId) { · 48 unmodified lines | ||
| 49 | 49 | auto iter = _tabletProxies.find(tabletId); |
| 50 | 50 | if (iter != _tabletProxies.end()) { |
| 51 | 51 | // tablet already exists, just return it. |
| 52 | − return iter->second.data(); | |
| 52 | + return iter->second; | |
| 53 | 53 | } else { |
| 54 | 54 | // allocate a new tablet, add it to the map then return it. |
| 55 | − auto tabletProxy = QSharedPointer<TabletProxy>(new TabletProxy(tabletId)); | |
| 55 | + auto tabletProxy = new TabletProxy(tabletId); | |
| 56 | + tabletProxy->setParent(this); | |
| 56 | 57 | _tabletProxies[tabletId] = tabletProxy; |
| 57 | 58 | tabletProxy->setToolbarMode(_toolbarMode); |
| 58 | − return tabletProxy.data(); | |
| 59 | + return tabletProxy; | |
| 59 | 60 | } |
| 60 | 61 | } |
| 61 | 62 | |
| @@ -176,7 +177,6 @@ class TabletRootWindow : public QmlWindowClass { · 114 unmodified lines | ||
| 176 | 177 | }; |
| 177 | 178 | |
| 178 | 179 | TabletProxy::TabletProxy(QString name) : _name(name) { |
| 179 | − | |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | void TabletProxy::setToolbarMode(bool toolbarMode) { |