From f609d642b4eb06569e0f6469fcf6c23ba173d002 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Fri, 16 Dec 2016 09:21:05 +0100 Subject: 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 --- tests/auto/controls/data/tst_tooltip.qml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tests/auto/controls/data/tst_tooltip.qml') 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 -- cgit v1.2.3