本页内容

TimeoutTransition QML Type

TimeoutTransition 类型提供了一种基于定时器的过渡效果。更多内容...

Import Statement: import QtQml.StateMachine 6.12
Inherits:

QSignalTransition

属性

详细说明

Timer 该类型可与SignalTransition 结合使用,以实现更复杂的基于超时的过渡效果。

TimeoutTransition是Qt State Machine QML API的一部分

使用示例

import QtQuick
import QtQml.StateMachine as DSM

Rectangle {
    Button {
        anchors.fill: parent
        id: button
        text: "Finish state"
        enabled: !stateMachine.running
        onClicked: stateMachine.running = true
        DSM.StateMachine {
            id: stateMachine
            initialState: state
            running: true
            DSM.State {
                id: state
                DSM.TimeoutTransition {
                    targetState: finalState
                    timeout: 1000
                }
            }
            DSM.FinalState {
                id: finalState
            }
        }
    }
}

另请参阅 StateMachine 、SignalTransition 、FinalState 以及HistoryState 。

属性文档

timeout : int

以毫秒为单位的超时间隔。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.