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. StackViewTransition rotation on "y" axis (StackView + page flip)
Forum Updated to NodeBB v4.3 + New Features

StackViewTransition rotation on "y" axis (StackView + page flip)

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

    I have a StackView that I use to display slides. When to set each slide, and what slide to set, must be commanded by C++ code, so I don't have a state machine, just a signal from C++ every time I need to set a new slide, and a slot in QML that runs a push() in the StackView.

    This is working fine, and I'm able to implement simple transitions when changing slides:

            StackView {
                id: loader
                anchors.fill: parent
    
                delegate: StackViewDelegate {
                    function transitionFinished(properties) {
                        properties.exitItem.x = 0
                    }
    
                    pushTransition: StackViewTransition {
                        PropertyAnimation {
                            target: enterItem
                            property: "x"
                            from: enterItem.width
                            to: 0
                            easing.type: Easing.OutExpo
                        }
    
                        PropertyAnimation {
                            target: exitItem
                            property: "x"
                            from: 0
                            to: -exitItem.width
                            easing.type: Easing.OutExpo
                        }
                    }
                }
            }
    

    But I'm stuck, for instance, trying to replace the displacement on "x" animation, with a rotation on the "y" axis, simulating a page flip.

    I've seen an example here, but I don't really understand how to apply that to a StackViewTransition, because that works between two states of a single component, rather than the replacement of a component with another.

    What would be the correct way to implement it a page flip on a StackView?

    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