diff options
Diffstat (limited to 'examples/quickcontrols2/gallery/gallery.qml')
-rw-r--r-- | examples/quickcontrols2/gallery/gallery.qml | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/examples/quickcontrols2/gallery/gallery.qml b/examples/quickcontrols2/gallery/gallery.qml index c603184a..753a8c00 100644 --- a/examples/quickcontrols2/gallery/gallery.qml +++ b/examples/quickcontrols2/gallery/gallery.qml @@ -207,7 +207,7 @@ ApplicationWindow { } } - Popup { + Dialog { id: settingsDialog x: Math.round((window.width - width) / 2) y: Math.round(window.height / 6) @@ -216,6 +216,16 @@ ApplicationWindow { modal: true focus: true + standardButtons: Dialog.Ok | Dialog.Cancel + onAccepted: { + settings.style = styleBox.displayText + settingsDialog.close() + } + onRejected: { + styleBox.currentIndex = styleBox.styleIndex + settingsDialog.close() + } + contentItem: ColumnLayout { id: settingsColumn spacing: 20 @@ -254,22 +264,10 @@ ApplicationWindow { Layout.fillWidth: true Layout.fillHeight: true } - - DialogButtonBox { - standardButtons: DialogButtonBox.Ok | DialogButtonBox.Cancel - onAccepted: { - settings.style = styleBox.displayText - settingsDialog.close() - } - onRejected: { - styleBox.currentIndex = styleBox.styleIndex - settingsDialog.close() - } - } } } - Popup { + Dialog { id: aboutDialog modal: true focus: true |