History

InteractiveWindow scripting API

Thijs Wenker committed 8 years ago

Commit 50297671 parent 736c56f8 files · +755 −4Browse files

Showing the changes to interface/src/scripting/DesktopScriptingInterface.cpp (1 of 8 files). Show all

Unified · Split

interface/src/scripting/DesktopScriptingInterface.cpp+13−0
@@ -14,6 +14,8 @@ · 13 unmodified lines
1414 #include <QWindow>
1515 #include <QScreen>
1616
17+#include <shared/QtHelpers.h>
18+
1719 #include "Application.h"
1820 #include "MainWindow.h"
1921 #include <display-plugins/CompositorHelper.h>
@@ -41,3 +43,14 @@ void DesktopScriptingInterface::show(const QString& path, const QString& title) · 21 unmodified lines
4143 DependencyManager::get<OffscreenUi>()->show(path, title);
4244 }
4345
46+InteractiveWindowPointer DesktopScriptingInterface::createWindow(const QString& sourceUrl, const QVariantMap& properties) {
47+ if (QThread::currentThread() != thread()) {
48+ InteractiveWindowPointer interactiveWindow = nullptr;
49+ BLOCKING_INVOKE_METHOD(this, "createWindow",
50+ Q_RETURN_ARG(InteractiveWindowPointer, interactiveWindow),
51+ Q_ARG(QString, sourceUrl),
52+ Q_ARG(QVariantMap, properties));
53+ return interactiveWindow;
54+ }
55+ return new InteractiveWindow(sourceUrl, properties);;
56+}