1

Topic: How to force QWidget "" to the minimum size?

There is QWidget with some  inside  on layout, in general normal to itself such window which besides is possible  a mouse. At this window there is a button which shows/hides a part . Initially these  are not visible. If to push the button they appear also a window itself  so all of them to display. It is good. Now we push again this button what again to hide these .  hid but the window remains in the same size, it can be tightened only a mouse again to minimum possible.  that it would happen automatically. Meanwhile I tried resize (minimumSizeHint ()); in the output agent of pushing (after  dropped property of visibility), but to a campaign minimumSizeHint () whether does not consider it is visible  or not. To install another SizePolicy do not offer, as it would be necessary that the window was possible . If I will not find a method it to do, to a campaign again  to bury in code Qt and to add such possibility. Thanks!

2

Re: How to force QWidget "" to the minimum size?

Hello, nen777w, you wrote: N> There is QWidget with some  inside  on layout, in general normal to itself such window which besides is possible  a mouse. N> at this window there is a button which shows/hides a part . N> it is primary these  are not visible. N> if to push the button they appear also a window itself  so all of them to display. It is good. N> now it is pushed again this button what again to hide these . N> Childy hid but the window remains in the same size, it can be tightened only a mouse again to minimum possible. N> Hotleos that it would happen automatically. N> meanwhile I tried resize (minimumSizeHint ()); in the output agent of pushing (after  dropped property of visibility), but to a campaign minimumSizeHint () whether does not consider it is visible  or not. N> to Install another SizePolicy do not offer, as it would be necessary that the window was possible . N> If I will not find a method it to do, to a campaign again  to bury in code Qt and to add such possibility. N> thanks! At me is QTabWdget in QDialog. At switching  the size of dialogue changes. The code such: def tab_changed (idx): # trick to allow small window size innter_quadrangle_widget.setVisible (idx == 1) tab_widget.adjustSize () dialog.adjustSize ()

3

Re: How to force QWidget "" to the minimum size?

S> At me is QTabWdget in QDialog. At switching  the size of dialogue changes. The code such: S> S> def tab_changed (idx): S> # trick to allow small window size S> innter_quadrangle_widget.setVisible (idx == 1) S> tab_widget.adjustSize () S> dialog.adjustSize () S> adjustSize () - to me too not  helps as it QWidget and  adjustedSize () this check if (q-> isWindow ()) does not transit.

4

Re: How to force QWidget "" to the minimum size?

Hello, nen777w, you wrote: N> adjustSize () - to me too not  helps as it QWidget and  adjustedSize () this check if (q-> isWindow ()) does not transit. Can is easier QWidget-> QFrame to make, at it like should fulfill, it is possible still update  to cause (after elements disappear), can then sizePolicy will be applied. You not to forget  to lead after elements disappear void myFrame:: onClicked () {ui_-> btn-> hide (); QTimer:: singleShot (0, this, [this] () {adjustSize ();});}