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. QOpenGlWidget as the viewport for QGraphicsView, when an item triggers an update, the paint of all elements is called
Qt 6.11 is out! See what's new in the release blog

QOpenGlWidget as the viewport for QGraphicsView, when an item triggers an update, the paint of all elements is called

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 807 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.
  • L Offline
    L Offline
    Lin Jinquan
    wrote on last edited by
    #1

    I am working on a QGraphicsView project and using QOpebGlWidget as the viewport for QGraphicsView to achieve accelerated rendering in OpenGL. In the test, I have two items, and when I actively trigger an update for one item, the paint function for both items is triggered. I set the viewportUpdating Mode of QGraphicsView to QGraphicsView::MinimalViewportUpdate, I want to know why this is and if there is a way to solve it. Thank you for your answers.

    1 Reply Last reply
    0
    • K Offline
      K Offline
      Kevin Hoang
      wrote on last edited by
      #2

      I think it’s not related to QOpenGLWidget, but rather to the ViewportUpdateMode of QGraphicsView. By default, it uses FullViewportUpdate. You could try switching to SmartViewportUpdate or MinimalViewportUpdate and see if that makes a difference.

      1 Reply Last reply
      0
      • L Offline
        L Offline
        Lin Jinquan
        wrote on last edited by
        #3

        I tried all the ViewportUpdating Modes of QGraphicsView but it didn't work. However, when I didn't set QOpenGlWidget to the viewPort of QGraphicsView, triggering an update for a single item in the same scence wouldn't trigger the paint function for other items

        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