diff options
author | Thorbjørn Martsum <tmartsum@gmail.com> | 2013-03-01 16:34:55 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-01 22:10:25 +0100 |
commit | d711f98bfbb8ff34279b019094595e02b3c592e4 (patch) | |
tree | 6afa0b391a2e11bd2ed0b31f63b94de86a03a823 | |
parent | a48a85098b6db81a619208f88b277768edf63530 (diff) |
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 <andreas@hanssen.name>
-rw-r--r-- | tests/manual/widgets/qgraphicsview/rubberband/rubberbandtest.cpp | 15 |
1 files 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); } |