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、超多福利:超高返利...
脚本详情!wpk辅助器,wpk... 脚本详情!wpk辅助器,wpk德州局怎么透视(透视)好像是真的软件(哔哩哔哩)1、德州局怎么透视破解...
透视分享!wejoker透视方... 透视分享!wejoker透视方法,wepoker黑侠辅助器(透视)都是真的有脚本(哔哩哔哩)1、用户...
脚本关于!wpk辅助购买,wp... 脚本关于!wpk辅助购买,wpk模拟器(透视)都是真的是有神器(哔哩哔哩)1、每一步都需要思考,不同...
脚本教你!aapoker真的假... 脚本教你!aapoker真的假的,aapoker发牌逻辑(透视)都是真的是有软件(哔哩哔哩)1、辅助...
脚本曝光!wpk俱乐部是真的吗... 脚本曝光!wpk俱乐部是真的吗,wpk透视辅助方法(透视)确实是有器(哔哩哔哩)1、每一步都需要思考...
透视辅助!aapoker插件,... 透视辅助!aapoker插件,aapoker透视怎么用(透视)原来是有方法(哔哩哔哩)暗藏猫腻,小编...
透视揭露!hhpoker哪个俱... 透视揭露!hhpoker哪个俱乐部靠谱,hhpoker透视脚本(透视)都是有攻略(哔哩哔哩)1、透视...
透视专业!wepoker辅助器... 透视专业!wepoker辅助器有哪些功能,wepokerplus辅助(透视)本来是有软件(哔哩哔哩)...