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. [Solved]Any example of StackView?
Forum Updated to NodeBB v4.3 + New Features

[Solved]Any example of StackView?

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 1 Posters 1.5k 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.
  • S Offline
    S Offline
    stereomatching
    wrote on last edited by
    #1

    Qt5.2

    Studying StackView but have no idea how to use it.

    @
    import QtQuick 2.2
    import QtQuick.Controls 1.1

    Rectangle {
    id: root

    width: 360
    height: 360
    
    Column{
    
        Button{
            width: root.width
            height: root.height / 10
    
            onClicked: {
                stackView.push({item:Rectangle, properties: {width: root.width, height: root.height}})
            }
        }
    
        StackView {
            id: stackView
            delegate: StackViewDelegate {
                function transitionFinished(properties)
                {
                    properties.exitItem.opacity = 1
                }
    
                property Component pushTransition: StackViewTransition {
                    PropertyAnimation {
                        target: enterItem
                        property: "opacity"
                        from: 0
                        to: 1
                    }
                    PropertyAnimation {
                        target: exitItem
                        property: "opacity"
                        from: 1
                        to: 0
                    }
                }
            }
        }
    }
    

    }

    @

    Apparently, this wouldn't work
    After I click the button, it pop out the error message

    Error:Could not load: file///someaddress/[object Object]:-1 File not found

    How could I push the component into the StackView properly?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      stereomatching
      wrote on last edited by
      #2

      I find an example by myself

      "example":http://qt-project.org/doc/qt-5.1/qtquickcontrols/touch-main-qml.html

      If you know more examples of StackView, please show me, thanks.

      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