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. Animation does not finish when slot is called in onRunningChanged
Forum Updated to NodeBB v4.3 + New Features

Animation does not finish when slot is called in onRunningChanged

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 976 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.
  • E Offline
    E Offline
    ephe
    wrote on last edited by
    #1

    I've got a GridView which shows 9 items at once.
    When a MouseArea is clicked, the next 9 items should be shown. I've got this animation:
    @
    NumberAnimation { id: anim; target: gridview; property: "contentX"; duration: 500; onRunningChanged: if(!running) {console.log("contx: " + gridview.contentX); myModel.mySlot()} }
    @
    (I got the code for the animation from here: "Animate ListView positionViewAtIndex":http://www.qtcentre.org/archive/index.php/t-40680.html?s=3e249e34a7442da1d062a550aecade69)

    The animation is working fine when I don't call myModel.mySlot().

    When I call this slot (it just sleeps for 1000 ms in the example code), it seems that the animation does not finish. Then the view jumps a bit to position the view correctly.

    Here is a link to my project (it is a modified version of the abstractitemmodel example): "zip file":http://dl.dropbox.com/u/2346027/abstractitemmodel.zip

    Can somebody tell me what I'm doing wrong? I'm using Qt 4.8. Thank you!

    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