summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@nokia.com>2010-08-05 11:25:35 (GMT)
committerHarald Fernengel <harald.fernengel@nokia.com>2010-11-02 14:30:53 (GMT)
commit4e063a7c79caf77cff9748ef4e799dbbc1c1346f (patch)
tree7c28e6e08f332c559bd6c5cf0aea9cbbb5d7064f /tests
parent145126c11d71648fa5eeb1abcd023e418fde8022 (diff)
downloadQt-4e063a7c79caf77cff9748ef4e799dbbc1c1346f.zip
Qt-4e063a7c79caf77cff9748ef4e799dbbc1c1346f.tar.gz
Qt-4e063a7c79caf77cff9748ef4e799dbbc1c1346f.tar.bz2
Fixed QComboBox autotest to use a dummy toplevel widget
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qcombobox/tst_qcombobox.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/auto/qcombobox/tst_qcombobox.cpp b/tests/auto/qcombobox/tst_qcombobox.cpp
index 1fcea9e..9614e1e 100644
--- a/tests/auto/qcombobox/tst_qcombobox.cpp
+++ b/tests/auto/qcombobox/tst_qcombobox.cpp
@@ -163,7 +163,7 @@ protected slots:
private:
QComboBox *testWidget;
- QDialog *parent;
+ QWidget *parent;
QPushButton* ok;
int editTextCount;
QString editText;
@@ -395,7 +395,7 @@ tst_QComboBox::~tst_QComboBox()
void tst_QComboBox::initTestCase()
{
// Create the test class
- parent = new QDialog(0);
+ parent = new QWidget(0, Qt::Window);
parent->setObjectName("parent");
parent->resize(400, 400);
testWidget = new QComboBox(parent);
@@ -1914,7 +1914,8 @@ void tst_QComboBox::itemListPosition()
//we test QFontComboBox because it has the specific behaviour to set a fixed size
//to the list view
- QFontComboBox combo;
+ QWidget topLevel;
+ QFontComboBox combo(&topLevel);
//the code to get the avaialbe screen space is copied from QComboBox code
const int scrNumber = QApplication::desktop()->screenNumber(&combo);
@@ -1932,7 +1933,7 @@ void tst_QComboBox::itemListPosition()
combo.move(screen.width()-combo.sizeHint().width(), 0); //puts the combo to the top-right corner
- combo.show();
+ topLevel.show();
//wait because the window manager can move the window if there is a right panel
QTRY_VERIFY(combo.isVisible());
combo.showPopup();
@@ -2254,9 +2255,10 @@ void tst_QComboBox::noScrollbar()
qApp->setStyleSheet(stylesheet);
{
- QComboBox comboBox;
+ QWidget topLevel;
+ QComboBox comboBox(&topLevel);
comboBox.addItems(initialContent);
- comboBox.show();
+ topLevel.show();
comboBox.resize(200, comboBox.height());
QTRY_VERIFY(comboBox.isVisible());
comboBox.showPopup();