diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-08-12 04:25:36 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-08-12 04:25:36 (GMT) |
commit | 55e47566dd1ac83ff674401dfd6284f07490cd8b (patch) | |
tree | 78bd95dd0514f2538526baff5277c63087bb835b /tests/auto/qgraphicsgridlayout | |
parent | ef0d191e3d138f695a39128b6040d0884821f5b5 (diff) | |
parent | 93f11099cd87dd7a2c623a36f8f0a704fbe4e038 (diff) | |
download | Qt-55e47566dd1ac83ff674401dfd6284f07490cd8b.zip Qt-55e47566dd1ac83ff674401dfd6284f07490cd8b.tar.gz Qt-55e47566dd1ac83ff674401dfd6284f07490cd8b.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2:
Some polishing to merge request 723
Patch to QTBUG-3078
Diffstat (limited to 'tests/auto/qgraphicsgridlayout')
-rw-r--r-- | tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp b/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp index d1d6860..55d75af 100644 --- a/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp +++ b/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp @@ -78,6 +78,7 @@ private slots: void horizontalSpacing(); void itemAt(); void removeAt(); + void removeItem(); void rowAlignment(); void rowCount(); void rowMaximumHeight(); @@ -992,6 +993,32 @@ void tst_QGraphicsGridLayout::removeAt() delete widget; } +void tst_QGraphicsGridLayout::removeItem() +{ + QGraphicsScene scene; + QGraphicsView view(&scene); + + QGraphicsWidget *widget = new QGraphicsWidget(0, Qt::Window); + scene.addItem(widget); + QGraphicsGridLayout *l = new QGraphicsGridLayout(); + widget->setLayout(l); + + populateLayout(l, 3, 2); + QCOMPARE(l->count(), 6); + l->removeItem(l->itemAt(5)); + l->removeItem(l->itemAt(4)); + QCOMPARE(l->count(), 4); + + // Avoid crashing. Note that the warning message might change in the future. + QTest::ignoreMessage(QtWarningMsg, QString::fromAscii("QGraphicsGridLayout::removeAt: invalid index -1").toLatin1().constData()); + l->removeItem(0); + QCOMPARE(l->count(), 4); + + QTest::ignoreMessage(QtWarningMsg, QString::fromAscii("QGraphicsGridLayout::removeAt: invalid index -1").toLatin1().constData()); + l->removeItem(new QGraphicsWidget); + QCOMPARE(l->count(), 4); +} + // public Qt::Alignment rowAlignment(int row) const void tst_QGraphicsGridLayout::rowAlignment() { |