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. Adjust PathView transition time of decrementCurrentIndex, incrementCurrentIndex
Forum Updated to NodeBB v4.3 + New Features

Adjust PathView transition time of decrementCurrentIndex, incrementCurrentIndex

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 2.1k 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

    Is it possible to change the transition time of
    @Keys.onRightPressed: incrementCurrentIndex()
    Keys.onLeftPressed: decrementCurrentIndex()@ ?

    I've got the following PathView:
    @import QtQuick 1.0

    Rectangle {

    id: pageControl
    
    width: 360
    height: 360
    
    ListModel {
        id: appModel
        ListElement { pageColor: "blue" }
        ListElement { pageColor: "green" }
        ListElement { pageColor: "red" }
        ListElement { pageColor: "gray" }
        ListElement { pageColor: "black" }
        ListElement { pageColor: "purple" }
    }
    
    listModel: appModel
    
    property ListModel listModel
    
    Component {
        id: appDelegate
    
        Rectangle {
            smooth: true
            width: pageControl.width
            height: pageControl.height
            color: pageColor
    
        }
    }
    
    PathView {
        id: myPathView
    
        width: parent.width
        anchors.top: parent.top
    
        Keys.onRightPressed: incrementCurrentIndex()
        Keys.onLeftPressed: decrementCurrentIndex()
    
        focus: true
        interactive: true
        model: listModel
        delegate: appDelegate
        path: Path {
            startX: - pageControl.width * listModel.count / 2 + pageControl.width / 2
            startY: pageControl.height / 2
            PathLine {
                x: pageControl.width * listModel.count / 2 + pageControl.width / 2
                y: pageControl.height / 2
            }
        }
    }
    

    }@ (it's a short version of "this":http://www.developer.nokia.com/Community/Wiki/How_to_create_a_Page_Control_component_in_QML example)
    In the wiki example, the flicking is quite slow and it can also be adjusted, but the key events are always quite fast. Is it possible to adjust them?

    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