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>
This commit is contained in:
parent
a48a85098b
commit
d711f98bfb
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user