diff options
author | Dominik Holland <dominik.holland@nokia.com> | 2010-07-27 08:52:56 (GMT) |
---|---|---|
committer | Harald Fernengel <harald.fernengel@nokia.com> | 2010-11-02 14:29:06 (GMT) |
commit | 28b4eb0a10b922581f4f7c6a7cdc60383a35a578 (patch) | |
tree | 6e1cb7e03f4bd5e366d3b84cea41b1625c66fe91 | |
parent | 2eb6556bac03bde101e2135be1114d6835341678 (diff) | |
download | Qt-28b4eb0a10b922581f4f7c6a7cdc60383a35a578.zip Qt-28b4eb0a10b922581f4f7c6a7cdc60383a35a578.tar.gz Qt-28b4eb0a10b922581f4f7c6a7cdc60383a35a578.tar.bz2 |
Fixed QListWidget autotest to use a dummy toplevel widget
-rw-r--r-- | tests/auto/qlistwidget/tst_qlistwidget.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/auto/qlistwidget/tst_qlistwidget.cpp b/tests/auto/qlistwidget/tst_qlistwidget.cpp index eb3fb6b..990945d 100644 --- a/tests/auto/qlistwidget/tst_qlistwidget.cpp +++ b/tests/auto/qlistwidget/tst_qlistwidget.cpp @@ -1499,6 +1499,11 @@ void tst_QListWidget::itemWidget() class MyListWidget : public QListWidget { public: + MyListWidget(QWidget *parent=0) + : QListWidget(parent) + { + } + void paintEvent(QPaintEvent *e) { painted += e->region(); QListWidget::paintEvent(e); @@ -1513,14 +1518,16 @@ void tst_QListWidget::fastScroll() QSKIP("S60 style doesn't support fast scrolling", SkipAll); } - MyListWidget widget; + QWidget topLevel; + MyListWidget widget(&topLevel); for (int i = 0; i < 50; ++i) widget.addItem(QString("Item %1").arg(i)); - widget.show(); + topLevel.show(); // Make sure the widget gets the first full repaint. On // some WMs, we'll get two (first inactive exposure, then // active exposure. + QTest::qWaitForWindowShown(&widget); #ifdef Q_WS_X11 qt_x11_wait_for_window_manager(&widget); #endif @@ -1531,6 +1538,7 @@ void tst_QListWidget::fastScroll() QVERIFY(!itemSize.isEmpty()); QScrollBar *sbar = widget.verticalScrollBar(); + widget.setVerticalScrollMode(QAbstractItemView::ScrollPerItem); widget.painted = QRegion(); sbar->setValue(sbar->value() + sbar->singleStep()); QApplication::processEvents(); |