Switch QML Type | Qt Quick Controls 1 5.15.19 (original) (raw)

A switch. More...

Import Statement: import QtQuick.Controls 1.4
Since: Qt 5.2
Inherits: FocusScope

Properties

Signals

Detailed Description

On and Off states of a Switch.

A Switch is a toggle button that can be switched on (checked) or off (unchecked). Switches are typically used to represent features in an application that can be enabled or disabled without affecting others.

On mobile platforms, switches are commonly used to enable or disable features.

You can create a custom appearance for a Switch by assigning a SwitchStyle.

Property Documentation

activeFocusOnPress : bool

This property is true if the control takes the focus when it is pressed; forceActiveFocus() will be called on the control.

This property is true if the control is checked. The default value is false.

[read-only] pressed : bool

This property is true when the control is pressed.

This property was introduced in QtQuick.Controls 1.3.

Signal Documentation

This signal is emitted when the control is clicked.

Note: The corresponding handler is onClicked.

This signal was introduced in QtQuick.Controls 1.3.

© 2025 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.