diff options
author | Paul Olav Tvete <paul.tvete@nokia.com> | 2010-08-19 10:04:39 (GMT) |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@nokia.com> | 2010-08-19 10:04:39 (GMT) |
commit | a226143eeda6771efc4f0df6955351336735cb60 (patch) | |
tree | a279f87d74f5929e36fe6a3aa5e4f4d843b32458 /tests/auto/qgraphicswidget | |
parent | c02ad51733d0a2885ddb39cb7e3b09355ab97213 (diff) | |
parent | ffbce9839f8be5c2f21cc66b617dbeb0a47af269 (diff) | |
download | Qt-a226143eeda6771efc4f0df6955351336735cb60.zip Qt-a226143eeda6771efc4f0df6955351336735cb60.tar.gz Qt-a226143eeda6771efc4f0df6955351336735cb60.tar.bz2 |
Merge remote branch 'qt/master' into lighthouse-master
Diffstat (limited to 'tests/auto/qgraphicswidget')
-rw-r--r-- | tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp index a771332..bda22eb 100644 --- a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp +++ b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp @@ -111,6 +111,7 @@ private slots: void fontPropagationSceneChange(); void geometry_data(); void geometry(); + void geometryChanged(); void width(); void height(); void getContentsMargins_data(); @@ -776,11 +777,28 @@ void tst_QGraphicsWidget::geometry() QFETCH(QSizeF, size); widget.setPos(pos); widget.resize(size); - if (!size.isNull()) + if (!size.isNull() && !pos.isNull()) + QCOMPARE(spy.count(), 2); + if (!size.isNull() && pos.isNull()) QCOMPARE(spy.count(), 1); QCOMPARE(widget.geometry(), QRectF(pos, size)); } +void tst_QGraphicsWidget::geometryChanged() +{ + QGraphicsWidget w; + w.setGeometry(0, 0, 200, 200); + QCOMPARE(w.geometry(), QRectF(0, 0, 200, 200)); + QSignalSpy spy(&w, SIGNAL(geometryChanged())); + w.setGeometry(0, 0, 100, 100); + QCOMPARE(spy.count(), 1); + QCOMPARE(w.geometry(), QRectF(0, 0, 100, 100)); + w.setPos(10, 10); + QCOMPARE(spy.count(), 2); + QCOMPARE(w.geometry(), QRectF(10, 10, 100, 100)); + +} + void tst_QGraphicsWidget::width() { QGraphicsWidget w; |