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. Problem with stretching QGridLayout
QtWS25 Last Chance

Problem with stretching QGridLayout

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

    Hello, I'm using PyQT6 and I want to create the following graphic (rough sketch):
    Example.png
    I have figured out most things but how I can do the red part.
    I want to have that area to stretch on the horizontal but not on the vertical. It should only take up as much space as it needs for the buttons and title to fit. If I scale the window and the buttons don't fit in the row anymore, they should go to the next row and the area should stretch with it.
    Because of my previous projects using tkinter I'm used to the QGridLayout way of working and therefore wanted to use it here. Maybe it isn't the right choice. However what I need is that I can place a new button anywhere, not only in the "back". So for example I need to be able to say "this buttons should be on position 3"
    If you could help me with that, I would be really glad.

    Pl45m4P 1 Reply Last reply
    0
    • W Wugge

      Hello, I'm using PyQT6 and I want to create the following graphic (rough sketch):
      Example.png
      I have figured out most things but how I can do the red part.
      I want to have that area to stretch on the horizontal but not on the vertical. It should only take up as much space as it needs for the buttons and title to fit. If I scale the window and the buttons don't fit in the row anymore, they should go to the next row and the area should stretch with it.
      Because of my previous projects using tkinter I'm used to the QGridLayout way of working and therefore wanted to use it here. Maybe it isn't the right choice. However what I need is that I can place a new button anywhere, not only in the "back". So for example I need to be able to say "this buttons should be on position 3"
      If you could help me with that, I would be really glad.

      Pl45m4P Online
      Pl45m4P Online
      Pl45m4
      wrote on last edited by
      #2

      @Wugge said in Problem with stretching QGridLayout:

      It should only take up as much space as it needs for the buttons and title to fit. If I scale the window and the buttons don't fit in the row anymore, they should go to the next row and the area should stretch with it.

      like this?

      • https://doc.qt.io/qt-6/qtwidgets-layouts-flowlayout-example.html

      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      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