Is there the possibility to enable the built-in resize capability from the Qt designer in my program ?
I've a Qt UI element with implementation, which I added to a QGraphicsView
.
Now I want to resize it like in my UI-Editor.
How can I enable this ?
You can use QSizeGrip
in a layout inside your widget. This is a little hackis but is simple to implement :
myWidget->setWindowFlags(Qt::SubWindow);
QSizeGrip * sizeGrip = new QSizeGrip(myWidget);
QGridLayout * layout = new QGridLayout(myWidget);
layout->addWidget(sizeGrip, 0,0,1,1,Qt::AlignBottom | Qt::AlignRight);
The QSizeGrip
class provides a resize handle for resizing top-level windows. When you set the widget flag Qt::SubWindow
, then the user can resize it using the size grip.
Another possibility is to use QSplitters. It is a method to organize graphic elements in a layout with a drag-able zone in between.
The use of splitters are explained here, also have a look on this question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With