diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-09-20 12:23:53 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-09-20 12:23:53 (GMT) |
commit | b81201a29a9794ed490098c8eb136464afa12b8a (patch) | |
tree | 7d7ad331c8c5316924bd5ff3fd7e6ccb21e7cc48 /tests | |
parent | 5243b9eaf3deb201f23b2710c274e3108a4eb23b (diff) | |
parent | fde1488aa7476eba915fbac958c56664df8ecf82 (diff) | |
download | Qt-b81201a29a9794ed490098c8eb136464afa12b8a.zip Qt-b81201a29a9794ed490098c8eb136464afa12b8a.tar.gz Qt-b81201a29a9794ed490098c8eb136464afa12b8a.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-symbian-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-symbian-staging: (31 commits)
runonphone: Include USB serial ports on OS X for CODA, too
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
runonphone: Allow overriding the temporary sis file name
Fix QIcon auto-tests for Symbian
Add a cast to moc cpp generator to remove armcc warnings
Fix qt.conf for Symbian to use $${EPOCROOT}
Remove few unused variables.
...
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qcolumnview/tst_qcolumnview.cpp | 1 | ||||
-rw-r--r-- | tests/auto/qicon/tst_qicon.cpp | 62 | ||||
-rw-r--r-- | tests/auto/qtreeview/tst_qtreeview.cpp | 8 |
3 files changed, 53 insertions, 18 deletions
diff --git a/tests/auto/qcolumnview/tst_qcolumnview.cpp b/tests/auto/qcolumnview/tst_qcolumnview.cpp index 7f6d43a..65e23bf 100644 --- a/tests/auto/qcolumnview/tst_qcolumnview.cpp +++ b/tests/auto/qcolumnview/tst_qcolumnview.cpp @@ -461,6 +461,7 @@ void tst_QColumnView::scrollTo() view.setCurrentIndex(index); QTest::qWait(ANIMATION_DELAY); view.scrollTo(index, QAbstractItemView::EnsureVisible); + QTest::qWait(ANIMATION_DELAY); index = index.parent(); if (start != level) { if (!reverse) 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()); } diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp index b902370..facb982 100644 --- a/tests/auto/qtreeview/tst_qtreeview.cpp +++ b/tests/auto/qtreeview/tst_qtreeview.cpp @@ -2384,6 +2384,14 @@ void tst_QTreeView::extendedSelection() QTreeView view(&topLevel); view.resize(qMax(mousePressPos.x() * 2, 200), qMax(mousePressPos.y() * 2, 200)); view.setModel(&model); + + //ensure that mousePressPos is below the last row if we want to unselect + if (!selectedCount) { + int minimumHeight = model.rowCount() * view.visualRect(model.index(0,0)).size().height(); + if (mousePressPos.y() < minimumHeight) + mousePressPos.setY(minimumHeight + 10); + } + view.setSelectionMode(QAbstractItemView::ExtendedSelection); topLevel.show(); QTest::mousePress(view.viewport(), Qt::LeftButton, 0, mousePressPos); |