Busy Indicator for QML/de

From Qt Wiki
< Busy Indicator for QML
Revision as of 07:20, 2 March 2015 by Maintenance script (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


[toc align_right="yes" depth="4"]

Deutsch | English

Busy Indicator

Die QtQuick.Controls 1.3 bringen den BusyIndicator mit. Es ist eine fertige, einfach zu benutzende Komponente. Im folgenden wird ein Beispiel-Schnipsel gegeben, der ihre Verwendung demonstriert. Weitere Informationen finden sich in der "Dokumentation":http://doc.qt.io/qt-5/qml-qtquick-controls-busyindicator.html .

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