Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import QtQuick 2.0
SequentialAnimation {
id: root
property QtObject target
property string fadeProperty: "opacity"
property int fadeDuration: 150
property alias outValue:
property alias inValue:
property alias outEasingType: outAnimation.easing.type
property alias inEasingType: inAnimation.easing.type
property string easingType: "Quad"
NumberAnimation {
id: outAnimation
property: root.fadeProperty
duration: ? root.fadeDuration : 0
to: 0
easing.type: Easing["In"+root.easingType]
PropertyAction { } // actually change the property between the 2 other animations
NumberAnimation {
id: inAnimation
property: root.fadeProperty
duration: ? 0 : root.fadeDuration // the duration seems to be read at the start of the SequentialAnimation or Behavior
to: 1
easing.type: Easing["Out"+root.easingType]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment