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. [RESOLVED] How to make a QSplitter the top Widget use always 60% of screen?
QtWS25 Last Chance

[RESOLVED] How to make a QSplitter the top Widget use always 60% of screen?

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 2.3k 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.
  • D Offline
    D Offline
    dcbasso
    wrote on last edited by
    #1

    Hello,

    I have a QSplitter on my screen, and I have to QWidgets inside, one on the and other on the bottom...
    So I need that always the TOP Qwidget use 60% of screen... How can I make that?

    Thanks a lot.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      soroush
      wrote on last edited by
      #2

      If you need constant ratio. why you bother with QSplitter ? Just put those widgets in a horizontal layout and set stretch values as you like. (say 3,2)

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dcbasso
        wrote on last edited by
        #3

        I let the user adjust the screen, with the QSlitter! But at first show I need to start with 60% of screen on top and 40% for bottom...

        The bottom widget is dynamic... sometimes can have 3 buttons, sometimes 2 or none button.

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

          Set the stretch factor of the size policy to 6 for the top widget and 4 for the bottom one.

          1 Reply Last reply
          0
          • D Offline
            D Offline
            dcbasso
            wrote on last edited by
            #5

            Thanks, After I test I return here if solve my problem.

            1 Reply Last reply
            0
            • D Offline
              D Offline
              dcbasso
              wrote on last edited by
              #6

              Thanks, Works very Nice!

              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