Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

AppSwitch

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

Import Statement: import Felgo 4.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

[since Felgo 2.7.0] backgroundBorderColor : color

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

This property was introduced in Felgo 2.7.0.


[since Felgo 2.7.0] backgroundBorderWidth : real

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

This property was introduced in Felgo 2.7.0.


[since Felgo 2.6.2] backgroundColorOff : color

The background color when the switch is off.

This property was introduced in Felgo 2.6.2.


[since Felgo 2.6.2] backgroundColorOffPressed : color

The background color when the switch is off and pressed.

This property was introduced in Felgo 2.6.2.


[since Felgo 2.6.2] backgroundColorOn : color

The background color when the switch is on.

This property was introduced in Felgo 2.6.2.


[since Felgo 2.6.2] backgroundColorOnPressed : color

The background color when the switch is on and pressed.

This property was introduced in Felgo 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().


[since Felgo 2.6.2] dropShadow : bool

Whether the knob should drop a shadow.

This property was introduced in Felgo 2.6.2.


[since Felgo 2.6.2] knobBorderColor : color

The border color of the knob.

This property was introduced in Felgo 2.6.2.


[since Felgo 2.7.0] knobBorderWidth : real

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

This property was introduced in Felgo 2.7.0.


[since Felgo 2.6.2] knobColorOff : color

The knob color when the switch is off.

This property was introduced in Felgo 2.6.2.


[since Felgo 2.6.2] knobColorOn : color

The knob color when the switch is on.

This property was introduced in Felgo 2.6.2.


[read-only, since Felgo 2.7.0] pressed : bool

Whether the switch is currently being pressed.

This property was introduced in Felgo 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.

Note: The corresponding handler is onToggled.


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().


Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded