Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

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

    QML and Qt Quick
    1
    1
    517
    Loading More Posts
    • 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
      RazZziel last edited by

      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 Reply Quote 0
      • First post
        Last post