diff options
author | Shawn Rutledge <shawn.rutledge@digia.com> | 2013-09-25 14:22:29 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-15 08:08:11 +0200 |
commit | 270125b61404a8e7b0571e4e966f05995bb90800 (patch) | |
tree | 3ac3acef072659ade61ed7fc1aeaf1ce42fc8f9f /src/imports | |
parent | 6fbf62e8e1e1739a3c993de1cec785c0f7625602 (diff) |
QtQuick.Dialogs: on single-window platforms, don't resize the window
m_dialogWindow only needs to be set if the dialog has its own window,
because otherwise setters such as QQuickAbstractDialog::setHeight
(introduced in 37492efee021ccc6e550ecb67a3240b76eb2219e)
will result in reshaping the main application window instead of the
dialog. Also the window decoration's translucent "veil" should
expand to fit the whole application.
Change-Id: I16fdb48c54dbc5e758dfec1f18063579ac2bbb05
Reviewed-by: Liang Qi <liang.qi@digia.com>
Diffstat (limited to 'src/imports')
-rw-r--r-- | src/imports/dialogs/qquickabstractdialog.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/imports/dialogs/qquickabstractdialog.cpp b/src/imports/dialogs/qquickabstractdialog.cpp index 17f8d1aef2..633e5b7269 100644 --- a/src/imports/dialogs/qquickabstractdialog.cpp +++ b/src/imports/dialogs/qquickabstractdialog.cpp @@ -92,7 +92,8 @@ void QQuickAbstractDialog::setVisible(bool v) if (!m_dialogWindow) { m_contentItem = qobject_cast<QQuickItem *>(m_qmlImplementation); if (m_contentItem) { - m_dialogWindow = m_contentItem->window(); + if (m_hasNativeWindows) + m_dialogWindow = m_contentItem->window(); // An Item-based dialog implementation doesn't come with a window, so // we have to instantiate one iff the platform allows it. if (!m_dialogWindow && m_hasNativeWindows) { @@ -163,6 +164,8 @@ void QQuickAbstractDialog::decorationLoaded() { bool ok = false; QQuickItem *parentItem = qobject_cast<QQuickItem *>(parent()); + while (parentItem->parentItem() && !parentItem->parentItem()->inherits("QQuickRootItem")) + parentItem = parentItem->parentItem(); if (m_decorationComponent->isError()) { qWarning() << m_decorationComponent->errors(); } else { |