0
我想有一個應用程序,其中總是當新圖像加載時,它通過從0大小縮放到默認大小出現。此行爲通常不起作用。在這張圖片中,我還使用鼠標進入圖像時彈跳的動畫。這可能是因爲這兩個動畫不適合自己,那就是爲什麼擴大規模通常不起作用?行爲規模經常不起作用
我使用Linux Mint的13,Qt的5.3
這裏是我的圖片元素:
所有的Image {
id: pic1
width: appWindow.height*0.4
height: appWindow.height*0.4
smooth: { enabled = true
pic1MouseArea.containsMouse
}
states: [ "mouseIn", "mouseOut" ]
state: "mouseOut"
transitions: [
Transition {
from: "*"
to: "mouseIn"
NumberAnimation {
target: pic1
properties: "scale"
from: 0.95
to: 1
duration: 400
easing.type: Easing.OutBounce
}
}
]
scale: {
status === Image.Ready ? 1 : 0
}
Behavior on scale {
NumberAnimation{
from: 0
to: 1
duration: 1000
easing.type: Easing.OutBounce
}
}
MouseArea{
id: pic1MouseArea
hoverEnabled: true
anchors.fill: parent
onContainsMouseChanged: {
pic1.state = containsMouse ? "mouseIn" : "mouseOut"
}
onClicked: {
MyScript.getRandomFile()
}
}
}