Qt Forum

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

    Call for Presentations - Qt World Summit

    Solved QGridLayout with multiple widgets

    General and Desktop
    3
    3
    335
    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.
    • J
      jkwok678 last edited by

      Hi,

      Is it possible to have more than 1 in a cell in a QGridLayout?

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

        Hi
        No, its not directly but nothing stop you from creating a new QWidget, add layout to it and then
        add 2 other widgets to this placeholder widget, you then insert the placeholder into cell and
        it will be manged as one.

        1 Reply Last reply Reply Quote 3
        • Chris Kawa
          Chris Kawa Moderators last edited by

          Well you don't even need an extra widget, just a nested layout for the widgets in the cell. You add widgets to some layout and then add that layout to your grid with one of the addLayout() methods.

          1 Reply Last reply Reply Quote 3
          • First post
            Last post