aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls/data/tst_tooltip.qml
diff options
context:
space:
mode:
authorYulong Bai <yulong.bai@qt.io>2018-01-22 14:36:17 +0100
committerJ-P Nurmi <jpnurmi@qt.io>2018-02-06 19:35:37 +0000
commit63899f3185b443ba3cdb7f34cf09f0ac01c5c037 (patch)
tree03db570fe92b4eecfa1aa825b255804e48faa3f1 /tests/auto/controls/data/tst_tooltip.qml
parent72abc4e94764b4a5592a9d153ff9991fe66d7395 (diff)
QQuickToolTip: add non-attached show() and hide() methods
Usually there's only one global ToolTip instance providing attached show() and hide() methods, here we add non-attached ones which would be more flexible to meet different needs. [ChangeLog][ToolTip] Added non-attached show() and hide() methods to make it more flexible to meet certain requirements. Task-number: QTBUG-62890 Change-Id: I432bca202e16a27d0a5a732445242e78b2fb9c3f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'tests/auto/controls/data/tst_tooltip.qml')
-rw-r--r--tests/auto/controls/data/tst_tooltip.qml18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_tooltip.qml b/tests/auto/controls/data/tst_tooltip.qml
index e7cc6787..99b6ee14 100644
--- a/tests/auto/controls/data/tst_tooltip.qml
+++ b/tests/auto/controls/data/tst_tooltip.qml
@@ -329,4 +329,22 @@ TestCase {
verify(tooltip.visible)
}
}
+
+ Component {
+ id: nonAttachedToolTipComponent
+ ToolTip { }
+ }
+
+ function test_nonAttachedToolTipShowAndHide() {
+ var tip = createTemporaryObject(nonAttachedToolTipComponent, testCase)
+ verify(tip)
+ tip.show("hello");
+ verify(tip.visible)
+ verify(tip.text === "hello")
+ tip.hide()
+ tryCompare(tip, "visible", false)
+ tip.show("delay", 200)
+ verify(tip.visible)
+ tryCompare(tip, "visible", false)
+ }
}