Qt wiki will be updated on October 12th 2023 starting at 11:30 AM (EEST) and the maintenance will last around 2-3 hours. During the maintenance the site will be unavailable.
Busy Indicator for QML: Difference between revisions
Jump to navigation
Jump to search
(Copied content from other location to here) |
(Cleanup. Removed outdated code) |
||
Line 1: | Line 1: | ||
{{ | {{LangSwitch}} | ||
[[Category:Snippets]] | [[Category:Snippets]] | ||
[[Category:HowTo]] | [[Category:HowTo]] | ||
[[Category:Developing_with_Qt::Qt Quick]] | [[Category:Developing_with_Qt::Qt Quick]] | ||
[[Category:Developing_with_Qt::Qt Quick::QML]] | [[Category:Developing_with_Qt::Qt Quick::QML]] | ||
QtQuick.Controls 1.3 come with the ''BusyIndicator''. It is a simple and ready to use component. Here is a short example for how to use it: | |||
<code> | <code> | ||
Line 20: | Line 12: | ||
ApplicationWindow { | ApplicationWindow { | ||
title: qsTr("Hello World") | |||
width: 640 | |||
height: 480 | |||
visible: true | |||
BusyIndicator { | |||
id: busyIndication | |||
anchors.centerIn: parent | |||
// 'running' defaults to 'true' | |||
} | |||
Button { | |||
anchors.horizontalCenter: parent.horizontalCenter | |||
anchors.bottom: parent.bottom | |||
text: busyIndication.running ? "Stop Busy Indicator" : "Start Busy Indicator" | |||
checkable: true | |||
checked: busyIndication.running | |||
onClicked: busyIndication.running = !busyIndication.running | |||
} | |||
} | } | ||
</code> | </code> |
Revision as of 10:36, 28 June 2015
QtQuick.Controls 1.3 come with the BusyIndicator. It is a simple and ready to use component. Here is a short example for how to use it:
import QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Window 2.2
ApplicationWindow {
title: qsTr("Hello World")
width: 640
height: 480
visible: true
BusyIndicator {
id: busyIndication
anchors.centerIn: parent
// 'running' defaults to 'true'
}
Button {
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
text: busyIndication.running ? "Stop Busy Indicator" : "Start Busy Indicator"
checkable: true
checked: busyIndication.running
onClicked: busyIndication.running = !busyIndication.running
}
}