summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-02-10 03:06:47 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-02-10 03:06:47 (GMT)
commitf74029e286e97067ac39086955481bf979af69dc (patch)
treeba6b9706b47624cb4dcd51a3fb4236ce4dddd5b3 /tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
parent4a5e8e026bed24d451e2d36f490f42a17ed74b47 (diff)
parentec0f388dfb14712a144d534296b33df7e6a2df7f (diff)
downloadQt-f74029e286e97067ac39086955481bf979af69dc.zip
Qt-f74029e286e97067ac39086955481bf979af69dc.tar.gz
Qt-f74029e286e97067ac39086955481bf979af69dc.tar.bz2
Merge branch 'qt-master-from-4.6' of scm.dev.nokia.troll.no:qt/qt-integration into master-integration
* 'qt-master-from-4.6' of scm.dev.nokia.troll.no:qt/qt-integration: (104 commits) Documentation: clarified RVCT support for Symbian Update Symbian OS def files for 4.6.2 Remove the installer from the Qt sources. Don't remove all dependencies when patching the pkg. Fixes qabstractslider autotest Workaround for abld toolchain issue with s60main Add a recursive rule for running the auto-tests. Do not run the tests automatically during install. Enabling runfast mode when vfpv2 used. Fixing a test case to be runnable on Symbian device. [CRASH] audioinput and audiooutput examples crash when no devices are Fixed casual crash in initializeDb (Symbian) Fixes scrolling horizontally with a mouse wheel over sliders. don't use QKeySequence::mnemonic() after all Fixed qt_x11_wait_for_window_manager Revert change 34f1758 on non-Synbian platforms Fixed QGifHandler::loopCount(). Doc: Clarified ownership of custom buttons added to a QDialogButtonBox. Updated WebKit from /home/shausman/src/webkit/trunk to qtwebkit/qtwebkit-4.6 ( da5d96a26e80162027bc95ce7e5725fe4b277ff7 ) don't use stylesheet for just making labels bold ...
Diffstat (limited to 'tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp')
-rw-r--r--tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp43
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
index 79ce68e..6941d23 100644
--- a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
+++ b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
@@ -165,6 +165,7 @@ private slots:
void polishEvent2();
void autoFillBackground();
void initialShow();
+ void initialShow2();
// Task fixes
void task236127_bspTreeIndexFails();
@@ -2908,6 +2909,48 @@ void tst_QGraphicsWidget::initialShow()
QCOMPARE(widget->repaints, 1);
}
+void tst_QGraphicsWidget::initialShow2()
+{
+ class MyGraphicsWidget : public QGraphicsWidget
+ { public:
+ MyGraphicsWidget() : repaints(0) {}
+ int repaints;
+ void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget*) { ++repaints; }
+ void polishEvent() { update(); }
+ };
+
+ // Don't let paint events triggered by the windowing system
+ // influence our test case. We're only interested in knowing
+ // whether a QGraphicsWidget generates an additional repaint
+ // on the inital show. Hence create a dummy scenario to find out
+ // how many repaints we should expect.
+ QGraphicsScene dummyScene(0, 0, 200, 200);
+ dummyScene.addItem(new QGraphicsRectItem(0, 0, 100, 100));
+
+ QGraphicsView *dummyView = new QGraphicsView(&dummyScene);
+ dummyView->setWindowFlags(Qt::X11BypassWindowManagerHint);
+ EventSpy paintSpy(dummyView->viewport(), QEvent::Paint);
+ dummyView->show();
+ QTest::qWaitForWindowShown(dummyView);
+ const int expectedRepaintCount = paintSpy.count();
+ delete dummyView;
+ dummyView = 0;
+ QTest::qWait(200);
+
+ MyGraphicsWidget *widget = new MyGraphicsWidget;
+ widget->resize(100, 100);
+
+ QGraphicsScene scene(0, 0, 200, 200);
+ scene.addItem(widget);
+
+ QGraphicsView view(&scene);
+ view.setWindowFlags(Qt::X11BypassWindowManagerHint);
+ view.show();
+ QTest::qWaitForWindowShown(&view);
+
+ QCOMPARE(widget->repaints, expectedRepaintCount);
+}
+
void tst_QGraphicsWidget::QT_BUG_6544_tabFocusFirstUnsetWhenRemovingItems()
{
QGraphicsScene scene;