Qt/QML学习-BusyIndicator
创始人
2025-01-09 07:04:11
0

QML学习

  • BusyIndicator例程
  • 视频讲解
  • 代码

main.qml

import QtQuick 2.15 import QtQuick.Window 2.15 import QtQuick.Controls 2.15  Window {     width: 640     height: 480     visible: true     title: qsTr("Hello World")      BusyIndicator {         id: busyIndicator         anchors.fill: parent         MouseArea {             anchors.fill: parent             onClicked: {                 busyIndicator.running = busyIndicator.running? false: true             }         }          background: Rectangle {             id: backgroundRect             color: "transparent"         }          contentItem: Item {             Rectangle {                 anchors.centerIn: parent                 width: parent.width < parent.height? parent.width / 4 * 3: parent.height / 4 * 3                 height: width                 color: backgroundRect.color                 radius: height / 2                 border.width: height / 12             }              Canvas {                 id: canvas                 anchors.centerIn: parent                 width: parent.width < parent.height? parent.width / 4 * 3: parent.height / 4 * 3                 height: width                 property real angle: 0                 onPaint: {                     rotate()                 }                 function rotate() {                     var ctx = getContext('2d')                     ctx.clearRect(0, 0, canvas.width, canvas.height)                     ctx.beginPath()                     ctx.arc(width/2, height/2, height/2-height/12/2, canvas.angle, canvas.angle + Math.PI * 2 / 12, false)                     ctx.lineWidth = height / 12                     ctx.strokeStyle = "red"                     ctx.stroke()                     requestAnimationFrame(rotate)                 }                 Timer {                     repeat: true                     interval: 25                     onTriggered: {                         canvas.angle += Math.PI * 2 / 24                     }                     running: busyIndicator.running                 }             }         }     } } 

演示

  • 视频讲解

相关内容

热门资讯

十分钟下载链接!wpk辅助软件... 十分钟下载链接!wpk辅助软件,如何判断wpk辅助软件的真假,详细教程(有挂安装)1、这是跨平台的w...
四分钟开辅助器!aapoker... 四分钟开辅助器!aapoker辅助插件工具(透视辅助)详细辅助作弊(一直存在有挂)aapoker辅助...
五分钟私人局规律!we-pok... 五分钟私人局规律!we-poker软件(透视底牌)详细辅助app(原来存在有挂);1、首先打开we-...
六分钟模拟器!HH平台挂,hh... 六分钟模拟器!HH平台挂,hhpoker必备开挂,详细教程(有挂辅助)1、六分钟模拟器!HH平台挂,...
三分钟辅助挂!wpk真的有透视... 三分钟辅助挂!wpk真的有透视嘛,wpk透视辅助方法,详细教程(有挂软件);运wpk透视辅助方法辅助...
三分钟插件!aapoker插件... 三分钟插件!aapoker插件下载,aapoker公共底牌,详细教程(有挂技巧);1、aapoker...
二分钟私人局开挂!wepoke... 二分钟私人局开挂!wepoker数据分析工具(透视底牌)详细辅助教程(一直真的有挂)wepoker数...
三分钟智能!hhpoker俱乐... 三分钟智能!hhpoker俱乐部是干嘛的,hhpoker有后台操控吗,详细教程(有挂外挂);1、hh...
六分钟开辅助器!aapoker... 六分钟开辅助器!aapoker ai插件,aapoker公共底牌,详细教程(有挂软件)1、玩家可以在...
二分钟俱乐部作弊!wpk辅助哪... 二分钟俱乐部作弊!wpk辅助哪里买(透视辅助)详细辅助工具(好像是有挂)1、wpk辅助ai机器人多个...