QML Switch Element
A switch button with a text label More...
Properties
Detailed Description
The Switch type provides an image button with a text label that can be styled using images and text, and has an on and off state.
Here is a simple Switch:
import QtQuick 1.1
import "components"
Switch {
id: switch1
width: 60
height: 40
on: false
textOff: "Off"
textOn: "On"
textOnBold: false
textOnFontFamily: "Arial"
textOffFontFamily: "Arial"
textOnFontSize: 14
textOffFontSize: 14
imageOn: "images/internal_button_up.bmp"
imageOff: "images/internal_button_dn.bmp"
textOnColor: "#000000"
textOffColor: "#000000"
textOffBold: false
onButtonClick: console.debug(on);
onButtonPress: console.debug(on);
onButtonRelease: console.debug(on);
}
Property Documentation
The height of the switch button.
The source image for the switch off state.
The source image for the switch on state.
A boolean property to determine the state of the switch.
The text for the switch off state.
Determines if the text for the switch off state should be bold.
The color of the text for the switch off state.
textOffFontFamily : string |
The font family of the text for the switch off state.
The font pixel size of the text for the switch off state.
The text for the switch on state.
Determines if the text for the switch on state should be bold.
The color of the text for the switch on state.
textOnFontFamily : string |
The font family of the text for the switch on state.
The font pixel size of the text for the switch on state.
A value that can be assigned to the on state.
The width of the switch button.