Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.3.0, 5.3.1
-
None
Description
Next simple example must show us dialog, and according to documentation it must be centered over the Window (http://qt-project.org/doc/qt-5/qml-qtquick-dialogs-messagedialog.html)
A MessageDialog window is automatically transient for its parent window. So whether you declare the dialog inside an Item or inside a Window, the dialog will appear centered over the window containing the item, or over the Window that you declared.
import QtQuick 2.2 import QtQuick.Window 2.1 import QtQuick.Dialogs 1.2 import QtQuick.Controls 1.2 Window { visible: true width: 360 height: 360 Button { anchors.centerIn: parent text: "Push me" onClicked: testDialog.visible = true } MessageDialog { id: testDialog modality: Qt.ApplicationModal title: "MessageDialog" text: "This dialog must be centered in parent window" standardButtons: StandardButton.Ok visible: false } }
But as a result every time I got MessageDialog positioned in top left corner of screen.
Attachments
Issue Links
- relates to
-
QTBUG-36185 Popup QDialog does not centre in parent in some cases
- Closed
-
QTBUG-63406 widget-based MessageDialog doesn't get centered over its transient parent
- Closed