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

Problems to adjust QGridLayout to requirements

Scheduled Pinned Locked Moved Solved General and Desktop
qgridlayoutqtcreator 3.5.1pyqt4
5 Posts 3 Posters 882 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.
  • cerrC Offline
    cerrC Offline
    cerr
    wrote on 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?

    cerrC 1 Reply Last reply
    0
    • nageshN Offline
      nageshN Offline
      nagesh
      wrote on 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?

      cerrC 1 Reply Last reply
      0
      • cerrC cerr

        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?

        cerrC Offline
        cerrC Offline
        cerr
        wrote on last edited by
        #2

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

        1 Reply Last reply
        0
        • mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on 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
          • nageshN Offline
            nageshN Offline
            nagesh
            wrote on 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?

            cerrC 1 Reply Last reply
            0
            • nageshN nagesh

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

              cerrC Offline
              cerrC Offline
              cerr
              wrote on 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

              • Login

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