user resize QGroupBoxes size dynamically with the mouse
In Qt Creator and many other applications which contain a lot of tools the user can resize with the mouse the size of each docked window. Is it possible to do the same with QGroupBox? For example I have a QVBoxLayout with 2 QGroupBoxes. Is it possible to let the user decide the size of each QGroupBox as he desires?
Thanks!
Re: user resize QGroupBoxes size dynamically with the mouse
There are several ways.
If it's only the two QGroupBoxes you could put a QSplitter between them.
To make the QGroupBoxes resizeable individually for more complex grid structures would mean quite a bit of work.
Re: user resize QGroupBoxes size dynamically with the mouse
Small correction: In Qt you need to add widgets to a splitter. Not put a splitter between them, like for example in Delphi. The splitter will replace a vertical or horizontal layout depending on its orientation.
Joh
Re: user resize QGroupBoxes size dynamically with the mouse
QSplitter is just fantastic!!
it just did the job :)
I added 2, one horizontal and one vertical and both work great.
thanks!
Re: user resize QGroupBoxes size dynamically with the mouse
coming back to solve a small bug :)
I used QSplitter successfully but I have a little problem..
I cannot see the handles!
I have to guess their position by moving the mouse over the area.
Re: user resize QGroupBoxes size dynamically with the mouse
Appearance is governed by the style in use, which generally mimics the platform's native look and feel by default. You are free to style the splitter or even provide a custom QSplitterHandle.
Re: user resize QGroupBoxes size dynamically with the mouse
Thanks! I did it. I actually added an image on the handle
Code:
app.setStyleSheet("QSplitter::handle { background-color: grey }");
app.setStyleSheet("QSplitter::handle { image: url(images/ss.png) }");