summaryrefslogtreecommitdiffstats
path: root/tests/auto/qcombobox/tst_qcombobox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qcombobox/tst_qcombobox.cpp')
-rw-r--r--tests/auto/qcombobox/tst_qcombobox.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/tests/auto/qcombobox/tst_qcombobox.cpp b/tests/auto/qcombobox/tst_qcombobox.cpp
index c94ace0..4976b30 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() );
}
@@ -2216,7 +2219,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()
@@ -2226,10 +2229,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)