PDA

View Full Version : Hide widget, but not change layout



dimaz
17th October 2008, 22:11
How can I hide widget without rescaling other widgets.
For example: hide() hides widget, but other widgets start changes their size (expand to hidden widget area). I don't need this. How can I make this in simple way?

Sheng
17th October 2008, 23:00
try widget.setWindowOpacity(0) instead of hide(0, but the former one might not work in some environment.


How can I hide widget without rescaling other widgets.
For example: hide() hides widget, but other widgets start changes their size (expand to hidden widget area). I don't need this. How can I make this in simple way?

osiris81
21st November 2008, 13:46
Hello, I tried it but with no success.

I tried to hide a QLabel but ui.label->setWindowOpacity(0) does nothing at all

OS: winXP
Qt: 4.4.3

Any other ideas?

aamer4yu
21st November 2008, 15:32
If its just about few widgets, you can do the following -

add the widget(s) to a Qwidget which will act as a holder for them. Now when u want to hide the widget, hide them, the widget/placeholder will still be there, and other widgets wont resize :)