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?
↧