diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-12-16 09:21:05 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-12-16 10:11:14 +0000 |
commit | f609d642b4eb06569e0f6469fcf6c23ba173d002 (patch) | |
tree | 04d562618d57c9ef38bcb6ebe9bec20f10254b27 /tests/auto/controls/data/tst_tooltip.qml | |
parent | d533e9c803298f41d4bf7bf93d47385bebeb6fdd (diff) |
tst_tooltip: fix signal spy ownership for the shared tooltip
Don't create a new signal spy instance per test data row for the shared
tooltip. The shared tooltip instance stays the same for the life time
of the whole test case. Simply do the same for its signal spy.
Change-Id: Ib42fcf716679cb7a90e9b4a03e529bb5f1ce994f
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto/controls/data/tst_tooltip.qml')
-rw-r--r-- | tests/auto/controls/data/tst_tooltip.qml | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/auto/controls/data/tst_tooltip.qml b/tests/auto/controls/data/tst_tooltip.qml index 51601d66..0356ac06 100644 --- a/tests/auto/controls/data/tst_tooltip.qml +++ b/tests/auto/controls/data/tst_tooltip.qml @@ -69,6 +69,11 @@ TestCase { id: object } + SignalSpy { + id: sharedSpy + target: ToolTip.toolTip + } + function test_properties_data() { return [ {tag: "text", property: "text", defaultValue: "", setValue: "Hello", signalName: "textChanged"}, @@ -119,8 +124,9 @@ TestCase { verify(spy2.valid) var sharedTip = ToolTip.toolTip - var sharedSpy = signalSpy.createObject(testCase, {target: sharedTip, signalName: data.signalName}) + sharedSpy.signalName = data.signalName verify(sharedSpy.valid) + sharedSpy.clear() // change attached properties while the shared tooltip is not visible item1.ToolTip[data.property] = data.setValue |