AppSwitch

An on/off button-like control More...

Import Statement: import VPlayApps 1.0
Inherits:

Item

Properties

Signals

Methods

Detailed Description

This displays a slide-able switch which can be used to toggle some functionality on or off.

It has a checked property, that can be modified by the user, either by sliding the switch to the left (off) or to the right (on), or by simply tapping on it (toggles on/off).

It will emit the signal toggled, when the checked state has changed. By default, the styling of the button is changed to match different platforms.

Property Documentation

backgroundBorderColor : color

The color of the background's border. Matches platform specific values by default.

This QML property was introduced in V-Play 2.7.0.


backgroundBorderWidth : real

The width of the background's border. Matches platform specific values by default.

This QML property was introduced in V-Play 2.7.0.


backgroundColorOff : color

The background color when the switch is off.

This QML property was introduced in V-Play 2.6.2.


backgroundColorOffPressed : color

The background color when the switch is off and pressed.

This QML property was introduced in V-Play 2.6.2.


backgroundColorOn : color

The background color when the switch is on.

This QML property was introduced in V-Play 2.6.2.


backgroundColorOnPressed : color

The background color when the switch is on and pressed.

This QML property was introduced in V-Play 2.6.2.


checked : bool

A Boolean property that determines the off/on state of the switch. Set this property to true or false to change the switch's state.

See also toggle() and setChecked().


dropShadow : bool

Whether the knob should drop a shadow.

This QML property was introduced in V-Play 2.6.2.


knobBorderColor : color

The border color of the knob.

This QML property was introduced in V-Play 2.6.2.


knobBorderWidth : real

The width of the knobs's border. Matches platform specific values by default.

This QML property was introduced in V-Play 2.7.0.


knobColorOff : color

The knob color when the switch is off.

This QML property was introduced in V-Play 2.6.2.


knobColorOn : color

The knob color when the switch is on.

This QML property was introduced in V-Play 2.6.2.


[read-only] pressed : bool

Whether the switch is currently being pressed.

This QML property was introduced in V-Play 2.7.0.


updateChecked : bool

If set to false, the checked property is not changed when this control is toggled. Can be useful if it is bound to some other value.


Signal Documentation

toggled()

Emitted each time the checked state of the switch changes. This is the case when the user toggles the button or it gets set from within your code.


Method Documentation

setChecked(checked)

Call this method to set the current checked state of the switch. This has the same effect as setting the checked property directly.

See also checked and toggle().


toggle()

Call this method to toggle the current checked state of the switch. If the switch is currently off it changes to on and vice-versa.

See also checked and setChecked().


Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support