Showing the changes to interface/src/ui/InteractiveWindow.cpp (1 of 2 files). Show all
Unified · Split
| @@ -69,7 +69,6 @@ void interactiveWindowPointerFromScriptValue(const QScriptValue& object, Interac · 68 unmodified lines | ||
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | InteractiveWindow::InteractiveWindow(const QString& sourceUrl, const QVariantMap& properties) { |
| 72 | − bool docked = false; | |
| 73 | 72 | InteractiveWindowPresentationMode presentationMode = InteractiveWindowPresentationMode::Native; |
| 74 | 73 | |
| 75 | 74 | if (properties.contains(PRESENTATION_MODE_PROPERTY)) { |
| @@ -124,12 +123,12 @@ InteractiveWindow::InteractiveWindow(const QString& sourceUrl, const QVariantMap · 48 unmodified lines | ||
| 124 | 123 | QObject::connect(quickView.get(), &QQuickView::statusChanged, [&, this] (QQuickView::Status status) { |
| 125 | 124 | if (status == QQuickView::Ready) { |
| 126 | 125 | QQuickItem* rootItem = _dockWidget->getRootItem(); |
| 126 | + _dockWidget->getQuickView()->rootContext()->setContextProperty(EVENT_BRIDGE_PROPERTY, this); | |
| 127 | 127 | QObject::connect(rootItem, SIGNAL(sendToScript(QVariant)), this, SLOT(qmlToScript(const QVariant&)), Qt::QueuedConnection); |
| 128 | 128 | } |
| 129 | 129 | }); |
| 130 | 130 | _dockWidget->setSource(QUrl(sourceUrl)); |
| 131 | 131 | mainWindow->addDockWidget(dockArea, _dockWidget.get()); |
| 132 | − _dockedWindow = docked; | |
| 133 | 132 | } else { |
| 134 | 133 | auto offscreenUi = DependencyManager::get<OffscreenUi>(); |
| 135 | 134 | // Build the event bridge and wrapper on the main thread |
| @@ -188,10 +187,10 @@ InteractiveWindow::~InteractiveWindow() { · 52 unmodified lines | ||
| 188 | 187 | |
| 189 | 188 | void InteractiveWindow::sendToQml(const QVariant& message) { |
| 190 | 189 | // Forward messages received from the script on to QML |
| 191 | − if (_dockedWindow) { | |
| 190 | + if (_dockWidget) { | |
| 192 | 191 | QQuickItem* rootItem = _dockWidget->getRootItem(); |
| 193 | 192 | if (rootItem) { |
| 194 | − QMetaObject::invokeMethod(_qmlWindow, "fromScript", Qt::QueuedConnection, Q_ARG(QVariant, message)); | |
| 193 | + QMetaObject::invokeMethod(rootItem, "fromScript", Qt::QueuedConnection, Q_ARG(QVariant, message)); | |
| 195 | 194 | } |
| 196 | 195 | } else { |
| 197 | 196 | QMetaObject::invokeMethod(_qmlWindow, "fromScript", Qt::QueuedConnection, Q_ARG(QVariant, message)); |