From 528fd2149ecdc921bf0af91de9dd3262498c9121 Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Wed, 29 May 2013 17:44:37 -0300 Subject: Use QFINDTESTDATA on tst_QStyle instead of SRCDIR Update the test code to match the current Qt idiom for finding test data (and fix it on QNX). Change-Id: I63e7c97b717722e4e6859a12f329d56b26584ce6 Reviewed-by: Friedemann Kleint --- tests/auto/widgets/styles/qstyle/qstyle.pro | 3 --- tests/auto/widgets/styles/qstyle/tst_qstyle.cpp | 7 +++++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/widgets/styles/qstyle/qstyle.pro b/tests/auto/widgets/styles/qstyle/qstyle.pro index 2b9268f35d..4d18971cc6 100644 --- a/tests/auto/widgets/styles/qstyle/qstyle.pro +++ b/tests/auto/widgets/styles/qstyle/qstyle.pro @@ -6,10 +6,7 @@ QT += widgets testlib SOURCES += tst_qstyle.cpp wince* { - DEFINES += SRCDIR=\\\".\\\" addPixmap.files = task_25863.png addPixmap.path = . DEPLOYMENT += addPixmap -} else { - DEFINES += SRCDIR=\\\"$$PWD\\\" } diff --git a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp index fc94f95f8e..94d2d22d96 100644 --- a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp +++ b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp @@ -250,9 +250,12 @@ void tst_QStyle::testProxyStyle() void tst_QStyle::drawItemPixmap() { testWidget->resize(300, 300); - testWidget->show(); + testWidget->showNormal(); - QPixmap p(QString(SRCDIR) + "/task_25863.png", "PNG"); + const QString imageFileName = QFINDTESTDATA("task_25863.png"); + QVERIFY(!imageFileName.isEmpty()); + + QPixmap p(imageFileName, "PNG"); const QPixmap actualPix = testWidget->grab(); QCOMPARE(actualPix, p); -- cgit v1.2.3