summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDebao Zhang <hello@debao.me>2013-03-25 17:51:16 +0800
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-27 06:01:11 +0100
commitf57a3c0ba3e0747604a23de00e740a6547d07cdf (patch)
tree51812c455f67362e89b1c0a0404fbb92b32cba82 /tests
parentbca0ee71150e0d5505799deb17e21f27fbe97835 (diff)
tst_qgraphicseffectsource: Don't use the deprecated QGraphicsItem::children()
Change-Id: I0cc0c5284a675fb1c7f960e9790baa89c56112b1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicseffectsource/tst_qgraphicseffectsource.cpp2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp40
2 files changed, 21 insertions, 21 deletions
diff --git a/tests/auto/widgets/graphicsview/qgraphicseffectsource/tst_qgraphicseffectsource.cpp b/tests/auto/widgets/graphicsview/qgraphicseffectsource/tst_qgraphicseffectsource.cpp
index c5863c9dc3..20d58b5f6b 100644
--- a/tests/auto/widgets/graphicsview/qgraphicseffectsource/tst_qgraphicseffectsource.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicseffectsource/tst_qgraphicseffectsource.cpp
@@ -260,7 +260,7 @@ void tst_QGraphicsEffectSource::boundingRect()
QCOMPARE(effect->source()->boundingRect(Qt::DeviceCoordinates), QRectF());
QRectF itemBoundingRect = item->boundingRect();
- if (!item->children().isEmpty())
+ if (!item->childItems().isEmpty())
itemBoundingRect |= item->childrenBoundingRect();
// We can at least check that the device bounding rect was correct in QGraphicsEffect::draw.
diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
index 56cf27155d..37190c3cf2 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -549,7 +549,7 @@ void tst_QGraphicsItem::construction()
QCOMPARE(item->scene(), (QGraphicsScene *)0);
QCOMPARE(item->parentItem(), (QGraphicsItem *)0);
- QVERIFY(item->children().isEmpty());
+ QVERIFY(item->childItems().isEmpty());
QVERIFY(item->isVisible());
QVERIFY(item->isEnabled());
QVERIFY(!item->isSelected());
@@ -589,7 +589,7 @@ public:
QRectF boundingRect() const
{
QRectF tmp = QGraphicsRectItem::boundingRect();
- foreach (QGraphicsItem *child, children())
+ foreach (QGraphicsItem *child, childItems())
tmp |= child->boundingRect(); // <- might be pure virtual
return tmp;
}
@@ -605,11 +605,11 @@ void tst_QGraphicsItem::constructionWithParent()
scene.addItem(item0);
scene.addItem(item1);
QGraphicsItem *item2 = new BoundingRectItem(item1);
- QCOMPARE(item1->children(), QList<QGraphicsItem *>() << item2);
+ QCOMPARE(item1->childItems(), QList<QGraphicsItem *>() << item2);
QCOMPARE(item1->boundingRect(), QRectF(0, 0, 200, 200));
item2->setParentItem(item0);
- QCOMPARE(item0->children(), QList<QGraphicsItem *>() << item2);
+ QCOMPARE(item0->childItems(), QList<QGraphicsItem *>() << item2);
QCOMPARE(item0->boundingRect(), QRectF(0, 0, 200, 200));
}
@@ -636,9 +636,9 @@ void tst_QGraphicsItem::destruction()
QGraphicsItem *parent = new QGraphicsRectItem;
Item *child = new Item;
child->setParentItem(parent);
- QCOMPARE(parent->children().size(), 1);
+ QCOMPARE(parent->childItems().size(), 1);
delete child;
- QCOMPARE(parent->children().size(), 0);
+ QCOMPARE(parent->childItems().size(), 0);
delete parent;
QCOMPARE(itemDeleted, 2);
}
@@ -661,9 +661,9 @@ void tst_QGraphicsItem::destruction()
child->setParentItem(parent);
scene.addItem(parent);
QCOMPARE(child->scene(), &scene);
- QCOMPARE(parent->children().size(), 1);
+ QCOMPARE(parent->childItems().size(), 1);
delete child;
- QCOMPARE(parent->children().size(), 0);
+ QCOMPARE(parent->childItems().size(), 0);
delete parent;
QCOMPARE(itemDeleted, 4);
}
@@ -692,7 +692,7 @@ void tst_QGraphicsItem::destruction()
QCOMPARE(child->scene(), (QGraphicsScene *)0);
QCOMPARE(parent->scene(), &scene);
QCOMPARE(child->parentItem(), (QGraphicsItem *)0);
- QVERIFY(parent->children().isEmpty());
+ QVERIFY(parent->childItems().isEmpty());
delete parent;
QCOMPARE(itemDeleted, 5);
delete child;
@@ -862,15 +862,15 @@ void tst_QGraphicsItem::setParentItem()
void tst_QGraphicsItem::children()
{
QGraphicsRectItem item;
- QVERIFY(item.children().isEmpty());
+ QVERIFY(item.childItems().isEmpty());
QGraphicsRectItem *item2 = new QGraphicsRectItem(QRectF(), &item);
- QCOMPARE(item.children().size(), 1);
- QCOMPARE(item.children().first(), (QGraphicsItem *)item2);
- QVERIFY(item2->children().isEmpty());
+ QCOMPARE(item.childItems().size(), 1);
+ QCOMPARE(item.childItems().first(), (QGraphicsItem *)item2);
+ QVERIFY(item2->childItems().isEmpty());
delete item2;
- QVERIFY(item.children().isEmpty());
+ QVERIFY(item.childItems().isEmpty());
}
void tst_QGraphicsItem::flags()
@@ -3573,7 +3573,7 @@ void tst_QGraphicsItem::group()
QCOMPARE(parent->sceneBoundingRect(), parentSceneBoundingRect);
QCOMPARE(parent->parentItem(), (QGraphicsItem *)group);
- QCOMPARE(group->children().size(), 1);
+ QCOMPARE(group->childItems().size(), 1);
QCOMPARE(scene.items().size(), 4);
QCOMPARE(scene.items(group->sceneBoundingRect()).size(), 3);
@@ -3585,7 +3585,7 @@ void tst_QGraphicsItem::group()
QCOMPARE(parent2->sceneBoundingRect(), parent2SceneBoundingRect);
QCOMPARE(parent2->parentItem(), (QGraphicsItem *)group);
- QCOMPARE(group->children().size(), 2);
+ QCOMPARE(group->childItems().size(), 2);
QCOMPARE(scene.items().size(), 4);
QCOMPARE(scene.items(group->sceneBoundingRect()).size(), 4);
@@ -3686,7 +3686,7 @@ void tst_QGraphicsItem::nestedGroups()
QCOMPARE(rect->group(), group1);
QCOMPARE(rect2->group(), group1);
QCOMPARE(group1->group(), (QGraphicsItemGroup *)0);
- QVERIFY(group2->children().isEmpty());
+ QVERIFY(group2->childItems().isEmpty());
delete group2;
}
@@ -3737,7 +3737,7 @@ void tst_QGraphicsItem::removeFromGroup()
QGraphicsItemGroup *group = scene.createItemGroup(scene.selectedItems());
QVERIFY(group);
- QCOMPARE(group->children().size(), 2);
+ QCOMPARE(group->childItems().size(), 2);
qApp->processEvents(); // index items
qApp->processEvents(); // emit changed
@@ -4505,10 +4505,10 @@ protected:
case QGraphicsItem::ItemParentHasChanged:
break;
case QGraphicsItem::ItemChildAddedChange:
- oldValues << children().size();
+ oldValues << childItems().size();
break;
case QGraphicsItem::ItemChildRemovedChange:
- oldValues << children().size();
+ oldValues << childItems().size();
break;
case QGraphicsItem::ItemSceneChange:
oldValues << QVariant::fromValue<QGraphicsScene *>(scene());