forked from qt-creator/qt-creator
QmlDesigner: Set Core::ICore::dialogParent() for QML windows
Change-Id: Ie09c7255495456cb76e94504392c9474e2a88688 Reviewed-by: Brook Cronin <brook.cronin@qt.io> Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io> Reviewed-by: Henning Gründl <henning.gruendl@qt.io> Reviewed-by: Aleksei German <aleksei.german@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -3,8 +3,11 @@
|
||||
|
||||
#include "studioquickwidget.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
#include <QQuickItem>
|
||||
#include <QVBoxLayout>
|
||||
#include <QWindow>
|
||||
#include <QtQml/QQmlEngine>
|
||||
|
||||
QQmlEngine *s_engine = nullptr;
|
||||
@@ -46,6 +49,14 @@ void StudioQuickWidget::setResizeMode(QQuickWidget::ResizeMode mode)
|
||||
void StudioQuickWidget::setSource(const QUrl &url)
|
||||
{
|
||||
m_quickWidget->setSource(url);
|
||||
|
||||
if (rootObject()) {
|
||||
const auto windows = rootObject()->findChildren<QWindow *>();
|
||||
|
||||
for (auto window : windows) {
|
||||
window->setTransientParent(Core::ICore::dialogParent()->windowHandle());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void StudioQuickWidget::refresh() {}
|
||||
|
Reference in New Issue
Block a user