tuli
29th September 2014, 17:08
I have a minor issue that has been bugging me for a while. It's about automatic layout resizing when a contained widget is hidden at runtime:
The user hits a button and a QtableWidget gets hidden (i call setVisible(false) on it). The problem lies with the resizing.
By default, the dialog size doesnt change, which leaves a lot of ugly empty space, but the user could reduce the height to fix that.
Now, if i call layout()->setSizeConstraint(QLayout::SetFixedSize); on my layout, the resizing happens automatically - however, the user cant change the size any more. This also resizes both height and width (even though only height should be affected).
The issue is that the user should be able to resize the width customly, only the height should be reduced to hide the empty space left by the qtablewidget.
How can i do that? As far as i can see, no other layout options are available, and calling resize(..) and similar methods does not have any effect.
have a great day.
The user hits a button and a QtableWidget gets hidden (i call setVisible(false) on it). The problem lies with the resizing.
By default, the dialog size doesnt change, which leaves a lot of ugly empty space, but the user could reduce the height to fix that.
Now, if i call layout()->setSizeConstraint(QLayout::SetFixedSize); on my layout, the resizing happens automatically - however, the user cant change the size any more. This also resizes both height and width (even though only height should be affected).
The issue is that the user should be able to resize the width customly, only the height should be reduced to hide the empty space left by the qtablewidget.
How can i do that? As far as i can see, no other layout options are available, and calling resize(..) and similar methods does not have any effect.
have a great day.