From d711f98bfbb8ff34279b019094595e02b3c592e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Martsum?= Date: Fri, 1 Mar 2013 16:34:55 +0100 Subject: [PATCH] Clean up manual test to QGraphicsView (rubberband) This cleans a bit up in the manual test by a) Removing a weird reference alloration (and replace . with ->) b) rename for variable from v (which was also the view name) to n. c) remove a big item in the scene rect that is irrelevant to the test Change-Id: I49cb319bcc2f4bceef0c96ca86b571b0240a9a92 Reviewed-by: Andreas Aardal Hanssen --- .../qgraphicsview/rubberband/rubberbandtest.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/manual/widgets/qgraphicsview/rubberband/rubberbandtest.cpp b/tests/manual/widgets/qgraphicsview/rubberband/rubberbandtest.cpp index f6077e3044..aec2479239 100644 --- a/tests/manual/widgets/qgraphicsview/rubberband/rubberbandtest.cpp +++ b/tests/manual/widgets/qgraphicsview/rubberband/rubberbandtest.cpp @@ -102,21 +102,20 @@ int main(int argc, char *argv[]) QWidget w; w.setLayout(new QVBoxLayout); QLabel *l = new QLabel(&w); - MyGraphicsView &v = *(new MyGraphicsView(&w, l)); + MyGraphicsView *v = new MyGraphicsView(&w, l); - w.layout()->addWidget(&v); + w.layout()->addWidget(v); w.layout()->addWidget(l); QGraphicsScene s(0.0, 0.0, 5000.0, 5000.0); - v.setScene(&s); - v.setInteractive(true); - v.setRubberBandSelectionMode(Qt::IntersectsItemBoundingRect); - s.addRect( (qreal) 0.0, 0.0, 1000.0, 50.0, QPen(),QBrush(QColor(0,0,255))); + v->setScene(&s); + v->setInteractive(true); + v->setRubberBandSelectionMode(Qt::IntersectsItemBoundingRect); for (int u = 0; u < 100; ++u) - for (int v = 0; v < 100; ++v) { + for (int n = 0; n < 100; ++n) { MyGraphicsItem *item = new MyGraphicsItem(); - item->setRect(QRectF(v * 80.0, u * 80.0, 50.0, 20.0)); + item->setRect(QRectF(n * 80.0, u * 80.0, 50.0, 20.0)); s.addItem(item); }