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

QGridLayout span problems

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 309 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.
  • T Offline
    T Offline
    Trigve
    wrote on last edited by
    #1

    Hey,
    I've got a problem with spanned items in grid layout.

    I want to have a layout as seen on this picture:

    441dfc8e-ed70-4c92-9b28-c81bc8b195c1-image.png

    "Aaaa..." - QLabel, addWidget(..., 0, 0, 1, 5), QSizePolicy::Preferred
    Line edit - QLineEdit, addWidget(..., 0, 5, 1, 1), QSizePolicy::Preferred
    "Bbb" - QLabel, addWidget(..., 1, 0, 1, 1), QSizePolicy::Preferred
    Line edit (short) - QLineEdit, addWidget(..., 1, 1, 1, 1), QSizePolicy::Fixed
    Line edit (long) - QLineEdit, addWidget(..., 1, 3, 1, 2), QSizePolicy::Ignored

    But what I get is this:

    cb5817f1-5714-4bf0-aefa-d3e577388fe2-image.png

    As one can see the "Aaaa..." label space is divided equally between the cell 0...4 (see the second row). But what I need is to divide "spanned" space non-lineary between widgets base on size of the widget.

    Could this be somehow done with QGridLayout or do I need to implement my own layout manager?

    Thank you

    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