aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@crimson.no>2017-04-22 19:21:18 +0200
committerRobin Burchell <robin.burchell@crimson.no>2017-04-23 17:09:44 +0000
commit27079f9168463b5b27aeb2d1f93f867bf714e71a (patch)
tree04e339c26965149e2bc6b8292f1813f66da966d7 /tests
parent75a4dccaefbd8cb9bb6ebb5b94f79c86f12832fd (diff)
tst_grabImage: Small improvement to avoid accidental leakage of Items
If the test fails for some reason, ensure that they are cleaned up properly by using TestCase's item creation instead of doing it directly. Change-Id: I639bd246662260f31d5a32d140ee98ad11884446 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qmltest/selftests/tst_grabImage.qml2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/qmltest/selftests/tst_grabImage.qml b/tests/auto/qmltest/selftests/tst_grabImage.qml
index 1748030f14..954daaba42 100644
--- a/tests/auto/qmltest/selftests/tst_grabImage.qml
+++ b/tests/auto/qmltest/selftests/tst_grabImage.qml
@@ -35,7 +35,7 @@ TestCase {
when: windowShown
function test_equals() {
- var rect = Qt.createQmlObject("import QtQuick 2.0; Rectangle { color: 'red'; width: 10; height: 10; }", testCase);
+ var rect = createTemporaryQmlObject("import QtQuick 2.0; Rectangle { color: 'red'; width: 10; height: 10; }", testCase);
verify(rect);
var oldImage = grabImage(rect);
rect.width += 10;