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. Delayed Update for drawn objects from QGraphicsScene? QPainter objects have no problem.
Forum Update on Monday, May 27th 2025

Delayed Update for drawn objects from QGraphicsScene? QPainter objects have no problem.

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

    I've used both QPainter->drawXXXX() and QGraphicsScene->addXXXX() in my code, the reason is only QPainter->drawText() won't move and scale after I change the window size and I need that. The QGraphicsItem::ItemIgnoresTransformations for the text that's created from QGraphicsScene->addText() is not fully working, it moves still.
    When I call update(), the QPainter objects got updated right away, but QGraphicsScene doesn't update until I move my mouse out of the window. I tried calling processEvent(), but it's not helping.

    Any help is appreciated!

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

      Hi,

      Something is not clear from your description, are you re-implementing QGraphicsTextItem ?

      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
      • M Offline
        M Offline
        MShao
        wrote on last edited by
        #3

        No, I didn't re-implementing QGraphicsTextItem. I didn't even use it for drawing text, because it's moving when I change the window even with itemIgnoreTransformations flag. So I use QPainter->drawText() for showing text.

        Then I've found out that, QPainter's text got updated right away when I call update(), but whatever objects I've drawn from QGraphicsScene->addXXXX() doesn't get updated until I make move of the mouse out of window or click the view.

        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