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

演示

  • 视频讲解

相关内容

热门资讯

26年最新开挂版!南通长牌辅助... 26年最新开挂版!南通长牌辅助透视挂,山水云南麻将存在有外挂,竟然真的有挂一、南通长牌游戏安装教程牌...
26年最新开挂版!雀悦辅助透视... 26年最新开挂版!雀悦辅助透视挂,杭州麻将真的有外挂,其实新版有挂;1、雀悦模拟器是什么优化,雀悦俱...
26年最新开挂版!乐斗小院辅助... 26年最新开挂版!乐斗小院辅助透视挂,鹰潭麻将存在有外挂,一贯真的有挂1、超多福利:超高返利,海量正...
26年最新开挂版!兴动荆卫游戏... 26年最新开挂版!兴动荆卫游戏辅助透视挂,多乐红中麻将真的是有外挂,一直真是有挂1、完成兴动荆卫游戏...
26年最新开挂版!宝龙互娱辅助... 26年最新开挂版!宝龙互娱辅助透视挂,九九山城麻将确实有外挂,都是有挂透明挂1、九九山城麻将模拟器是...
26年最新开挂版!鸿运阁辅助透... 26年最新开挂版!鸿运阁辅助透视挂,指牌屋亲友版确实有外挂,总是有挂解惑1、打开软件启动之后找到中间...
26年最新开挂版!明星麻将辅助... 26年最新开挂版!明星麻将辅助透视挂,广东闲来麻将是有外挂,本来果真有挂1、操作简单,无需明星麻将手...
26年最新开挂版!天天乐棋牌辅... 26年最新开挂版!天天乐棋牌辅助透视挂,杭州都莱真的有外挂,好像有挂规律1、每一步都需要思考,不同水...
26年最新开挂版!微信链接三公... 26年最新开挂版!微信链接三公辅助透视挂,17好友麻将是有外挂,确实有挂头条1、让任何用户在无需微信...
26年最新开挂版!红十游戏辅助... 26年最新开挂版!红十游戏辅助透视挂,微乐山西麻将真的有外挂,真是有挂秘籍1、26年最新开挂版!红十...