diff options
author | Liang Qi <liang.qi@qt.io> | 2019-07-04 13:35:55 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2019-07-04 13:35:55 +0200 |
commit | 5211cf2843af606b912e9130d44ee6c82eeb40b0 (patch) | |
tree | d2a90e480d497edc3bbac367bf974ec93076e409 /tests | |
parent | 13bdd61c6597586f62558ca337c193ce03db26cc (diff) | |
parent | ce7c431fb23157fa5125d1102a594de045818a72 (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
.qmake.conf
tests/auto/accessibility/tst_accessibility.cpp
Change-Id: I0bc187e2a8edb4e357c1bf114dd9b1977d5c1e45
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/accessibility/tst_accessibility.cpp | 4 | ||||
-rw-r--r-- | tests/auto/controls/data/tst_action.qml | 29 | ||||
-rw-r--r-- | tests/auto/controls/data/tst_combobox.qml | 58 | ||||
-rw-r--r-- | tests/auto/controls/data/tst_tabbar.qml | 23 | ||||
-rw-r--r-- | tests/auto/qquickmenu/tst_qquickmenu.cpp | 5 |
5 files changed, 115 insertions, 4 deletions
diff --git a/tests/auto/accessibility/tst_accessibility.cpp b/tests/auto/accessibility/tst_accessibility.cpp index 87674a6b..868b4413 100644 --- a/tests/auto/accessibility/tst_accessibility.cpp +++ b/tests/auto/accessibility/tst_accessibility.cpp @@ -100,7 +100,7 @@ void tst_accessibility::a11y_data() QTest::newRow("StackView") << "stackview" << QAccessible::LayeredPane << ""; QTest::newRow("SwipeDelegate") << "swipedelegate" << QAccessible::ListItem << "SwipeDelegate"; QTest::newRow("SwipeView") << "swipeview" << QAccessible::PageTabList << ""; - QTest::newRow("Switch") << "switch" << QAccessible::Button << "Switch"; + QTest::newRow("Switch") << "switch" << QAccessible::CheckBox << "Switch"; QTest::newRow("SwitchDelegate") << "switchdelegate" << QAccessible::ListItem << "SwitchDelegate"; QTest::newRow("TabBar") << "tabbar" << QAccessible::PageTabList << ""; QTest::newRow("TabButton") << "tabbutton" << QAccessible::PageTab << "TabButton"; @@ -109,7 +109,7 @@ void tst_accessibility::a11y_data() QTest::newRow("ToolBar") << "toolbar" << QAccessible::ToolBar << ""; QTest::newRow("ToolButton") << "toolbutton" << QAccessible::Button << "ToolButton"; QTest::newRow("ToolTip") << "tooltip" << QAccessible::ToolTip << "ToolTip"; - QTest::newRow("Tumbler") << "tumbler" << QAccessible::NoRole << ""; // (TODO) + QTest::newRow("Tumbler") << "tumbler" << QAccessible::NoRole << ""; // TODO QTest::newRow("DayOfWeekRow") << "dayofweekrow" << QAccessible::NoRole << "DayOfWeekRow"; QTest::newRow("MonthGrid") << "monthgrid" << QAccessible::NoRole << "MonthGrid"; diff --git a/tests/auto/controls/data/tst_action.qml b/tests/auto/controls/data/tst_action.qml index ef28c0e5..0e41b7f3 100644 --- a/tests/auto/controls/data/tst_action.qml +++ b/tests/auto/controls/data/tst_action.qml @@ -165,4 +165,33 @@ TestCase { keyClick(Qt.Key_A, Qt.ControlModifier) compare(spy.count, 1) } + + Component { + id: shortcutBinding + Item { + Action { + id: action + shortcut: StandardKey.Copy + } + + Shortcut { + id: indirectShortcut + sequence: action.shortcut + } + + Shortcut { + id: directShortcut + sequence: StandardKey.Copy + } + + property alias indirect: indirectShortcut; + property alias direct: directShortcut + } + } + + function test_shortcutBinding() { + var container = createTemporaryObject(shortcutBinding, testCase); + verify(container) + compare(container.indirect.nativeText, container.direct.nativeText); + } } diff --git a/tests/auto/controls/data/tst_combobox.qml b/tests/auto/controls/data/tst_combobox.qml index 0d266e1a..f8f06679 100644 --- a/tests/auto/controls/data/tst_combobox.qml +++ b/tests/auto/controls/data/tst_combobox.qml @@ -96,6 +96,45 @@ TestCase { } } + Component { + id: comboBoxWithShaderEffect + ComboBox { + delegate: Rectangle { + Text { + id: txt + anchors.centerIn: parent + text: "item" + index + font.pixelSize: 20 + color: "red" + } + id: rect + objectName: "rect" + width: parent.width + height: txt.implicitHeight + gradient: Gradient { + GradientStop { color: "lightsteelblue"; position: 0.0 } + GradientStop { color: "blue"; position: 1.0 } + } + layer.enabled: true + layer.effect: ShaderEffect { + objectName: "ShaderFX" + width: rect.width + height: rect.height + fragmentShader: " + uniform lowp sampler2D source; // this item + uniform lowp float qt_Opacity; // inherited opacity of this item + varying highp vec2 qt_TexCoord0; + void main() { + lowp vec4 p = texture2D(source, qt_TexCoord0); + lowp float g = dot(p.xyz, vec3(0.344, 0.5, 0.156)); + gl_FragColor = vec4(g, g, g, p.a) * qt_Opacity; + }" + + } + } + } + } + function init() { // QTBUG-61225: Move the mouse away to avoid QQuickWindowPrivate::flushFrameSynchronousEvents() // delivering interfering hover events based on the last mouse position from earlier tests. For @@ -1731,4 +1770,23 @@ TestCase { closedSpy.wait() compare(closedSpy.count, 1) } + + function test_comboBoxWithShaderEffect() { + var control = createTemporaryObject(comboBoxWithShaderEffect, testCase, {model: 9}) + verify(control) + waitForRendering(control) + control.forceActiveFocus() + var openedSpy = signalSpy.createObject(control, {target: control.popup, signalName: "opened"}) + verify(openedSpy.valid) + + var closedSpy = signalSpy.createObject(control, {target: control.popup, signalName: "closed"}) + verify(closedSpy.valid) + + control.popup.open() + openedSpy.wait() + compare(openedSpy.count, 1) + control.popup.close() + closedSpy.wait() + compare(closedSpy.count, 1) + } } diff --git a/tests/auto/controls/data/tst_tabbar.qml b/tests/auto/controls/data/tst_tabbar.qml index 519b1d53..42e767f2 100644 --- a/tests/auto/controls/data/tst_tabbar.qml +++ b/tests/auto/controls/data/tst_tabbar.qml @@ -270,6 +270,29 @@ TestCase { compare(contentChildrenSpy.count, 12) } + function test_removeCurrent() { + var control = createTemporaryObject(tabBar, testCase) + + control.addItem(tabButton.createObject(control, {text: "1"})) + control.addItem(tabButton.createObject(control, {text: "2"})) + control.addItem(tabButton.createObject(control, {text: "3"})) + control.currentIndex = 1 + compare(control.count, 3) + compare(control.currentIndex, 1) + + control.removeItem(1) + compare(control.count, 2) + compare(control.currentIndex, 0) + + control.removeItem(0) + compare(control.count, 1) + compare(control.currentIndex, 0) + + control.removeItem(0) + compare(control.count, 0) + compare(control.currentIndex, -1) + } + Component { id: contentBar TabBar { diff --git a/tests/auto/qquickmenu/tst_qquickmenu.cpp b/tests/auto/qquickmenu/tst_qquickmenu.cpp index 49fdc066..f22ac972 100644 --- a/tests/auto/qquickmenu/tst_qquickmenu.cpp +++ b/tests/auto/qquickmenu/tst_qquickmenu.cpp @@ -1105,8 +1105,9 @@ void tst_QQuickMenu::subMenuMouse() QCOMPARE(mainMenu->isVisible(), cascade); QVERIFY(subMenu1->isVisible()); QVERIFY(!subMenu2->isVisible()); - QVERIFY(!subSubMenu1->isVisible()); - if (cascade) { + if (!cascade) { + QVERIFY(!subSubMenu1->isVisible()); + } else { QTRY_VERIFY(subSubMenu1->isVisible()); QTRY_VERIFY(subSubMenu1->isOpened()); } |