diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-06-01 19:51:29 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-06-01 19:51:29 (GMT) |
commit | 16fdbcd175d29373a662dc9fb3606b26fc81c9c1 (patch) | |
tree | 017965cdb9af9b501c66cd87d324733800487a52 | |
parent | e9ab8493053a7dd56cde058e736f46feafb378d0 (diff) | |
parent | 887b19ce9313d09eb996e765c18fa19a09a5cf95 (diff) | |
download | Qt-16fdbcd175d29373a662dc9fb3606b26fc81c9c1.zip Qt-16fdbcd175d29373a662dc9fb3606b26fc81c9c1.tar.gz Qt-16fdbcd175d29373a662dc9fb3606b26fc81c9c1.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public:
Fix QTreeWidget autotest cases on Symbian/VGA
-rw-r--r-- | tests/auto/qtreewidget/tst_qtreewidget.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/qtreewidget/tst_qtreewidget.cpp b/tests/auto/qtreewidget/tst_qtreewidget.cpp index dc878c4..7d2cdfb 100644 --- a/tests/auto/qtreewidget/tst_qtreewidget.cpp +++ b/tests/auto/qtreewidget/tst_qtreewidget.cpp @@ -50,6 +50,8 @@ #include <qlineedit.h> #include <QScrollBar> #include <QStyledItemDelegate> +#include <QDesktopWidget> +#include <QApplication> #include "../../shared/util.h" @@ -3102,10 +3104,21 @@ void tst_QTreeWidget::task206367_duplication() QWidget topLevel; QTreeWidget treeWidget(&topLevel); topLevel.show(); +#ifndef Q_WS_S60 treeWidget.resize(200, 200); +#endif treeWidget.setSortingEnabled(true); QTreeWidgetItem* rootItem = new QTreeWidgetItem( &treeWidget, QStringList("root") ); +#ifdef Q_WS_S60 + // Ensure that eight items fit into tree widget. In Symbian VGA devices 8 rows of + // data will take more than 200 pixels. + int calculatedHeight = treeWidget.visualItemRect(treeWidget.topLevelItem(0)).height() + + 2 * QApplication::style()->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, 0); + calculatedHeight *= 8; // eight 'rows': header, root and 2 items with 2 children + treeWidget.resize(200, qMax(200, calculatedHeight)); +#endif + for (int nFile = 0; nFile < 2; nFile++ ) { QTreeWidgetItem* itemFile = new QTreeWidgetItem(rootItem, QStringList(QString::number(nFile))); for (int nRecord = 0; nRecord < 2; nRecord++) @@ -3211,6 +3224,13 @@ void tst_QTreeWidget::task239150_editorWidth() { //we check that an item with no text will get an editor with a correct size QTreeWidget tree; +#ifdef Q_OS_SYMBIAN + //By default widgets are 640*360 in Symbian. Call to create_sys() sets the real size of the widget. + //Therefore, with VGA Symbian devices, we need to update the widget width to match screen width. + //As VGA devices have larger font, longer texts wouldn't otherwise fit into tree widget. + if (QApplication::desktop() && QApplication::desktop()->availableGeometry().width() > tree.width()) + tree.resize(QApplication::desktop()->availableGeometry().size()); +#endif QStyleOptionFrameV2 opt; opt.init(&tree); |