Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Looking for advice for use of Layouts in QGraphicsViews
Qt 6.12 LTS is out! See what's new in the release blog

Looking for advice for use of Layouts in QGraphicsViews

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 1.1k 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.
  • N Offline
    N Offline
    nutrx
    wrote on last edited by
    #1

    Hi. I'm writing a software making intensive use of the QGraphicsView framework (using PySide2). Overall, I really like it. There is just one thing that's constantly keeping me from making progress, and I'm running out of ideas, so if anyone has experience with QGraphicsViews, I'd really appreciate some more experienced advice.

    Over the past months, I have encountered many different bugs and problems where those QGraphicsLayouts behave significantly different than normal QLayouts would and produce the ugliest code for fixing those, to me, often very unreasonable effects.

    (Example: the layouts don't properly scale according to size policies when content is changed, added or removed. I spent many days trying to get them to automatically adjust and the fix that's kinda working right now is by far the worst and most unscalable part of the whole software. Another thing would be the stretch system and the way stretches are treated when accessing a layout's content which complicates everything)

    I am using them for organizing QGraphicsWidgets and QWidgets in layouts for the scene. I want to point out though, I'm not a software developer and those issues might be due to a lack of knowledge, maybe I'm just too dumb for the documentation, I don't know.

    Question: Did someone here encounter similar issues and are there clean alternatives to using QGraphicsLayouts for accomplishing the same thing?

    Help is much appreciated.

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

      Hi,

      Can you provide a minimal runnable script that shows the issue ?
      That would allow for better discutions around what is happening and find if there is an issue in Qt or within your code.

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

      N 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Can you provide a minimal runnable script that shows the issue ?
        That would allow for better discutions around what is happening and find if there is an issue in Qt or within your code.

        N Offline
        N Offline
        nutrx
        wrote on last edited by
        #3

        @SGaist Thanks, but that wasn't really the question.
        I'm asking about alternatives. Maybe there is a way to use normal QLayouts to arrange QGraphicsWidgets, or something like that?

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

          The issue is, if one can run the script and have under his eyes the issues you are writing about, it will allow to talk about alternatives you are asking about or maybe bug fixing.

          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
          0

          • Login

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