Busy Indicator for QML: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
(Redirected page to Busy-Indicator-for-QML)
(Sub-categorize)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
#REDIRECT [[Busy-Indicator-for-QML]]
{{LangSwitch}}
[[Category:Snippets::QML]]
[[Category:HowTo]]
[[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>
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
    }
}
</code>

Latest revision as of 12:30, 28 November 2016

En Ar Bg De El Es Fa Fi Fr Hi Hu It Ja Kn Ko Ms Nl Pl Pt Ru Sq Th Tr Uk Zh

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
    }
}