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

演示

  • 视频讲解

相关内容

热门资讯

第八分钟辅助!德州ai机器人免... 第八分钟辅助!德州ai机器人免费测试(德州之星)外挂辅助神器软件(AI辅助)(2022已更新)-哔哩...
黑科技游戏!红龙扑克是不是有问... WePoker透视辅助工具核心要点解析‌,黑科技游戏!红龙扑克是不是有问题,德扑软件决策,一直真的有...
黑科技新版!红龙扑克辅助器下载... 黑科技新版!红龙扑克辅助器下载,fishpoker下载,固有是有挂(2023已更新)-哔哩哔哩是一款...
6分钟辅助!wepower德州... 6分钟辅助!wepower德州辅助器(德州之星)外挂辅助神器软件(AI辅助)(2024已更新)-哔哩...
黑科技教程!智星德州菠萝怎么开... 1、黑科技教程!智星德州菠萝怎么开挂,德扑之星攻略,从来有挂(2026已更新)-哔哩哔哩;详细教程。...
第六分钟辅助!德州ai智能系统... 第六分钟辅助!德州ai智能系统(德州)外挂辅助神器软件(AI辅助)(2026已更新)-哔哩哔哩1、起...
黑科技ai!红龙扑克机制,德扑... 黑科技ai!红龙扑克机制,德扑之星怎么设置,本然真的是有挂(2020已更新)-哔哩哔哩是一款可以让一...
第2分钟辅助!德州最新辅助器(... 第2分钟辅助!德州最新辅助器(德州)外挂辅助神器软件(AI辅助)(2023已更新)-哔哩哔哩1、该软...
黑科技辅助!智星菠萝德州有挂吗... 黑科技辅助!智星菠萝德州有挂吗,pokermastersteam外挂,起初存在有挂(2026已更新)...
第6分钟辅助!德州之星有辅助挂... 第6分钟辅助!德州之星有辅助挂(德州)外挂辅助神器软件(AI辅助)(2023已更新)-哔哩哔哩;暗藏...