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. How set size policy
Forum Updated to NodeBB v4.3 + New Features

How set size policy

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 2.2k Views 1 Watching
  • 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.
  • E Offline
    E Offline
    erytcg
    wrote on last edited by
    #1

    Hello my mainwindow looks like this:
    0_1509898890165_8e36da42-0d02-4e0d-b7a9-78c532e455f3-obraz.png
    I would like to auto resize "Widget" with resize window and don't change size of tabWidget and GroupBoxes.
    How to set size policy this widget to this effect?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mostefa
      wrote on last edited by
      #2

      @erytcg

      Hi,

      I think that you just want to keep both tabWidget and GroupBoxes to fixed size

      In qt designer there is a property called sizePolicy ,

      SizePolicy must be preferred for QWidget (preferred is the default value)
      SizePolicy must be fixed for QGroupBoxes and tabWidget

      1 Reply Last reply
      0
      • E Offline
        E Offline
        erytcg
        wrote on last edited by
        #3

        And window in GridLayout?

        M 1 Reply Last reply
        0
        • E erytcg

          And window in GridLayout?

          M Offline
          M Offline
          mostefa
          wrote on last edited by
          #4

          @erytcg said in How set size policy:

          And window in GridLayout?

          I am not sure i understand what you want,? window has also a sizePolicy

          1 Reply Last reply
          0
          • E Offline
            E Offline
            erytcg
            wrote on last edited by
            #5

            SizePolicy must be preferred for QWidget (preferred is the default value)
            SizePolicy must be fixed for QGroupBoxes and tabWidget
            It dosn't work when I resize window all is on left corner

            jsulmJ 1 Reply Last reply
            0
            • E erytcg

              SizePolicy must be preferred for QWidget (preferred is the default value)
              SizePolicy must be fixed for QGroupBoxes and tabWidget
              It dosn't work when I resize window all is on left corner

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @erytcg It looks like your main window does not have a layout...

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              2

              • Login

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