aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls/data/tst_tooltip.qml
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-08-23 07:50:52 +0200
committerLiang Qi <liang.qi@qt.io>2016-08-23 07:50:52 +0200
commit0524ddb9489cd9816fadc330f75efc7b40994013 (patch)
tree834607a15e646d416e2512f8f4a05ae222495de5 /tests/auto/controls/data/tst_tooltip.qml
parent2568869819863de6b1f303dfe470aedf38b841c3 (diff)
parent53c780f15c2d170514f74d949a8165033275bddd (diff)
Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts: src/imports/controls/material/qquickmaterialstyle.cpp src/imports/controls/universal/qquickuniversalstyle.cpp src/quicktemplates2/qquickpopup_p_p.h src/quicktemplates2/qquicktooltip.cpp tests/auto/auto.pro Change-Id: I88b347dd85278e14f7b2ca468e30648c6432b6f2
Diffstat (limited to 'tests/auto/controls/data/tst_tooltip.qml')
-rw-r--r--tests/auto/controls/data/tst_tooltip.qml25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_tooltip.qml b/tests/auto/controls/data/tst_tooltip.qml
index a35798f0..1e6ecf01 100644
--- a/tests/auto/controls/data/tst_tooltip.qml
+++ b/tests/auto/controls/data/tst_tooltip.qml
@@ -118,6 +118,11 @@ TestCase {
var spy2 = signalSpy.createObject(item2, {target: item2.ToolTip, signalName: data.signalName})
verify(spy2.valid)
+ var sharedTip = ToolTip.toolTip
+ var sharedSpy = signalSpy.createObject(testCase, {target: sharedTip, signalName: data.signalName})
+ verify(sharedSpy.valid)
+
+ // change attached properties while the shared tooltip is not visible
item1.ToolTip[data.property] = data.setValue
compare(item1.ToolTip[data.property], data.setValue)
compare(spy1.count, 1)
@@ -125,6 +130,26 @@ TestCase {
compare(spy2.count, 0)
compare(item2.ToolTip[data.property], data.defaultValue)
+ // the shared tooltip is not visible for item1, so the attached
+ // property change should therefore not apply to the shared instance
+ compare(sharedSpy.count, 0)
+ compare(sharedTip[data.property], data.defaultValue)
+
+ // show the shared tooltip for item2
+ item2.ToolTip.visible = true
+ verify(item2.ToolTip.visible)
+ verify(sharedTip.visible)
+
+ // change attached properties while the shared tooltip is visible
+ item2.ToolTip[data.property] = data.setValue
+ compare(item2.ToolTip[data.property], data.setValue)
+ compare(spy2.count, 1)
+
+ // the shared tooltip is visible for item2, so the attached
+ // property change should apply to the shared instance
+ compare(sharedSpy.count, 1)
+ compare(sharedTip[data.property], data.setValue)
+
item1.destroy()
item2.destroy()
}