summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2010-02-04 09:08:43 (GMT)
committerSamuel Rødal <sroedal@trolltech.com>2010-02-04 09:08:43 (GMT)
commit47b7af3bfd78c6d4efd3ce93be275a60430679d2 (patch)
treee7d7ff32ae72008b74df37e13caf568b33ac19b5 /tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
parent8e98033a67263f6a2d9155f228dc28e2faee4f5e (diff)
parent39523f9f78a7c93643924711b1ed8006ebfcf5ce (diff)
downloadQt-47b7af3bfd78c6d4efd3ce93be275a60430679d2.zip
Qt-47b7af3bfd78c6d4efd3ce93be275a60430679d2.tar.gz
Qt-47b7af3bfd78c6d4efd3ce93be275a60430679d2.tar.bz2
Merge remote branch 'staging/4.6' into 4.6
Manual resolve of conflict in changes-4.6.2 in staging-2. Conflicts: dist/changes-4.6.2
Diffstat (limited to 'tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp')
-rw-r--r--tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
index d3132fe..526486e 100644
--- a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
+++ b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
@@ -164,6 +164,7 @@ private slots:
void polishEvent();
void polishEvent2();
void initialShow();
+ void initialShow2();
// Task fixes
void task236127_bspTreeIndexFails();
@@ -2881,6 +2882,32 @@ 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(); }
+ };
+
+ MyGraphicsWidget *widget = new MyGraphicsWidget;
+ widget->resize(100, 100);
+
+ QGraphicsScene scene(0, 0, 200, 200);
+ scene.addItem(widget);
+
+ QGraphicsView view(&scene);
+ view.show();
+ // Not using QTest::qWaitForWindowShown(&view); on purpose, because there's
+ // a bug in qt_x11_wait_for_window_manager that prevents this test
+ // to pass. Denis is looking into it.
+ QTest::qWait(300);
+
+ QCOMPARE(widget->repaints, 1);
+}
+
void tst_QGraphicsWidget::QT_BUG_6544_tabFocusFirstUnsetWhenRemovingItems()
{
QGraphicsScene scene;