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. How to repaint QDeclarativeItem?
QtWS25 Last Chance

How to repaint QDeclarativeItem?

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

    Hi, i'm creating a qml widget in c++, i've overrided the paint method like this:
    @void MyItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *options, QWidget *widget){
    painter->drawImage(0, 0, _qImage.scaledToWidth(this->width()));
    }@
    inside MyItem i've a timer that changes the image, how can i force the repainting of the item at every timer event?

    1 Reply Last reply
    0
    • R Offline
      R Offline
      rferrazz
      wrote on last edited by
      #2

      ok i've to call update() every time i need a repaint!

      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