Is it possible to apply QGraphicsGridLayout to QGraphicsView, so the items (including embedded widgets) are layouted just like gui elements on normal widget?
Is it possible to apply QGraphicsGridLayout to QGraphicsView, so the items (including embedded widgets) are layouted just like gui elements on normal widget?
Qt 5.3 Opensource & Creator 3.1.2
Yes and no. You can't do that directly but you can place it inside a QGraphicsWidget that takes the whole size of the scene.
you think it will be possible to directly assign layout in future?
Qt 5.3 Opensource & Creator 3.1.2
You can't assign a layout to something that doesn't exist. You need some object. Just like you can't assign a layout to the screen - you need a widget.
Well, gr. view and gr. scene ARE OBJECTS! Ok, then, widget it is ...
Qt 5.3 Opensource & Creator 3.1.2
I don't really see what the problem is with current design...
Qt Code:
QGraphicsWidget *top = new QGraphicsWidget; QGraphicsLinearLayout *l = new QGraphicsLinearLayout(top); QGraphicsProxyWidget *w1 = new QGraphicsProxyWidget; QGraphicsProxyWidget *w2 = new QGraphicsProxyWidget; l->addItem(w1); l->addItem(w2): scene->addItem(top); top->setGeometry(scene->sceneRect());To copy to clipboard, switch view to plain text mode
Bookmarks