PDA

View Full Version : How to define object position unchangeable ?



andre_teprom
31st July 2011, 03:40
Hi friends,


I placed 3 buttons vertically on a GroupBox.
When I hide the 1rst one, the others move up, as if were justified to top.

ui->button1->hide() ;

How could I avoid that ?


+++

mvuori
31st July 2011, 10:14
GroupBox? What's that? Perhaps you mean QGroupBox.

QGroupBox behaves that way, and usually it is sensible and really how it should work. After all, when you placed your buttons in the QGroupBox, you didn't define their absolute positions -- you let the box decide.

But if you want to define absolute positions, don't use QGroupBox or a layout -- just place the buttons individually where you want.

DanH
31st July 2011, 22:59
Yep, just place the buttons where you want them, without a layout manager. Or create your own layout manager that does what you want.