Allowing a window to become smaller



  • I have a window with a status bar on bottom. The window uses a vertical layout (content on top, statusbar on bottom). The status bar itself uses a horizontal layout, with fixed widths for the single fields.

    Now the window cannot be made any smaller than the status bar. The status bar layout seems to promote its total width as minimum width to the outer layout. In the end, the window has a pretty big minimum size.

    How can I change such an arrangement so that I can keep using a horizontal layout for the status bar itself, but allow a part of it to be hidden if the window is made smaller?


  • Lifetime Qt Champion

    Hi,

    What about allowing the single fields to shrink when the windows gets under a specific size ? Or hide one or the other of these fields ?



  • Fields should have a fixed size, this is a design requirement.
    Hiding fields sounds pretty complex to develop.

    Is there no solution where the status bar itself is a horizontal layout, but that layout doesn't influence the window size limits?


  • Lifetime Qt Champion

    Just one thing, when you say status bar, do you mean QStatusBar ?


  • Moderators

    One way is to put these widgets into a QScrollArea and set the horizontal scroll bar policy of it to Qt::ScrollBarAlwaysOff. This way the "overflowing" content would just be cut off.



  • @SGaist said:

    Just one thing, when you say status bar, do you mean QStatusBar ?

    Yes, at core it's a QStatusBar.

    @Chris-Kawa said:

    One way is to put these widgets into a QScrollArea and set the horizontal scroll bar policy of it to Qt::ScrollBarAlwaysOff. This way the "overflowing" content would just be cut off.

    Sounds like an idea worth to try. Thanks!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.