aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-10-31 13:08:12 +0100
committerJ-P Nurmi <jpnurmi@qt.io>2016-10-31 13:08:12 +0100
commit10972ca272ae59fbe0f18eef6d9237fbd4aaca86 (patch)
tree4c2766b234368b2e401dc955bd44faf8088deada /tests
parente09a8591990e5281929ca2a7bb180bb3a35556ba (diff)
parent548b0bdd0f57c2209c8cbd7ac4ecda204cf69a2e (diff)
Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts: src/imports/controls/CheckIndicator.qml src/imports/controls/RadioIndicator.qml src/imports/controls/RangeSlider.qml src/imports/controls/Slider.qml src/imports/controls/SwitchIndicator.qml Change-Id: I32612d2f905ffa02dbaedbb1f84c8237fbd66db3
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/controls/data/tst_popup.qml31
-rw-r--r--tests/auto/controls/data/tst_scrollbar.qml16
-rw-r--r--tests/auto/controls/data/tst_scrollindicator.qml16
-rw-r--r--tests/auto/drawer/tst_drawer.cpp2
-rw-r--r--tests/manual/testbench/main.cpp2
-rw-r--r--tests/manual/testbench/qml.qrc2
-rw-r--r--tests/manual/testbench/testbench.qml (renamed from tests/manual/testbench/main.qml)140
7 files changed, 204 insertions, 5 deletions
diff --git a/tests/auto/controls/data/tst_popup.qml b/tests/auto/controls/data/tst_popup.qml
index c81c6341..982ac7ab 100644
--- a/tests/auto/controls/data/tst_popup.qml
+++ b/tests/auto/controls/data/tst_popup.qml
@@ -1229,4 +1229,35 @@ TestCase {
control.destroy()
}
+
+ Component {
+ id: xyBindingLoop
+ ApplicationWindow {
+ id: window
+ width: 360
+ height: 360
+ visible: true
+ property alias popup: popup
+
+ Popup {
+ id: popup
+ visible: true
+ x: (parent.width - width) / 2
+ y: (parent.height - height) / 2
+ Label {
+ text: "Content"
+ anchors.fill: parent
+ }
+ }
+ }
+ }
+
+ function test_xyBindingLoop() {
+ var window = xyBindingLoop.createObject(testCase)
+ var control = window.popup
+ waitForRendering(control.contentItem)
+ compare(control.x, (control.parent.width - control.width) / 2)
+ compare(control.y, (control.parent.height - control.height) / 2)
+ window.destroy()
+ }
}
diff --git a/tests/auto/controls/data/tst_scrollbar.qml b/tests/auto/controls/data/tst_scrollbar.qml
index 15b4b3f0..54ecf15f 100644
--- a/tests/auto/controls/data/tst_scrollbar.qml
+++ b/tests/auto/controls/data/tst_scrollbar.qml
@@ -155,6 +155,22 @@ TestCase {
compare(horizontal.size, container.visibleArea.widthRatio)
compare(horizontal.position, container.visibleArea.xPosition)
+ var oldY = vertical.y
+ var oldHeight = vertical.height
+ vertical.parent = testCase
+ vertical.y -= 10
+ container.height += 10
+ compare(vertical.y, oldY - 10)
+ compare(vertical.height, oldHeight)
+
+ var oldX = horizontal.x
+ var oldWidth = horizontal.width
+ horizontal.parent = testCase
+ horizontal.x -= 10
+ container.width += 10
+ compare(horizontal.x, oldX - 10)
+ compare(horizontal.width, oldWidth)
+
container.destroy()
}
diff --git a/tests/auto/controls/data/tst_scrollindicator.qml b/tests/auto/controls/data/tst_scrollindicator.qml
index 551247f6..1ec03b15 100644
--- a/tests/auto/controls/data/tst_scrollindicator.qml
+++ b/tests/auto/controls/data/tst_scrollindicator.qml
@@ -150,6 +150,22 @@ TestCase {
compare(horizontal.size, container.visibleArea.widthRatio)
compare(horizontal.position, container.visibleArea.xPosition)
+ var oldY = vertical.y
+ var oldHeight = vertical.height
+ vertical.parent = testCase
+ vertical.y -= 10
+ container.height += 10
+ compare(vertical.y, oldY - 10)
+ compare(vertical.height, oldHeight)
+
+ var oldX = horizontal.x
+ var oldWidth = horizontal.width
+ horizontal.parent = testCase
+ horizontal.x -= 10
+ container.width += 10
+ compare(horizontal.x, oldX - 10)
+ compare(horizontal.width, oldWidth)
+
container.destroy()
}
diff --git a/tests/auto/drawer/tst_drawer.cpp b/tests/auto/drawer/tst_drawer.cpp
index 58a5ba3c..a523beed 100644
--- a/tests/auto/drawer/tst_drawer.cpp
+++ b/tests/auto/drawer/tst_drawer.cpp
@@ -380,7 +380,7 @@ void tst_Drawer::reposition()
window->setWidth(window->width() + 100);
QTRY_COMPARE(geometry(dimmer), QRectF(0, 150, window->width(), window->height() - 150));
- QCOMPARE(geometry(popupItem), QRectF(window->width() - drawer->width(), 150, window->width() / 2, window->height() - 150));
+ QTRY_COMPARE(geometry(popupItem), QRectF(window->width() - drawer->width(), 150, window->width() / 2, window->height() - 150));
drawer->close();
QTRY_COMPARE(geometry(popupItem), QRectF(window->width(), 150, window->width() / 2, window->height() - 150));
diff --git a/tests/manual/testbench/main.cpp b/tests/manual/testbench/main.cpp
index a782b5fe..5a54dab3 100644
--- a/tests/manual/testbench/main.cpp
+++ b/tests/manual/testbench/main.cpp
@@ -54,7 +54,7 @@ int main(int argc, char *argv[])
// TODO: move style selection into app UI and use settings to save choices.
// qputenv("QT_QUICK_CONTROLS_STYLE", "material");
QQmlApplicationEngine engine;
- engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
+ engine.load(QUrl(QStringLiteral("qrc:/testbench.qml")));
return app.exec();
}
diff --git a/tests/manual/testbench/qml.qrc b/tests/manual/testbench/qml.qrc
index 5f6483ac..9f4b1783 100644
--- a/tests/manual/testbench/qml.qrc
+++ b/tests/manual/testbench/qml.qrc
@@ -1,5 +1,5 @@
<RCC>
<qresource prefix="/">
- <file>main.qml</file>
+ <file>testbench.qml</file>
</qresource>
</RCC>
diff --git a/tests/manual/testbench/main.qml b/tests/manual/testbench/testbench.qml
index ea59d5b5..38fd06fc 100644
--- a/tests/manual/testbench/main.qml
+++ b/tests/manual/testbench/testbench.qml
@@ -745,14 +745,14 @@ ApplicationWindow {
Frame {
Tumbler {
model: 5
- implicitWidth: 100
+ implicitWidth: 80
implicitHeight: 100
}
}
Frame {
Tumbler {
model: 5
- implicitWidth: 100
+ implicitWidth: 80
implicitHeight: 100
enabled: false
}
@@ -761,11 +761,147 @@ ApplicationWindow {
RowLayout {
Dial {
+ implicitWidth: 100
+ implicitHeight: 100
}
Dial {
+ implicitWidth: 100
+ implicitHeight: 100
enabled: false
}
}
+
+ ListModel {
+ id: checkableDelegateModel
+ ListElement { label: "Normal" }
+ ListElement { label: "Pressed"; press: true }
+ ListElement { label: "Checked"; check: true }
+ ListElement { label: "CH + PR"; check: true; press: true }
+ ListElement { label: "Disabled"; disabled: true }
+ }
+
+ RowLayout {
+ Frame {
+ Column {
+ width: 200
+
+ Repeater {
+ model: checkableDelegateModel
+ delegate: CheckDelegate {
+ text: label
+ width: parent.width
+ down: press
+ checked: check
+ enabled: !disabled
+ ButtonGroup.group: radioButtonGroup
+ }
+ }
+ }
+ }
+
+ ButtonGroup {
+ id: radioButtonGroup
+ }
+
+ Frame {
+ Column {
+ width: 200
+
+ Repeater {
+ model: checkableDelegateModel
+ delegate: RadioDelegate {
+ text: label
+ down: press
+ width: parent.width
+ checked: check
+ enabled: !disabled
+ ButtonGroup.group: radioButtonGroup
+ }
+ }
+ }
+ }
+
+ Frame {
+ Column {
+ width: 200
+
+ Repeater {
+ model: checkableDelegateModel
+ delegate: SwitchDelegate {
+ text: label
+ width: parent.width
+ checked: check
+ down: press
+ enabled: !disabled
+ }
+ }
+ }
+ }
+ }
+
+ ListModel {
+ id: regularDelegateModel
+ ListElement { label: "Normal" }
+ ListElement { label: "Pressed"; press: true }
+ ListElement { label: "Disabled"; disabled: true }
+ }
+
+ RowLayout {
+ Frame {
+ Column {
+ width: 200
+
+ Repeater {
+ model: regularDelegateModel
+ delegate: ItemDelegate {
+ text: label
+ width: parent.width
+ down: press
+ enabled: !disabled
+ }
+ }
+ }
+ }
+ Frame {
+ Column {
+ id: listView
+ width: 200
+ clip: true
+
+ Repeater {
+ model: regularDelegateModel
+ delegate: SwipeDelegate {
+ id: swipeDelegate
+ text: label
+ width: parent.width
+ down: press
+ enabled: !disabled
+
+ Component {
+ id: removeComponent
+
+ Rectangle {
+ color: swipeDelegate.swipe.complete && swipeDelegate.pressed ? "#333" : "#444"
+ width: parent.width
+ height: parent.height
+ clip: true
+
+ Label {
+ font.pixelSize: swipeDelegate.font.pixelSize
+ text: "Boop"
+ color: "white"
+ anchors.centerIn: parent
+ }
+ }
+ }
+
+ swipe.left: removeComponent
+ swipe.right: removeComponent
+ }
+ }
+ }
+ }
+ }
}
}
}