Do you want the first image to disappear in another? How about placing two Image objects on top of each other, animate the opacity property?
EDIT: This worked for me (I am using QtQuick 1.0 because my Qt Creator installation is a bit outdated):
import QtQuick 1.0 Rectangle { Image { id: rect source: "quit.png" smooth: true opacity: 1 MouseArea { id: mouseArea anchors.fill: parent anchors.margins: -10 hoverEnabled: true //this line will enable mouseArea.containsMouse onClicked: Qt.quit() } states: State { name: "mouse-over"; when: mouseArea.containsMouse PropertyChanges { target: rect; scale: 0.8; opacity: 0} PropertyChanges { target: rect2; scale: 0.8; opacity: 1} } transitions: Transition { NumberAnimation { properties: "scale, opacity"; easing.type: Easing.InOutQuad; duration: 1000 } } } Image { id: rect2 source: "quit2.png" smooth: true opacity: 0 anchors.fill: rect } }
To the question in your comment: you can place the image exactly on top of another by copying the anchors through anchors.fill: rect
teukkam
source share