Qt Creator Documentation 2.8.0

Contents

QML Spedometer Element

A meter that has a rotating needle. More...

Properties

Detailed Description

The Spedometer type provides a visual meter that is styled using images.

Here is a simple Spedometer:

 import QtQuick 1.1
 import "components"

 Spedometer {
     id: spedometer1
     width: 210
     height: 210
     needleImage: "images/needle.png"
     overlayImageHeight: 105
     min: 0
     needleImageHeight: 63
     overlayImage: "images/overlay.png"
     value: 20
     needleImageWidth: 8
     max: 120
     needleRotationY: 65
     needleRotationX: 5
     maxAngle: 133
     overlayY: 18
     overlayImageWidth: 148
     overlayX: 21
     needleY: 33
     needleX: 98
     backgroundImage: "images/meterbackground.png"

     onValueChanged: console.debug(value);
 }

Property Documentation

backgroundImage : url

The source image for the spedometer's background.


height : int

The height of the spedometer, usually the height of the background image.


max : int

The maximum value for the meter.


maxAngle : int

The maximum angle the needle can rotate.


min : int

The minimum value for the meter.


minAngle : int

The minimum angle the needle can rotate.


needleImage : url

The source image for the spedometer's needle image.


needleImageHeight : int

The height of the needle image.


needleImageWidth : int

The width of the needle image.


needleRotationX : int

The x position of the needle image that the needle will rotate through.


needleRotationY : int

The y position of the needle image that the needle will rotate through.


needleX : int

The x position of the needle image.


needleY : int

The y position of the needle image.


overlayImage : url

The source image for the spedometer's overlay image.


overlayImageHeight : int

The height of the overlay image.


overlayImageWidth : int

The width of the overlay image.


overlayX : int

The x position of the overlay image.


overlayY : int

The y position of the overlay image.


value : int

The current value for the meter.


width : int

The width of the spedometer, usually the width of the background image.