Qml弹出右侧信息弹窗

右侧信息弹窗使用PropertyAnimation来控制窗体的opacity透明度和Y坐标 就可以实现弹窗效果了

PropertyAnimation{
        id: hideAnimation
        target: subWindow
        properties:"opacity"
        from: 1.0
        to: 0.0
        duration: 300
        onStopped: {
            subWindow.visible = false;
        }
    }

    PropertyAnimation{
        id: downAnimation
        target: subWindow
        properties:"y"
        from: root.y
        to: root.y + 24
        duration: 300
    }

show.gif

需要完整代码请访问QtQuickExamples

你可能感兴趣的:(Qml弹出右侧信息弹窗)