Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    How to repaint QDeclarativeItem?

    QML and Qt Quick
    1
    2
    1875
    Loading More Posts
    • 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
      rferrazz last edited by

      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 Reply Quote 0
      • R
        rferrazz last edited by

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

        1 Reply Last reply Reply Quote 0
        • First post
          Last post