summaryrefslogtreecommitdiffstats
path: root/src/dialogs/qquickabstractdialog.cpp
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-04-27 03:01:14 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-04-27 03:01:14 +0200
commitd2a661f16e9982c45260efb9875b83c581b82287 (patch)
tree3a5f52f5509617c7e55788dd443bb8645a6adc37 /src/dialogs/qquickabstractdialog.cpp
parentbdff4debf5f3f8125e3b7876bb5c62bc4251727f (diff)
parent44fe49e573539e22709c2d5c996f1ca9ee8fd760 (diff)
Merge remote-tracking branch 'origin/5.13' into dev
Diffstat (limited to 'src/dialogs/qquickabstractdialog.cpp')
-rw-r--r--src/dialogs/qquickabstractdialog.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/dialogs/qquickabstractdialog.cpp b/src/dialogs/qquickabstractdialog.cpp
index e00c17a10..e71948d18 100644
--- a/src/dialogs/qquickabstractdialog.cpp
+++ b/src/dialogs/qquickabstractdialog.cpp
@@ -52,7 +52,7 @@ QT_BEGIN_NAMESPACE
Q_LOGGING_CATEGORY(lcWindow, "qt.quick.dialogs.window")
-QQmlComponent *QQuickAbstractDialog::m_decorationComponent(0);
+QUrl QQuickAbstractDialog::m_decorationComponentUrl = QUrl();
QQuickAbstractDialog::QQuickAbstractDialog(QObject *parent)
: QObject(parent)
@@ -151,6 +151,8 @@ void QQuickAbstractDialog::setVisible(bool v)
// If the platform does not support multiple windows, but the dialog is
// implemented as an Item, then try to decorate it as a fake window and make it visible.
if (!m_windowDecoration) {
+ if (!m_decorationComponent)
+ m_decorationComponent = new QQmlComponent(qmlEngine(this), m_decorationComponentUrl, QQmlComponent::Asynchronous, this);
if (m_decorationComponent) {
if (m_decorationComponent->isLoading())
connect(m_decorationComponent, SIGNAL(statusChanged(QQmlComponent::Status)),
@@ -232,7 +234,7 @@ void QQuickAbstractDialog::decorationLoaded()
"cannot be used as a window decoration because it's not an Item";
delete decoration;
delete m_decorationComponent;
- m_decorationComponent = 0;
+ m_decorationComponent = nullptr;
}
}
// Window decoration wasn't possible, so just reparent it into the scene