diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-04-14 17:29:47 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-04-15 09:24:53 +0000 |
commit | 0fe0283308199a6bf4a155627cddd524638c7063 (patch) | |
tree | 049241510be9a85024525b5053fd67df4aea6ff2 /tests/auto/controls/data/tst_tooltip.qml | |
parent | b2e766c0cf4b5ae027f8d96202a9a9d29a7d84d4 (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.qml | 9 |
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 = "" + } } |