aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls/data/tst_tooltip.qml
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2016-04-14 17:29:47 +0200
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2016-04-15 09:24:53 +0000
commit0fe0283308199a6bf4a155627cddd524638c7063 (patch)
tree049241510be9a85024525b5053fd67df4aea6ff2 /tests/auto/controls/data/tst_tooltip.qml
parentb2e766c0cf4b5ae027f8d96202a9a9d29a7d84d4 (diff)
ToolTip: use QQmlInfo and don't crash with non-Items
Before: ToolTip must be attached to an Item QObject(0x239c3e0) The program has unexpectedly finished. After: qrc:/main.qml:8:5: QML QtObject: ToolTip must be attached to an Item Change-Id: I9a2bf317a13eb7408fc5851087457bbfbeca9f3f Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'tests/auto/controls/data/tst_tooltip.qml')
-rw-r--r--tests/auto/controls/data/tst_tooltip.qml9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_tooltip.qml b/tests/auto/controls/data/tst_tooltip.qml
index 43a9a0e9..9f295651 100644
--- a/tests/auto/controls/data/tst_tooltip.qml
+++ b/tests/auto/controls/data/tst_tooltip.qml
@@ -65,6 +65,10 @@ TestCase {
SignalSpy { }
}
+ QtObject {
+ id: object
+ }
+
function test_properties_data() {
return [
{tag: "text", property: "text", defaultValue: "", setValue: "Hello", signalName: "textChanged"},
@@ -153,4 +157,9 @@ TestCase {
control.destroy()
}
+
+ function test_warning() {
+ ignoreWarning(Qt.resolvedUrl("tst_tooltip.qml") + ":68:5: QML QtObject: ToolTip must be attached to an Item")
+ object.ToolTip.text = ""
+ }
}