Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Calling QGraphicsLinearLayout.setMinimumWidth() breaks further geometry computation
Forum Update on Monday, May 27th 2025

Calling QGraphicsLinearLayout.setMinimumWidth() breaks further geometry computation

Scheduled Pinned Locked Moved Unsolved Qt for Python
2 Posts 1 Posters 187 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.
  • N Offline
    N Offline
    Niagarer
    wrote on 1 Aug 2020, 09:07 last edited by Niagarer 8 Jan 2020, 09:08
    #1

    Hi,
    in my program, I use QGraphicsLinearLayout.setMinimumWidth() to ensure that its width does not fall below a certain value. However, if I add new stuff to this layout afterward, the layout does not horizontally resize anymore, it stays narrow. It never does on its own, but calling

    self.layout.invalidate()
    self.layout.activate()
    

    did the trick so far. (although according to the documentation, it should not be necessary to call both, but whatever)
    How can I force the layout to recompute its minimum width?
    Thanks for answers!

    1 Reply Last reply
    0
    • N Offline
      N Offline
      Niagarer
      wrote on 1 Aug 2020, 10:00 last edited by Niagarer 8 Jan 2020, 10:25
      #2
      self.layouts_parent_widget.adjustSize()
      

      seems to do the trick in this case... I am a little confused, though, because it doesn't in a slightly different situation and I couldn't find out what differs yet, but regarding the issue described above, this seems to work

      1 Reply Last reply
      0

      1/2

      1 Aug 2020, 09:07

      • Login

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