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. Pathview, no way to detect that animation in progress

Pathview, no way to detect that animation in progress

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 144 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.
  • A Offline
    A Offline
    Artur Temirkhanov
    wrote on last edited by
    #1

    Hi all,
    I need to bind some logic to PathView animation. The problem is, there's no property for this.
    Consider the next code:

    import QtQuick 2.12
    import QtQuick.Window 2.12
    
    Window {
        visible: true
        width: 640
        height: 480
        PathView {
            id: _view
            anchors.fill: parent
            model: ListModel {
                id: _myList
                ListElement { qwe: "red" }
                ListElement { qwe: "green" }
                ListElement { qwe: "blue" }
            }
            delegate: Rectangle {
                width: 100;
                height: 50;
                color: qwe
                border.width: PathView.isCurrentItem ? 3 : 0
            }
            onMovingChanged: {
                console.log("moving: " + moving)
            }
            onFlickingChanged: {
                console.log("flicking: " + flicking)
            }
    
            path: Path {
                startX: 120; startY: 100
                PathQuad { x: 120; y: 25; controlX: 260; controlY: 75 }
                PathQuad { x: 120; y: 100; controlX: -20; controlY: 75 }
            }
        }
    
        Timer {
            interval: 3000;
            repeat: true
            running: true
            onTriggered: {
                _view.incrementCurrentIndex();
            }
        }
    }
    
    

    incrementCurrentIndex or direct assignment to currentIndex any value doesn't lead any indication that view actually in motion.
    Could you help to catch the end of animation? onMovingChanged and onFlickingChanged doesn't help.

    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