Qt Creator Documentation 2.8.0

Contents

QML HorizontalSlider Element

A horizontal slider More...

Properties

Detailed Description

The HorizontalSlider type provides a slider component that can be styled with an image handle and an image track. The component is used for selecting a value in a given range.

Here is a simple HorizontalSlider:

 import QtQuick 1.1
 import "components"

 HorizontalSlider {
     id: slider___horizontal1
     width: 184
     height: 48
     showHint: true
     minimum: 0
     maximum: 10
     value: 0
     allowDrag: true
     xMin: 0
     handleY: 2
     imageTrack: "images/slider_htrack.png"
     imageHandle: "images/slider_handle.png"
     imageOverlay: ""
     hintWidth: 40
     hintHeight: 40
     hintRadius: 9
     hintBorderColor: "#000000"
     hintBorderWidth: 2
     hintBackgroundColor: "#ffffff"
     hintFontFamily: "Arial"
     hintFontColor: "#000000"
     hintFontPixelSize: 16

     onValueChanged: {
         console.debug(value);
     }
 }

Property Documentation

allowDrag : bool

Determines if the slider handle can be dragged by mouse or by touch.


handleY : int

The y position of the handle in relation to the track image.


height : int

The height of the horizontal slider, usually the height of the track image..


hintBackgroundColor : string

The background color of the hint box.


hintBorderColor : string

The border color of the hint box.


hintBorderWidth : string

The border width of the hint box.


hintFontColor : string

The color to use for text of the hint box.


hintFontFamily : string

The font family to use for the text of the hint box.


hintFontPixelSize : string

The pixel size to use for text of the hint box.


hintHeight : int

The height of the hint box.


hintRadius : int

The radius of the hint box. Determines the roundness of the hint box.


hintWidth : int

The width of the hint box.


imageHandle : url

The source image for the slider handle.


imageOverlay : url

The source image for the overlay. This can be left blank in no overlay is needed.


imageTrack : url

The source image for the slider track.


maximum : real

The maximum value for the component.


minimum : real

The minimum value for the component.


showHint : bool

Detrmines if the hint box is shown to inform the user of the current value.


value : real

The current value for the component.


width : int

The width of the horizontal slider, usually the width of the track image.


xMin : int

The minimum x position the handle can go to the left.