summaryrefslogtreecommitdiffstats
path: root/tests/auto/qicon/tst_qicon.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-09-20 23:16:13 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-09-20 23:16:13 (GMT)
commit6e2a9ed7f5388ece10ffb08a52c3e22d3b058d48 (patch)
tree7d7ad331c8c5316924bd5ff3fd7e6ccb21e7cc48 /tests/auto/qicon/tst_qicon.cpp
parent7b4c273df2401505fe87efdf5d1d73d75993910a (diff)
parentb81201a29a9794ed490098c8eb136464afa12b8a (diff)
downloadQt-6e2a9ed7f5388ece10ffb08a52c3e22d3b058d48.zip
Qt-6e2a9ed7f5388ece10ffb08a52c3e22d3b058d48.tar.gz
Qt-6e2a9ed7f5388ece10ffb08a52c3e22d3b058d48.tar.bz2
Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qt-water-team
* 'master' of git://scm.dev.nokia.troll.no/qt/qt-water-team: (36 commits) add 4.8 changes created/merged by me Fixed automatic plugin path resolving for predefined Qt plugins. Resolve a number of compilation issues with INTEGRITY runonphone: Include USB serial ports on OS X for CODA, too Update changelog for Qt 4.8.0 Fix compile issue when building with QT_NO_CONCURRENT and QT_NO_FUTURE runonphone: Implement traceswitch support for coda Fix missing clean up stack panic for a new thread in Symbian Regression in QS60Style when drawing webview scrollbars Cleanup qwidget_s60.cpp Fix panic when global QSettings instance needs flusing at app exit Fix uninitialised variable in temporary files More accurately determine bearer type for symbian GPRS/3G Add documentation for Symbian QSettings locations and security Update QDesktopServices openUrl() documentation on Symbian OS Mark binaries as SMPSAFE in Symbian Fix "sbs -c tools2 --what" output for Qt. Update environment.prf QS60Style: Make spinboxes and lineedits slightly taller runonphone: Add a missing space between a message and the file name ...
Diffstat (limited to 'tests/auto/qicon/tst_qicon.cpp')
-rw-r--r--tests/auto/qicon/tst_qicon.cpp62
1 files changed, 44 insertions, 18 deletions
diff --git a/tests/auto/qicon/tst_qicon.cpp b/tests/auto/qicon/tst_qicon.cpp
index cd3f84f..b62dfbd 100644
--- a/tests/auto/qicon/tst_qicon.cpp
+++ b/tests/auto/qicon/tst_qicon.cpp
@@ -92,7 +92,7 @@ private:
const static QIcon staticIcon;
};
-// Creating an icon statically should not cause a crash.
+// Creating an icon statically should not cause a crash.
// But we do not officially support this. See QTBUG-8666
const QIcon tst_QIcon::staticIcon = QIcon::fromTheme("edit-find");
@@ -468,7 +468,19 @@ void tst_QIcon::addFile()
icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-save-32.png"), QSize(), QIcon::Selected);
icon.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-save-128.png"), QSize(), QIcon::Selected);
-#ifndef Q_OS_WINCE
+#ifdef Q_OS_WINCE
+ // WinCE only includes the 16x16 images for size reasons
+ QVERIFY(icon.pixmap(16, QIcon::Normal).toImage() ==
+ QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-open-16.png")).toImage());
+ QVERIFY(icon.pixmap(16, QIcon::Selected).toImage() ==
+ QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-save-16.png")).toImage());
+#elif defined(Q_OS_SYMBIAN)
+ // Symbian only includes the 32x32 images for size reasons
+ QVERIFY(icon.pixmap(32, QIcon::Normal).toImage() ==
+ QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-open-32.png")).toImage());
+ QVERIFY(icon.pixmap(32, QIcon::Selected).toImage() ==
+ QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-save-32.png")).toImage());
+#else
QVERIFY(icon.pixmap(16, QIcon::Normal).toImage() ==
QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-open-16.png")).toImage());
QVERIFY(icon.pixmap(32, QIcon::Normal).toImage() ==
@@ -481,12 +493,6 @@ void tst_QIcon::addFile()
QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-save-32.png")).toImage());
QVERIFY(icon.pixmap(128, QIcon::Selected).toImage() ==
QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-save-128.png")).toImage());
-#else
- // WinCE only includes the 16x16 images for size reasons
- QVERIFY(icon.pixmap(16, QIcon::Normal).toImage() ==
- QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-open-16.png")).toImage());
- QVERIFY(icon.pixmap(16, QIcon::Selected).toImage() ==
- QPixmap(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-save-16.png")).toImage());
#endif
}
@@ -537,18 +543,27 @@ void tst_QIcon::availableSizes()
QVERIFY(availableSizes.isEmpty());
}
+#ifndef Q_OS_SYMBIAN
+ const int defaultDimension = 16;
+ QLatin1String standardIcon(":/trolltech/styles/commonstyle/images/standardbutton-open-16.png");
+#else
+ // In Symbian, only 32 times 32 icons are included.
+ const int defaultDimension = 32;
+ QLatin1String standardIcon(":/trolltech/styles/commonstyle/images/standardbutton-open-32.png");
+#endif
+
{
// we try to load an icon from resources
- QIcon icon(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-open-16.png"));
+ QIcon icon(standardIcon);
QList<QSize> availableSizes = icon.availableSizes();
QCOMPARE(availableSizes.size(), 1);
- QCOMPARE(availableSizes.at(0), QSize(16, 16));
+ QCOMPARE(availableSizes.at(0), QSize(defaultDimension, defaultDimension));
}
{
// load an icon from binary data.
QPixmap pix;
- QFile file(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-open-16.png"));
+ QFile file(standardIcon);
QVERIFY(file.open(QIODevice::ReadOnly));
uchar *data = file.map(0, file.size());
QVERIFY(data != 0);
@@ -557,7 +572,7 @@ void tst_QIcon::availableSizes()
QList<QSize> availableSizes = icon.availableSizes();
QCOMPARE(availableSizes.size(), 1);
- QCOMPARE(availableSizes.at(0), QSize(16,16));
+ QCOMPARE(availableSizes.at(0), QSize(defaultDimension, defaultDimension));
}
{
@@ -719,18 +734,29 @@ void tst_QIcon::fromTheme()
void tst_QIcon::task223279_inconsistentAddFile()
{
+#ifndef Q_OS_SYMBIAN
+ const int defaultDimension = 16;
+ const int invalidIconDimension = 32;
+ QLatin1String standardIcon(":/trolltech/styles/commonstyle/images/standardbutton-open-16.png");
+#else
+ // Only 32 times 32 icons are included in Symbian
+ const int defaultDimension = 32;
+ const int invalidIconDimension = 64;
+ QLatin1String standardIcon(":/trolltech/styles/commonstyle/images/standardbutton-open-32.png");
+#endif
+
QIcon icon1;
- icon1.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-open-16.png"));
- icon1.addFile(QLatin1String("IconThatDoesntExist"), QSize(32, 32));
- QPixmap pm1 = icon1.pixmap(32, 32);
+ icon1.addFile(standardIcon);
+ icon1.addFile(QLatin1String("IconThatDoesntExist"), QSize(invalidIconDimension, invalidIconDimension));
+ QPixmap pm1 = icon1.pixmap(invalidIconDimension, invalidIconDimension);
QIcon icon2;
- icon2.addFile(QLatin1String(":/trolltech/styles/commonstyle/images/standardbutton-open-16.png"));
+ icon2.addFile(standardIcon);
icon2.addFile(QLatin1String("IconThatDoesntExist"));
- QPixmap pm2 = icon1.pixmap(32, 32);
+ QPixmap pm2 = icon1.pixmap(invalidIconDimension, invalidIconDimension);
QCOMPARE(pm1.isNull(), false);
- QCOMPARE(pm1.size(), QSize(16,16));
+ QCOMPARE(pm1.size(), QSize(defaultDimension, defaultDimension));
QCOMPARE(pm1.isNull(), pm2.isNull());
QCOMPARE(pm1.size(), pm2.size());
}