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. QGridLayout with multiple widgets

QGridLayout with multiple widgets

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 3 Posters 972 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.
  • J Offline
    J Offline
    jkwok678
    wrote on 30 Jul 2020, 22:55 last edited by
    #1

    Hi,

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

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 30 Jul 2020, 23:08 last edited by
      #2

      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
      3
      • C Offline
        C Offline
        Chris Kawa
        Lifetime Qt Champion
        wrote on 30 Jul 2020, 23:10 last edited by
        #3

        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
        3

        1/3

        30 Jul 2020, 22:55

        • Login

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