diff options
Diffstat (limited to 'tests/auto/qcombobox')
-rw-r--r-- | tests/auto/qcombobox/qcombobox.pro | 2 | ||||
-rw-r--r-- | tests/auto/qcombobox/tst_qcombobox.cpp | 19 |
2 files changed, 11 insertions, 10 deletions
diff --git a/tests/auto/qcombobox/qcombobox.pro b/tests/auto/qcombobox/qcombobox.pro index 60bf1c8..f36a6fe 100644 --- a/tests/auto/qcombobox/qcombobox.pro +++ b/tests/auto/qcombobox/qcombobox.pro @@ -2,5 +2,3 @@ load(qttest_p4) SOURCES += tst_qcombobox.cpp contains(QT_CONFIG, qt3support): QT += qt3support - - diff --git a/tests/auto/qcombobox/tst_qcombobox.cpp b/tests/auto/qcombobox/tst_qcombobox.cpp index 67c9ac9..dbb90fd 100644 --- a/tests/auto/qcombobox/tst_qcombobox.cpp +++ b/tests/auto/qcombobox/tst_qcombobox.cpp @@ -1233,7 +1233,6 @@ void tst_QComboBox::insertItem() testWidget->setEditable(true); if (editable) testWidget->setEditText("FOO"); - #if defined (QT3_SUPPORT) if (testQt3Support) testWidget->insertItem(itemLabel, insertIndex); @@ -1247,7 +1246,7 @@ void tst_QComboBox::insertItem() QCOMPARE(testWidget->count(), initialItems.count() + 1); QCOMPARE(testWidget->itemText(expectedIndex), itemLabel); - + if (editable) QCOMPARE(testWidget->currentText(), QString("FOO")); } @@ -1894,10 +1893,10 @@ void tst_QComboBox::itemListPosition() //tests that the list is not out of the screen boundaries //put the QApplication layout back - qApp->setLayoutDirection(Qt::LeftToRight); + QApplication::setLayoutDirection(Qt::LeftToRight); //we test QFontComboBox because it has the specific behaviour to set a fixed size - //the the list view + //to the list view QFontComboBox combo; //the code to get the avaialbe screen space is copied from QComboBox code @@ -1914,13 +1913,17 @@ void tst_QComboBox::itemListPosition() screen = QApplication::desktop()->availableGeometry(scrNumber); #endif - combo.move(screen.width()-combo.sizeHint().width(), 0); //puts the combo the the top-right corner + combo.move(screen.width()-combo.sizeHint().width(), 0); //puts the combo to the top-right corner combo.show(); QTest::qWait(100); //wait because the window manager can move the window if there is a right panel combo.showPopup(); QTest::qWait(100); +#if defined(Q_WS_S60) + // Assuming that QtS60 style is used, here. But other ones would certainly also fail + QEXPECT_FAIL("", "QtS60Style does not yet position the combobox popup correctly", Continue); +#endif QVERIFY( combo.view()->window()->x() + combo.view()->window()->width() <= screen.x() + screen.width() ); } @@ -2222,7 +2225,7 @@ void tst_QComboBox::setItemDelegate() QComboBox comboBox; QStyledItemDelegate *itemDelegate = new QStyledItemDelegate; comboBox.setItemDelegate(itemDelegate); - QCOMPARE(comboBox.itemDelegate(), itemDelegate); + QCOMPARE(static_cast<QStyledItemDelegate*>(comboBox.itemDelegate()), itemDelegate); } void tst_QComboBox::task253944_itemDelegateIsReset() @@ -2232,10 +2235,10 @@ void tst_QComboBox::task253944_itemDelegateIsReset() comboBox.setItemDelegate(itemDelegate); comboBox.setEditable(true); - QCOMPARE(comboBox.itemDelegate(), itemDelegate); + QCOMPARE(static_cast<QStyledItemDelegate*>(comboBox.itemDelegate()), itemDelegate); comboBox.setStyleSheet("QComboBox { border: 1px solid gray; }"); - QCOMPARE(comboBox.itemDelegate(), itemDelegate); + QCOMPARE(static_cast<QStyledItemDelegate*>(comboBox.itemDelegate()), itemDelegate); } QTEST_MAIN(tst_QComboBox) |