diff options
author | Balazs Egedi <egedib@inf.u-szeged.hu> | 2021-06-16 14:55:18 +0200 |
---|---|---|
committer | Michal Klocek <michal.klocek@qt.io> | 2021-07-06 13:05:49 +0000 |
commit | a060012ecef7ecc60f5518b6718136b22a10dc6b (patch) | |
tree | f8caddb6190f3a4bea0b8e1e161b9e0708333181 /src/webenginequick/ui/AlertDialog.qml | |
parent | ccb3fece7d9306bf2c02fcd80505d6a4c3822f35 (diff) | |
download | qtwebengine-a060012ecef7ecc60f5518b6718136b22a10dc6b.tar.gz |
Remove Quick Controls 1 UIDelegates and introduce UIDelegates test
- Renamed Controls2Delegates to ControlsDelegates
- Removed option to use Quick Controls 1 delegates
- Added test to check if controls are shown
Task-number: QTBUG-93666
Change-Id: Iccca948615309285db7fc57d14fb1cdcdef28051
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
(cherry picked from commit 4fe808a8c0ecd143199781e9644a46e4b1b90653)
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/webenginequick/ui/AlertDialog.qml')
-rw-r--r-- | src/webenginequick/ui/AlertDialog.qml | 61 |
1 files changed, 58 insertions, 3 deletions
diff --git a/src/webenginequick/ui/AlertDialog.qml b/src/webenginequick/ui/AlertDialog.qml index 07f2d7df5..a806ec306 100644 --- a/src/webenginequick/ui/AlertDialog.qml +++ b/src/webenginequick/ui/AlertDialog.qml @@ -37,8 +37,63 @@ ** ****************************************************************************/ -import QtQuick.Dialogs 1.2 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts -MessageDialog { - icon: StandardIcon.Information +Dialog { + property alias text: message.text + property bool handled: false + signal accepted() + signal rejected() + title: qsTr("Alert Dialog") + modal: false + anchors.centerIn: parent + objectName: "alertDialog" + + //handle the case where users simply closes the dialog + onVisibleChanged: { + if (visible == false && handled == false) { + handled = true; + rejected(); + } else { + handled = false; + } + } + + function acceptDialog() { + accepted(); + handled = true; + close(); + } + + ColumnLayout { + id: rootLayout + anchors.fill: parent + anchors.margins: 4 + property int minimumWidth: rootLayout.implicitWidth + rootLayout.doubleMargins + property int minimumHeight: rootLayout.implicitHeight + rootLayout.doubleMargins + property int doubleMargins: anchors.margins * 2 + SystemPalette { id: palette; colorGroup: SystemPalette.Active } + RowLayout { + Layout.alignment: Qt.AlignRight + spacing: 8 + Image { + source: "qrc:/qt-project.org/imports/QtWebEngine/ControlsDelegates/information.png" + } + Label { + id: message + Layout.fillWidth: true + color: palette.windowText + } + } + Item { + Layout.fillHeight: true + } + Button { + Layout.alignment: Qt.AlignHCenter + text: qsTr("OK") + onClicked: acceptDialog() + } + } } |