Showing the changes to interface/src/scripting/WebWindowClass.cpp (1 of 6 files). Show all
Unified · Split
| @@ -11,9 +11,13 @@ · 10 unmodified lines | ||
| 11 | 11 | |
| 12 | 12 | #include <QVBoxLayout> |
| 13 | 13 | #include <QApplication> |
| 14 | +#include <QMainWindow> | |
| 15 | +#include <QDockWidget> | |
| 14 | 16 | #include <QWebFrame> |
| 15 | 17 | #include <QWebView> |
| 18 | +#include <QListWidget> | |
| 16 | 19 | |
| 20 | +#include "Application.h" | |
| 17 | 21 | #include "WindowScriptingInterface.h" |
| 18 | 22 | #include "WebWindowClass.h" |
| 19 | 23 | |
| @@ -31,18 +35,17 @@ void ScriptEventBridge::emitScriptEvent(const QString& data) { · 11 unmodified lines | ||
| 31 | 35 | |
| 32 | 36 | WebWindowClass::WebWindowClass(const QString& title, const QString& url, int width, int height) |
| 33 | 37 | : QObject(NULL), |
| 34 | − _window(new QWidget(NULL, Qt::Tool)), | |
| 35 | 38 | _eventBridge(new ScriptEventBridge(this)) { |
| 36 | 39 | |
| 40 | + QMainWindow* toolWindow = Application::getInstance()->getToolWindow(); | |
| 41 | + | |
| 42 | + _window = new QDockWidget(title, toolWindow); | |
| 37 | 43 | QWebView* webView = new QWebView(_window); |
| 38 | 44 | webView->page()->mainFrame()->addToJavaScriptWindowObject("EventBridge", _eventBridge); |
| 39 | 45 | webView->setUrl(url); |
| 40 | − QVBoxLayout* layout = new QVBoxLayout(_window); | |
| 41 | − _window->setLayout(layout); | |
| 42 | − layout->addWidget(webView); | |
| 43 | − layout->setSpacing(0); | |
| 44 | − layout->setContentsMargins(0, 0, 0, 0); | |
| 45 | − _window->setGeometry(0, 0, width, height); | |
| 46 | + _window->setWidget(webView); | |
| 47 | + | |
| 48 | + toolWindow->addDockWidget(Qt::RightDockWidgetArea, _window); | |
| 46 | 49 | |
| 47 | 50 | connect(this, &WebWindowClass::destroyed, _window, &QWidget::deleteLater); |
| 48 | 51 | } |