aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/auto/controls/data/tst_combobox.qml58
1 files changed, 58 insertions, 0 deletions
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)
+ }
}