Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Slider component example using Qt Quick

From Wiki
Jump to: navigation, search

This article explains how to use the QML slider with start and stop Button. The example uses a timer to run the slider and buttons are used to start and stop the slider.

Article Metadata
Code Example
Installation file: N/A
Tested with
SDK: Qt SDK 1.1.4
Devices(s): Emulator
Compatibility
Platform(s): Symbian and Meego
Device(s): Symbian device with Qt and Meego
Dependencies: None
Platform Security
Signing Required: Selfsign
Capabilities: None
Article
Keywords: Slider
Created: kkrish (23 Feb 2012)
Last edited: hamishwillee (30 May 2013)


Code snippets

    Slider {
id: slider
maximumValue: 30
minimumValue: 0
stepSize: 1
value: 1
valueIndicatorVisible: true
anchors.centerIn: parent
}
 
Timer{
id: slidTimer
interval: 1000
running: false
repeat: true
onTriggered: {
console.log("slider.value : " + slider.value )
slider.value = slider.value + 1
}
}
 
Button{
id: startBtn
anchors.top: parent.top
anchors.horizontalCenter: parent.horizontalCenter
text: "Start"
onClicked: {
if(startBtn.text == "Start"){
slidTimer.start();
startBtn.text = "Stop"
}
else{
slidTimer.stop();
startBtn.text = "Start"
}
}
}
This page was last modified on 30 May 2013, at 06:39.
58 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×