Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Allowing a window to become smaller

Allowing a window to become smaller

Scheduled Pinned Locked Moved General and Desktop
qwidgetqlayout
6 Posts 3 Posters 1.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Asperamanca
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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 ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Asperamanca
        wrote on last edited by
        #3

        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?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

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

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • Chris KawaC Online
            Chris KawaC Online
            Chris Kawa
            Lifetime Qt Champion
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            2
            • A Offline
              A Offline
              Asperamanca
              wrote on last edited by
              #6

              @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!

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved