Is possible to set a minimum width to a widget became visible using CSS or editing her properties in Qt Designer?
-
wrote on 4 Nov 2022, 16:02 last edited by
In this example the Pink QWidget has her
Horizontal
andVertical
policy set toIgnored
so it can be completely 'resized' to the minimum size, which is0
.How I can set a 'minimum visible width' to the
PushButton
became visible?I created this gif to illustrate what I'm talking about:
As seen in the gif the
PushButton
became visible as soon as her parent becomes visible (default behavior), I would like to make it visible only when there's a specific amount of space in the parent.I wonder if this could be achieved with any kind of CSS similar to:
min-width: 0; max-width: 200; /* min-visible-width: 100; */ <- example
or by editing the button/parent properties in the Qt Designer, instead of subclassing the button and setting it hidden/unhidden according to her size.
-
Hi,
AFAIK, no.
You should re-implement your purple widget to handle the button as an invisible widget will not resize even if its containing widget does.
1/2