aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenny Lofthus <jenny.lofthus@qt.io>2022-10-05 13:23:08 +0200
committerJenny Lofthus <jenny.lofthus@qt.io>2022-10-12 16:13:43 +0200
commit29b3cbb983d864b21119dbcb58129db2c93c99c3 (patch)
tree38fd2414c1b0933813bc8d9bb018ae290f58a901
parentbfd863b2da4eacfd506fba91f96c7f48261b7b6b (diff)
Controls: update baseline test for Dialog
Fixed anchor errors from Layout. Changed positioning and added margins. Removed unnecessary lines. Added a second file to test modal. Change-Id: Ia4e1c0c058eaab88feca00d4883c7ccf56706055 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
-rw-r--r--tests/baseline/controls/data/dialog/dialog.qml92
-rw-r--r--tests/baseline/controls/data/dialog/modal.qml19
2 files changed, 45 insertions, 66 deletions
diff --git a/tests/baseline/controls/data/dialog/dialog.qml b/tests/baseline/controls/data/dialog/dialog.qml
index 6828ea4e80..fc3f3f26f3 100644
--- a/tests/baseline/controls/data/dialog/dialog.qml
+++ b/tests/baseline/controls/data/dialog/dialog.qml
@@ -1,77 +1,37 @@
import QtQuick
import QtQuick.Controls
-import QtQuick.Layouts
+Item {
+ width: 400
+ height: 200
-RowLayout {
- width: 800
- height: 800
- spacing: 2
-
- ColumnLayout {
- anchors.top: parent.top
- Dialog {
- height: 200
- visible: true
- header: Text {
- id: header
- text: qsTr("I am a text item in a dialog header")
- }
- title: "I am the title"
- footer: Text {
- id: footer
- text: qsTr("I am the footer item in this header")
- }
- }
- }
-
- ColumnLayout {
- anchors.centerIn: parent
- Dialog {
- visible: false
- enabled: false
- modal: true
- header: Text {
- id: header2
- text: qsTr("I am a text item in dialog header2")
- }
- title: "I am the title"
- footer: Text {
- id: footer2
- text: qsTr("I am the footer item in this dialog footer2")
- }
+ Dialog {
+ topMargin: 20
+ leftMargin: 20
+ height: 100
+ width: 50
+ visible: true
+ enabled: true
+ header: Text {
+ text: qsTr("dialog 1")
}
}
- ColumnLayout {
- anchors.centerIn: parent
- Dialog {
- width: 200
- visible: true
- id: dialog
- title: "Title"
- standardButtons: Dialog.Ok | Dialog.Cancel
- onAccepted: console.log("Ok clicked")
- onRejected: console.log("Cancel clicked")
- }
+ Dialog {
+ topMargin: 20
+ leftMargin: 90
+ height: 50
+ width: 50
+ visible: true
+ enabled: false
}
- ColumnLayout {
- anchors.right: parent.right
- Dialog {
- margins: 1
- height: 500
- visible: true
- enabled: false
- header: Text {
- id: header3
- text: qsTr("I am a text item in a dialog header for header3")
- }
- title: "I am the title"
- footer: Text {
- id: footer3
- text: qsTr("I am the footer item in this dialog for footer3")
- }
- }
+ Dialog {
+ topMargin: 20
+ leftMargin: 160
+ height: 60
+ width: 200
+ visible: true
+ standardButtons: Dialog.Ok | Dialog.Cancel
}
}
diff --git a/tests/baseline/controls/data/dialog/modal.qml b/tests/baseline/controls/data/dialog/modal.qml
new file mode 100644
index 0000000000..a602d6d037
--- /dev/null
+++ b/tests/baseline/controls/data/dialog/modal.qml
@@ -0,0 +1,19 @@
+import QtQuick
+import QtQuick.Controls
+
+Item {
+ width: 300
+ height: 200
+
+ Dialog {
+ anchors.centerIn: parent
+ height: 100
+ width: 100
+ visible: true
+ enabled: true
+ modal: true
+ header: Text {
+ text: qsTr("dialog 1")
+ }
+ }
+}