写个例子,Busyindicator 默认不显示,点击窗口中任意处显示,再次点击隐藏,以此类推。
import QtQuick
import QtQuick.Controls
import QtQuick.Controls.Material
Window {
width: 640
height: 480
visible: true
title: qsTr("Hello World")
BusyIndicator {
id: busyIndicator
width: 100; height: 100
anchors.centerIn: parent
running: false // 不显示,默认是true显示
}
MouseArea {
anchors.fill: parent
onClicked: {
busyIndicator.running = !busyIndicator.running // 取反
}
}
}