Switch QML Type

Switch button that can be toggled on or off. 更多...

导入语句: import QtQuick.Controls .
Since: Qt Quick Ultralite 1.0
继承:

AbstractButton

详细描述

Switch is an option button that can be dragged or toggled on (checked) or off (unchecked). Switches are typically used to select between two states.

Switch inherits its API from AbstractButton . For instance, the state of the switch can be set using the checked 特性。

ColumnLayout {
    Switch {
        text: qsTr("Wi-Fi")
    }
    Switch {
        text: qsTr("Bluetooth")
    }
}
						

另请参阅 Controls Styling and 按钮控件 .