[QML开发笔记]-QML Canvas绘制数字时钟
/**
* @projectName QMLCircleDigitClock
* @brief Description
* @author Kongdemin
* @date 2021-04-18
*/
import QtQuick 2.12
import QtQuick.Window 2.12
Window {
visible: true
width: 500
height: 500
title: qsTr("QML Canvas绘制数字时钟")
Rectangle {
id: circleDigitClock
anchors.fill: parent
Canvas {
id: canvas
anchors.fill: parent
property var now : new Date()
onPaint: {
var today = now.toDateString()
var time = now.toLocaleTimeString()
var hrs = now.getHours()