From 328550ff008da53d865f3a6f245aa4753d1b3527 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 30 Jul 2012 23:36:59 +0200 Subject: Remove the obsolete scene argument for constructors of graphics items The argument has been obsoleted and not documented since 2007. Get rid of it now before Qt 5.0 Task-number: QTBUG-25089 Change-Id: I91a5508a5e1606f5b5c289501295c67be4abe6a0 Reviewed-by: Jason McDonald --- .../graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp | 14 +++++++++----- .../graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp | 3 ++- 2 files changed, 11 insertions(+), 6 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp index 41ef60f7d3..8dac4bdfbe 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp @@ -2200,7 +2200,8 @@ void tst_QGraphicsItem::setMatrix() qRegisterMetaType >("QList"); QSignalSpy spy(&scene, SIGNAL(changed(QList))); QRectF unrotatedRect(-12, -34, 56, 78); - QGraphicsRectItem item(unrotatedRect, 0, &scene); + QGraphicsRectItem item(unrotatedRect, 0); + scene.addItem(&item); scene.update(scene.sceneRect()); QApplication::instance()->processEvents(); @@ -2467,10 +2468,13 @@ void tst_QGraphicsItem::collidesWith_item() { QGraphicsScene scene; - QGraphicsRectItem rect(20, 20, 100, 100, 0, &scene); - QGraphicsRectItem rect2(40, 40, 50, 50, 0, &scene); + QGraphicsRectItem rect(20, 20, 100, 100, 0); + scene.addItem(&rect); + QGraphicsRectItem rect2(40, 40, 50, 50, 0); + scene.addItem(&rect2); rect2.setZValue(1); - QGraphicsLineItem line(0, 0, 200, 200, 0, &scene); + QGraphicsLineItem line(0, 0, 200, 200, 0); + scene.addItem(&line); line.setZValue(2); QCOMPARE(scene.items().size(), 3); @@ -6244,7 +6248,7 @@ public slots: void newTextItem() { // Add a text item - QGraphicsItem *item = new QGraphicsTextItem("This item will not ensure that it's visible", 0, this); + QGraphicsItem *item = new QGraphicsTextItem("This item will not ensure that it's visible", 0); item->setPos(.0, .0); item->show(); } diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp index e188805d6a..dea253d019 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp @@ -3465,7 +3465,8 @@ void tst_QGraphicsScene::task139782_containsItemBoundingRect() { // The item in question has a scene bounding rect of (10, 10, 50, 50) QGraphicsScene scene(0.0, 0.0, 200.0, 200.0); - QGraphicsRectItem *item = new QGraphicsRectItem(0.0, 0.0, 50.0, 50.0, 0, &scene); + QGraphicsRectItem *item = new QGraphicsRectItem(0.0, 0.0, 50.0, 50.0, 0); + scene.addItem(item); item->setPos(10.0, 10.0); // The (0, 0, 50, 50) scene rect should not include the item's bounding rect -- cgit v1.2.3