Sailfish OS
  • Info
  • User Experience
  • Cases
  • Community
  • Developers
  • Contact
  • Get Sailfish OS
Select Page
  • Info
  • User Experience
  • Cases
  • Community
  • Developers
  • Contact
  • Get Sailfish OS

API Documentation

Documentation for developing SailfishOS applications
  • API Documentation
  • Libsailfishapp
  • Sailfish Silica
    • Documentation
    • Icon Reference
  • Sailfish Components
    • Sailfish Accounts
    • Sailfish Bluetooth
    • Sailfish Contacts
    • Sailfish Crypto
    • Sailfish Gallery
    • Sailfish Media
    • Sailfish Pickers
    • Sailfish Secrets
    • Sailfish Share
    • Sailfish Telephony
    • Sailfish Webview
    • Amber Web Authorization
    • Amber MPRIS
  • Nemo QML Plugins
    • Configuration
    • Contacts
    • D-Bus
    • Keepalive
    • Notifications
    • Thumbnailer
  • Sailfish Middleware
    • MDM Framework
    • MDM Policy Framework
    • User Manager Daemon
  • API Documentation
  • Libsailfishapp
  • Sailfish Silica
    • Documentation
    • Icon Reference
  • Sailfish Components
    • Sailfish Accounts
    • Sailfish Bluetooth
    • Sailfish Contacts
    • Sailfish Crypto
    • Sailfish Gallery
    • Sailfish Media
    • Sailfish Pickers
    • Sailfish Secrets
    • Sailfish Share
    • Sailfish Telephony
    • Sailfish Webview
    • Amber Web Authorization
    • Amber MPRIS
  • Nemo QML Plugins
    • Configuration
    • Contacts
    • D-Bus
    • Keepalive
    • Notifications
    • Thumbnailer
  • Sailfish Middleware
    • MDM Framework
    • MDM Policy Framework
    • User Manager Daemon

Contents

  • Properties
  • Detailed Description

TextSwitch QML Type

A toggle button with a label More...

Import Statement: import Sailfish.Silica 1.0
Inherited By:

IconTextSwitch

  • List of all members, including inherited members

Properties

  • automaticCheck : bool
  • busy : bool
  • checked : bool
  • description : string
  • down : bool
  • highlighted : bool
  • leftMargin : real
  • rightMargin : real
  • text : string

Detailed Description

The TextSwitch type provides a Sailfish-styled toggle button with a textual label.

Here is a simple TextSwitch:

 import QtQuick 2.2
 import Sailfish.Silica 1.0

 TextSwitch {
     id: activationSwitch
     text: "Active"
     description: "Activates the Doomsday device"
     onCheckedChanged: {
         device.setStatus(checked ? DeviceState.Armed : DeviceState.Disarmed)
     }
 }

TextSwitch inherits the MouseArea type, so any properties, signals and methods of MouseArea are also available to TextSwitch objects. See the MouseArea documentation for its full list of available properties, signals and methods.

See also Switch and Label.

Property Documentation

automaticCheck : bool

If true, the TextSwitch is automatically toggled between the checked and unchecked states when clicked. The default value is true.

If automaticCheck is false, the user must handle the clicked() signal and set the value of checked appropriately. This is primarily useful when the switch is connected to an external state that cannot be simply bound to the checked properly.

See also checked.


busy : bool

This property holds whether the TextSwitch is in a busy state. When busy the indicator will flash and the TextSwitch will be disabled. The busy state is useful when applying a change to a setting does not happen instantaneously.


checked : bool

This property holds whether the TextSwitch is checked. If automaticCheck is true, clicking on the switch toggles checked between true and false.

See also automaticCheck.


description : string

Optional text to describe the purpose of the switch.


down : bool

This property is true while the button is pressed and the touch position remains within the button area.


highlighted : bool

This property determines whether the switch is shown highlighted. By default it is bound to down.


leftMargin : real

The margins between the left and right edges of the switch and its contents. The default value is Theme.horizontalPageMargin.


rightMargin : real

The margins between the left and right edges of the switch and its contents. The default value is Theme.horizontalPageMargin.


text : string

The text shown alongside the check status indicator.


  • Legal
  • Contact Us
  • Jolla Mobile Ltd © 2025

  • Facebook
  • Twitter
  • Mastodon
  • YouTube
  • LinkedIn