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 understanding layouts
Qt 6.11 is out! See what's new in the release blog

Problems understanding layouts

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 249 Views 1 Watching
  • 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.
  • L Offline
    L Offline
    leonardoMB
    wrote on last edited by leonardoMB
    #1
    QGridLayout *layout = new QGridLayout();
      layout->setContentsMargins(6, 5, 6, 2);
      layout->addWidget(lastUpdatedMsg, 0, 1, 1, 1, Qt::AlignTop | Qt::AlignHCenter);
      layout->addWidget(_configWidget, 1, 0, 1, 1, Qt::AlignLeft);
      layout->addWidget(_graph, 1, 1);
      layout->addWidget(_Msg, 1, 1, 1, 1, Qt::AlignCenter);
    

    So I printed the size of this layout and it says it 2x2. So What is going on here? Things are spaming over the others? there are more than 1 widget per cell space.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mpergand
      wrote on last edited by
      #2

      layout->addWidget(_graph, 1, 1);
      layout->addWidget(_Msg, 1, 1, 1, 1, Qt::AlignCenter);

      these two are in the same cell
      and nothing in cell 0,0

      1 Reply Last reply
      2

      • Login

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