我用Flipable做两个
界面的反转动画,
Flipable.qml 和a.qml 和 b.qml
但是现在发现两个
问题第一个:翻转到b.qml的时候,a里面的
button(鼠标
事件)和
TextField和combox,效果依然存在,导致b里面的TextField和combox会失灵,不能点击,不能输入。
第二个:我给a.qml内的一个
按钮写了一个点击后移动位置的动画,单独运行a是正常的,运行Flipable.qml的时候,就失灵了,点击完全没反应
Flipable.qml
- import QtQuick 2.0
- import QtQuick.Controls 1.0
- import QtQuick.Controls.Styles 1.1
- import QtGraphicalEffects 1.0
- import QtQuick.Window 2.1
- Window{
- maximumWidth : 380
- maximumHeight : 280
- minimumWidth : 380
- minimumHeight : 280
- Flipable {
- id: flipable
- anchors.fill: parent
- anchors.top: parent.top
- anchors.left: parent.left
- property bool flipped: false
- front: Login { anchors.centerIn: parent }
- back: Registration { anchors.centerIn: parent }
- transform: Rotation {
- id: rotation
- origin.x: flipable.width/2
- origin.y: flipable.height/2
- axis.x: 0; axis.y: 1; axis.z: 0
- angle: 0
- }
- states: State {
- name: "back"
- PropertyChanges { target: rotation; angle: 180 }
- when: flipable.flipped
- }
- transitions: Transition {
- NumberAnimation { target: rotation; property: "angle"; duration: 500 }
- }
- }
- }
a.qml和b.qml
里面就是一些
Button,
ComboBox(可输入的那种),TextField