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 not working.

StackViewTransition not working.

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

    I wrote my custom stackView transitions which are :

    • PopTransition
    • PushTransition

    if i push something into the stack the transition works fine, same applies to popping out somthing.


    Now my problem comes here:


    According to documentation, i should be able to use the replace method with the transition that i want.
    E.g :
    stack.replace(aboutComponent, StackView.PopTransition)

    Which is not working for me.

    1 Reply Last reply
    0
    • jpnurmiJ Offline
      jpnurmiJ Offline
      jpnurmi
      wrote on last edited by
      #2

      Please elaborate what "not working" means in practice, and provide a minimal test case that reproduces the problem you are experiencing. The following example, based on the example in the linked documentation, works fine with Qt 5.9.2 at least.

      import QtQuick 2.9
      import QtQuick.Controls 2.2
      
      ApplicationWindow {
          id: window
          width: 360
          height: 360
          visible: true
      
          StackView {
              id: stackView
              anchors.fill: parent
      
              pushExit: Transition { NumberAnimation { property: "scale"; from: 1.0; to: 0.0; duration: 100 } }
              pushEnter: Transition { NumberAnimation { property: "scale"; from: 0.0; to: 1.0; duration: 400 } }
      
              popExit: Transition { NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; duration: 100 } }
              popEnter: Transition { NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; duration: 400 } }
      
              initialItem: Component {
                  id: page
      
                  Page {
                      Column {
                          spacing: 20
                          anchors.centerIn: parent
      
                          Button {
                              text: "Replace\n(default)"
                              onClicked: stackView.replace(page)
                          }
                          Button {
                              text: "Replace\n(push/scale)"
                              onClicked: stackView.replace(page, StackView.PushTransition)
                          }
                          Button {
                              text: "Replace\n(pop/opacity)"
                              onClicked: stackView.replace(page, StackView.PopTransition)
                          }
                      }
                  }
              }
          }
      }
      
      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved