Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Is there a automatic repaint in QML?
Forum Updated to NodeBB v4.3 + New Features

Is there a automatic repaint in QML?

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 3.4k 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.
  • X Offline
    X Offline
    xardas008
    wrote on last edited by
    #1

    Hello,

    I have programmed some custom QML components in Qt and everytime another component overlays mine I need a repaint.
    The problem is, that the other components don't need to know anything about the one which gets overlapped so I can not call update on that component.

    Is there a way to automate this? So that everytime something in the UI changes every component gets repainted? Or to look if it needs a repaint so we gain a little bit more performance.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mbrasser
      wrote on last edited by
      #2

      Hi,

      As long as QML knows about the bounding rectangle of your custom component (if it is QDeclarativeItem derived and has a width/height, then it should, otherwise if it is QGraphicsObject derived you may need to re-implement QGraphicsItem::boundingRect()), and it only paints within its bounding rectangle, then repaints should automatically occur for regular usage (i.e. whenever the view detects that it needs a repaint).

      To force a full repaint every time anything is detected dirty, you can also try the QGraphicsView::FullViewportUpdate flag.

      Regards,
      Michael

      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