Reputation: 1458
I would like to create a Qt window that
What I managed so far is to create a QGraphicsView
with setDragMode(QGraphicsView::ScrollHandDrag)
http://doc.qt.io/qt-5/qgraphicsview.html#dragMode-prop. I then placed the sub-widgets on a QGraphicsScene
, however, this didn't allow the sub-widgets to be resized by pulling their border.
I also tried to inherit my custom sub-widget class from QDialog
, which allows setSizeGripEnabled(true)
. However, this doesn't resize their content, and QDialog is probably not meant to be part of a QGraphicsView.
Any suggestions? It would also be ok if the sub-widgets behave like sub-windows that can also be dragged at their title bar, as long as they cannot be closed and they move when the background is dragged.
Upvotes: 2
Views: 423
Reputation: 1420
You can look aside QMdiArea
class (Qt documentation: QMdiArea). By problem description it is what you need.
Of course, you can use Graphics View Framework
, but, i think, it will be more difficult. If you choose such approach, very useful will be class QGraphicsWidget
(Qt documentation: QGraphicsWidget).
Upvotes: 2