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 <Friedemann.Kleint@digia.com>
bb10
Rafael Roquetto 2013-05-29 17:44:37 -03:00 committed by The Qt Project
parent 60df445d3b
commit 528fd2149e
2 changed files with 5 additions and 5 deletions

View File

@ -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\\\"
}

View File

@ -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);