Hide widget if parent window width <widget.width ?
-
@SGaist said in Hide widget if parent window width <widget.width ?:
Hi,
Something like QSplitter ?
I don't want to manually hide the widget. Just automatically hide when empty space runs out.
Say I have window that is 400 wide and 4 widgets that take 200 pixels. if window.width()<200, then one of the 4 widgets should disappear and the remaining 3 become wider to show data better. I suppose all widgets with flag to auto-hide should disappear at once... mhmhmmm Something tells me Qt does not have it o.O
-
AFAIK, no it does not. However one thing that is sure is that you should handle that in the widget containing those that should be made invisible and not the other way around.
-
@SGaist I ended up hocking up to resize event of parent widget to find out when size changed & resize my other widget acordingly.
I ended up using "invisible" QLabel that retains size as my "spacer". I had to change its spacing role on the go depending of one or more widget are visible or not as I needed to retain correct order. So far works great.
TIA