Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Solved Problems to adjust QGridLayout to requirements

    General and Desktop
    qgridlayout qtcreator 3.5.1 pyqt4
    3
    5
    336
    Loading More Posts
    • 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.
    • cerr
      cerr last edited by

      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?

      cerr 1 Reply Last reply Reply Quote 0
      • nagesh
        nagesh last edited by

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

        cerr 1 Reply Last reply Reply Quote 0
        • cerr
          cerr @cerr last edited by

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

          1 Reply Last reply Reply Quote 0
          • mrjj
            mrjj Lifetime Qt Champion last edited by mrjj

            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 Reply Quote 0
            • nagesh
              nagesh last edited by

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

              cerr 1 Reply Last reply Reply Quote 0
              • cerr
                cerr @nagesh last edited by

                @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 Reply Quote 0
                • First post
                  Last post