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 Multiple Columns, Ignore Widget height in same row

QGridLayout Multiple Columns, Ignore Widget height in same row

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 499 Views 2 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.
  • EmrecpE Offline
    EmrecpE Offline
    Emrecp
    wrote on last edited by Emrecp
    #1

    Hello,
    I have QGridLayout. Adding widgets to left side and right side.
    But When i increase (clicking) widget height, the beside widget's size too increasing so widget going to downside. I don't want this.
    And I don't want use 2widgets for left side and right side. Thanks.

    1.png

    2.png

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      AFAIK, you can't do what you want directly.

      One possible way would be to have your widgets acts like popup if that make sense or use a combination of horizontal and vertical layouts.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • Chris KawaC Offline
        Chris KawaC Offline
        Chris Kawa
        Lifetime Qt Champion
        wrote on last edited by
        #3

        If you want to stick with QGridLayout (which is not well suited for this), when you click an item you could take it out of the layout and insert back with a vertical span set to number of items you would like to have on the left. This would also mean you'd have to take all the widgets below it out of the layout and put them back lower. Could work but seems silly if you have a lot of items to move around.

        The obvious choice though seems to be to have two vertical layouts side by side. You don't need extra widget for that, just nested layouts.

        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