Qt Creator Documentation 2.8.0

Contents

QML LEDLight Element

A control that has two states on and off. More...

Properties

Detailed Description

The LEDLight type provides a visual on and off state much like an LED light. The control has an on and off state that is styled with two images and text.

 import QtQuick 1.1
 import "components"

 // Here is a simple animated switch using 2 images:

 LEDLight {
     id: led_light1
     x: 291
     y: 148
     width: 60
     height: 60
     on: false
     font.pixelSize: 12
     textColor: "#000000"
     textPosition: "bottom"
     label: "Label"
     fieldSpacing: 6
     font.bold: false
     font.family: "Arial"
     imageOff: "images/ledoff.png"
     imageOn: "images/ledon.png"

     onOnChanged: {
         console.debug(on);
     }
 }

Property Documentation

filedSpacing : int

The spacing between the label and the images.


font : font

The font properties of the text label.


imageOff : url

The source image for the off state.


imageOn : url

The source image for the on state.


label : string

The text to display for the light.


on : bool

Determines if the light is on or off.


textColor : color

The color of the text label.


textPosition : font

The text popsition of the label in relation to the image. The options are bottom, top, left and right.


width : int

The width of the control, usually the width of the images used.