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

演示

  • 视频讲解

相关内容

热门资讯

黑科技辅助!wepoke透明挂... 黑科技辅助!wepoke透明挂在哪买(透视)软件透明挂ai辅助器(一直真的是有挂)-哔哩哔哩,wep...
黑科技辅助!红龙扑克会作假(透... 黑科技辅助!红龙扑克会作假(透视)软件透明挂ai辅助工具(本来是真的有挂)-哔哩哔哩;最新版2026...
黑科技辅助!wepoke是有挂... 黑科技辅助!wepoke是有挂软件(透视)先前真的是有挂(有挂方式)-哔哩哔哩;1、完成wepoke...
黑科技辅助!红龙扑克辅助器第一... 黑科技辅助!红龙扑克辅助器第一视角(透视)软件透明挂ai辅助器(竟然存在有挂)-哔哩哔哩;黑科技辅助...
黑科技辅助!wepoke真的有... 黑科技辅助!wepoke真的有挂嘛(透视)都是存在有挂(有挂工具)-哔哩哔哩;是一款可以让一直输的玩...
黑科技辅助!德州ai辅助可以打... 黑科技辅助!德州ai辅助可以打(透视)软件透明挂ai辅助软件(素来有挂)-哔哩哔哩;1、让任何用户在...
黑科技辅助!智星菠萝德州辅助器... 黑科技辅助!智星菠萝德州辅助器(透视)原生真的有挂(详细教程)-哔哩哔哩是一款可以让一直输的玩家,快...
黑科技辅助!wpk透视辅助(透... 黑科技辅助!wpk透视辅助(透视)软件透明挂ai辅助安装(原来有挂)-哔哩哔哩;wpk透视辅助是一种...
黑科技辅助!poker外挂(透... 黑科技辅助!poker外挂(透视)素来真的是有挂(有挂详情)-哔哩哔哩;AI辅助机器人普及解说快速成...
黑科技辅助!pokerworl... 黑科技辅助!pokerworld软件(透视)软件透明挂ai辅助安装(竟然真的是有挂)-哔哩哔哩;1、...