From 9bb569ff083b3e1b34fbc607355b0342b7b3bc5d Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Wed, 15 Oct 2014 11:30:39 +0200 Subject: Dialogs: all QML dialogs must have the Qt::Dialog window type Being transient for the parent window is not enough to get the window manager to center them. Task-number: QTBUG-41844 Change-Id: I42ce018d5f08acabfeeeefa2a957dea907a6ca82 Reviewed-by: Laszlo Agocs Reviewed-by: Liang Qi --- src/dialogs/qquickabstractdialog.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dialogs/qquickabstractdialog.cpp b/src/dialogs/qquickabstractdialog.cpp index b8f4e18c..7c5ef334 100644 --- a/src/dialogs/qquickabstractdialog.cpp +++ b/src/dialogs/qquickabstractdialog.cpp @@ -88,6 +88,7 @@ void QQuickAbstractDialog::setVisible(bool v) if (!m_dialogWindow && m_hasNativeWindows) { QQuickWindow *win = new QQuickWindow; ((QObject *)win)->setParent(this); // memory management only + win->setFlags(Qt::Dialog); m_dialogWindow = win; m_contentItem->setParentItem(win->contentItem()); QSize minSize = QSize(m_contentItem->implicitWidth(), m_contentItem->implicitHeight()); -- cgit v1.2.1