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. Problems to adjust QGridLayout to requirements
QtWS25 Last Chance

Problems to adjust QGridLayout to requirements

Scheduled Pinned Locked Moved Solved General and Desktop
qgridlayoutqtcreator 3.5.1pyqt4
5 Posts 3 Posters 879 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.
  • C Offline
    C Offline
    cerr
    wrote on 25 Mar 2021, 20:40 last edited by
    #1

    Hi,

    I'm working on a project which uses a QGrid Layout to align some widgets, now I needed to add an additional widget above someother widgets and for some reason, Qt Creator does not give me the option to merge two automatially added columns together - or better, I don't know how to merge two columns. This is what I have:
    b28fe72e-ae36-4e4d-ae39-5f3c04503f1c-image.png
    and I would like to merge the column with the QComboBox with the empty column to the right of it so that the QComboBox has the same width as the QLineEdit underneath it.
    I've tried to set the minimum Size of the QComboBox but it seems to just extend to the right along with the empty column staying the same width (instead of taking up the empty column's space). I must be looking at the wrong setting. How do I modify/remove that "empty" space?

    C 1 Reply Last reply 25 Mar 2021, 20:43
    0
    • N Offline
      N Offline
      nagesh
      wrote on 25 Mar 2021, 23:10 last edited by
      #4

      @cerr select combo box and expand horizontally in right direction it should occupy the
      empty space right to it
      If not check follow things for the combo box
      1)What is the horizontal policy property set? it should not be fixed. either Preferred / Expanding
      2)Check Maximum size value?

      C 1 Reply Last reply 25 Mar 2021, 23:47
      0
      • C cerr
        25 Mar 2021, 20:40

        Hi,

        I'm working on a project which uses a QGrid Layout to align some widgets, now I needed to add an additional widget above someother widgets and for some reason, Qt Creator does not give me the option to merge two automatially added columns together - or better, I don't know how to merge two columns. This is what I have:
        b28fe72e-ae36-4e4d-ae39-5f3c04503f1c-image.png
        and I would like to merge the column with the QComboBox with the empty column to the right of it so that the QComboBox has the same width as the QLineEdit underneath it.
        I've tried to set the minimum Size of the QComboBox but it seems to just extend to the right along with the empty column staying the same width (instead of taking up the empty column's space). I must be looking at the wrong setting. How do I modify/remove that "empty" space?

        C Offline
        C Offline
        cerr
        wrote on 25 Mar 2021, 20:43 last edited by
        #2

        the layoutColumnMinimumWidth in the QFGridLayout is set to 0,0,0,0,0

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 25 Mar 2021, 21:17 last edited by mrjj
          #3

          Hi
          Cant you just delete the layout in it ? ( the red box ) to the right of it ?
          and drag the combobox to be the same size as the RFID ?

          This function allows a widget to span multiple cols
          https://doc.qt.io/qt-5/qgridlayout.html#addItem
          but im not sure you need that.

          1 Reply Last reply
          0
          • N Offline
            N Offline
            nagesh
            wrote on 25 Mar 2021, 23:10 last edited by
            #4

            @cerr select combo box and expand horizontally in right direction it should occupy the
            empty space right to it
            If not check follow things for the combo box
            1)What is the horizontal policy property set? it should not be fixed. either Preferred / Expanding
            2)Check Maximum size value?

            C 1 Reply Last reply 25 Mar 2021, 23:47
            0
            • N nagesh
              25 Mar 2021, 23:10

              @cerr select combo box and expand horizontally in right direction it should occupy the
              empty space right to it
              If not check follow things for the combo box
              1)What is the horizontal policy property set? it should not be fixed. either Preferred / Expanding
              2)Check Maximum size value?

              C Offline
              C Offline
              cerr
              wrote on 25 Mar 2021, 23:47 last edited by
              #5

              @nagesh Haha :boom: I knew it was something along these lines:
              "select combo box and expand horizontally in right direction it should occupy the
              empty space right to it"
              Shame on me and awesome! Thank you very much! lol
              I never asked that question, right? :D

              1 Reply Last reply
              0

              5/5

              25 Mar 2021, 23:47

              • Login

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