Qt World Summit: Register Today!

Repeater is not refreshed after changing model

  • I use repeater for creating charts. I created a plugin on C++ for drawing lines in this charts and by click on button I am calling javascript function that updates repeater's model. But I can not see any update of the sreen with chart.

    What can be wrong?

    Thank you for your help!

  • A skeleton code will be helpful to provide a solution. By the way, try property binding on model property.

  • I have already find the answer and this thread was helpful : http://developer.qt.nokia.com/forums/viewthread/4939

    I find that it's not a problem of Repeater QML Element. I is bug of mine custom Line Element. Then i am set start and end points of line I am do not set width and hieght and so QDeclarativeItem’s boundingRect do not know what area needs to be repainted when update() is called for the element.
    I find two ways to fix this
    1 (good) set width and height
    2 (evil) call setViewportUpdateMode(QGraphicsView::FullViewportUpdate) somethere

    Thank you, srikanthsombhatla, anyway!

Log in to reply