当前位置: 首页 > news >正文

哪些网站可以做花店推广win7优化教程

哪些网站可以做花店推广,win7优化教程,动态ip做网站,武汉网站制作多少钱1. 说明 在自定义时钟组件时,使用到的基本控件主要是Canvas,在绘制相关元素时有两种方式:一种时在同一个canvas中绘制所有的部件元素,这样需要不断的对画笔和画布的属性进行保存和恢复,容易混乱;另一种就是…

1. 说明

在自定义时钟组件时,使用到的基本控件主要是Canvas,在绘制相关元素时有两种方式:一种时在同一个canvas中绘制所有的部件元素,这样需要不断的对画笔和画布的属性进行保存和恢复,容易混乱;另一种就是创建多个canvas组件,每一部分的元素绘制都在各自的画布进行绘制,逻辑比较清晰,但是canvas组件会相对较多,本文使用的是第二种方式。
效果展示:
在这里插入图片描述

2. 整体代码

import QtQuick 2.15
import QtQuick.Controls 2.15Item{id:rootimplicitWidth: 400implicitHeight: implicitWidth// 尺寸属性property real outerCircleRadius:root.width / 2.05property real innerCircleRadius:root.width / 2.05// 颜色属性property color bgColor:"white"property color outerColor:"black"property color innerColor:"black"property color innerRootColor:"lightSlateGray"property color innerLineColorL:"#484D58"property color innerLineColorS:"#63677A"property color textColor:"black"property color hourLineColor:"#484D58"property color minuteLineColor:"#484D58"property color secondLineColor:"red"property color timeTxtColor:"black"// 时间属性property var hoursproperty var minutesproperty var secondsproperty var currentTimeproperty alias hoursAngle:hourLine.angleproperty alias minutesAngle:minuteLine.angleproperty alias secondsAngle:secondLine.angle// 组件加载完成后先初始化当前时间Component.onCompleted: {calculateAngle()}// 时间计算function calculateAngle(){var date = new Date()hours = date.getHours()// 模除得到12小时制的小时数hours = hours % 12minutes = date.getMinutes()seconds = date.getUTCSeconds()currentTime = hours + ":" + minutes + ":" + secondshoursAngle = Math.PI*2/12*hours+Math.PI*2*minutes/12/60-Math.PIminutesAngle = Math.PI*2*minutes/60 + Math.PI*2*seconds/60/60 -Math.PIsecondsAngle = Math.PI*2*seconds/60-Math.PI}// 绘制背景Canvas{id:bgCirclewidth: root.widthheight: root.heightanchors.centerIn: parentonPaint: {// 绘制背景var ctx = getContext("2d")  ctx.save()ctx.lineWidth = root.width/50   ctx.fillStyle = bgColorctx.beginPath()ctx.arc(root.width/2,root.height/2,outerCircleRadius,0,Math.PI * (12/6))ctx.fill()ctx.restore()}}// 绘制圆环轮廓Canvas{id:outerCirclewidth: root.widthheight: root.heightanchors.centerIn: parentonPaint: {var ctx = getContext("2d")  //创建画师//为画师创建画笔并设置画笔属性ctx.lineWidth = root.width/50   //设置画笔粗细ctx.strokeStyle = outerColor    //设置画笔颜色ctx.beginPath()     //每次绘制调用此函数,重新设置一个路径// 按照钟表刻度进行划分,一圈是Math.PI * 2,分成12个刻度,每个刻度占用 1/6// canvas绘制圆弧,是按照顺时针绘制,起点默认在三点钟方向ctx.arc(root.width/2,root.height/2,outerCircleRadius,0,Math.PI * (12/6))ctx.stroke()    //根据strokeStyle对边框进行描绘}}// 绘制圆环内衬Canvas{id:innerCirclewidth: root.widthheight: root.heightanchors.centerIn: parentproperty real endAngle:Math.PI * (12/6)onPaint: {var ctx = getContext("2d")  ctx.save()ctx.lineWidth = root.width/50   ctx.strokeStyle = innerColor     ctx.beginPath()     ctx.arc(root.width/2,root.height/2,innerCircleRadius,0,endAngle)ctx.stroke()    ctx.restore()// 绘制指针根部圆圈ctx.save()ctx.lineWidth = root.width/50   ctx.fillStyle = innerRootColorctx.beginPath()ctx.arc(root.width/2,root.height/2,innerCircleRadius/16,0,endAngle)ctx.fill()ctx.restore()}}// 绘制刻度线Canvas{id:innerLinewidth: root.widthheight: root.heightanchors.centerIn: parentproperty real lineNums:60onPaint: {var ctx = getContext("2d")  for (var i = 0; i <= lineNums; ++i){ctx.beginPath();var angle = 2 * Math.PI / 60 * i;var dx = Math.cos(angle)*(outerCircleRadius-15);var dy = Math.sin(angle)*(outerCircleRadius-15);var dx2 = Math.cos(angle)*(outerCircleRadius-7);var dy2 = Math.sin(angle)*(outerCircleRadius-7);if (i % 5 === 0){ctx.lineWidth = root.width/100ctx.strokeStyle = innerLineColorL}else{ctx.lineWidth = root.width/200ctx.strokeStyle = innerLineColorS}ctx.moveTo(root.width/2+dx,root.height/2+dy);ctx.lineTo(root.width/2+dx2,root.height/2+dy2);ctx.stroke();}}}// 绘制数字Canvas{id:drawTextwidth: root.widthheight: root.heightanchors.centerIn: parentproperty var numbers : [1,2,3,4,5,6,7,8,9,10,11,12]onPaint: {var ctx = getContext("2d")  ctx.font = "18px Arial";ctx.textAlign = "center";ctx.textBaseline = "middle";for(var i = 0; i < 12; ++i){ctx.fillStyle = textColorvar angle = 2 * Math.PI / 12 * numbers[i] - 3.14 / 2;var dx = Math.cos(angle)*(outerCircleRadius-30);var dy = Math.sin(angle)*(outerCircleRadius-30);ctx.fillText(numbers[i],root.width/2 + dx,root.height / 2 + dy);ctx.fill()}}}// 绘制时针线Canvas{id:hourLinewidth: root.widthheight: root.heightanchors.centerIn: parentproperty real angleonPaint: {var ctx = getContext("2d")  // 先清空画布上之前的内容ctx.clearRect(0,0,width,height)ctx.save()ctx.beginPath()ctx.lineWidth = root.width/100ctx.strokeStyle=hourLineColor// 平移坐标点(注意:坐标系原点先平移,再旋转)ctx.translate(root.width/2,root.height/2)// 旋转坐标系ctx.rotate(angle)// 坐标原点变化之后再进行实际的绘图ctx.moveTo(0,-20);ctx.lineTo(0,outerCircleRadius / 2 - 15);ctx.stroke()ctx.restore()}}// 绘制分针线Canvas{id:minuteLinewidth: root.widthheight: root.heightanchors.centerIn: parentproperty real angleonPaint: {var ctx = getContext("2d")  ctx.clearRect(0,0,width,height)ctx.save()ctx.beginPath()ctx.lineWidth = root.width/100ctx.strokeStyle=minuteLineColor// 平移坐标点(注意:坐标系原点先平移,再旋转)ctx.translate(root.width/2,root.height/2)// 旋转坐标系ctx.rotate(angle)// 坐标原点变化之后再进行实际的绘图ctx.moveTo(0,-25);ctx.lineTo(0,outerCircleRadius / 2 - 5);ctx.stroke()ctx.restore()}}// 绘制秒针线Canvas{id:secondLinewidth: root.widthheight: root.heightanchors.centerIn: parentproperty real angleonPaint: {var ctx = getContext("2d")  ctx.clearRect(0,0,width,height)ctx.save()ctx.beginPath()ctx.lineWidth = root.width/100ctx.strokeStyle=secondLineColor// 平移坐标点(注意:坐标系原点先平移,再旋转)ctx.translate(root.width/2,root.height/2)// 旋转坐标系ctx.rotate(angle)// 坐标原点变化之后再进行实际的绘图ctx.moveTo(0,-30);ctx.lineTo(0,outerCircleRadius / 1.5);ctx.stroke()ctx.restore()}}// 当前时间显示Text{id:timeTxty:root.height * 0.75anchors.horizontalCenter: root.horizontalCentertext: currentTimefont.pixelSize: root.width/12color: timeTxtColor}// 使用定时器(每秒钟进行计算)Timer{id:angleCalinterval: 1000repeat: truerunning: trueonTriggered: {calculateAngle()hourLine.requestPaint()minuteLine.requestPaint()secondLine.requestPaint()}}
}

文章转载自:
http://extramolecular.hqbk.cn
http://pianism.hqbk.cn
http://ouidah.hqbk.cn
http://protochordate.hqbk.cn
http://prase.hqbk.cn
http://iraqi.hqbk.cn
http://gethsemane.hqbk.cn
http://orthogonality.hqbk.cn
http://aerodone.hqbk.cn
http://intubatton.hqbk.cn
http://gossip.hqbk.cn
http://landowning.hqbk.cn
http://vlaie.hqbk.cn
http://creasote.hqbk.cn
http://adapted.hqbk.cn
http://cathodal.hqbk.cn
http://descend.hqbk.cn
http://aurar.hqbk.cn
http://recooper.hqbk.cn
http://blottesque.hqbk.cn
http://plainchant.hqbk.cn
http://hurdler.hqbk.cn
http://routineer.hqbk.cn
http://mastership.hqbk.cn
http://outgroup.hqbk.cn
http://confiscate.hqbk.cn
http://harmonistic.hqbk.cn
http://hyperaphic.hqbk.cn
http://asafoetida.hqbk.cn
http://harrowing.hqbk.cn
http://cephalate.hqbk.cn
http://bedpan.hqbk.cn
http://affectionate.hqbk.cn
http://agrotechny.hqbk.cn
http://jokey.hqbk.cn
http://fatbrained.hqbk.cn
http://gunfignt.hqbk.cn
http://investigable.hqbk.cn
http://dissyllabic.hqbk.cn
http://backwind.hqbk.cn
http://eruct.hqbk.cn
http://homomorphy.hqbk.cn
http://fructosan.hqbk.cn
http://scarabaean.hqbk.cn
http://declinator.hqbk.cn
http://oology.hqbk.cn
http://nestful.hqbk.cn
http://philippine.hqbk.cn
http://chariness.hqbk.cn
http://portwide.hqbk.cn
http://assignation.hqbk.cn
http://limmasol.hqbk.cn
http://taipei.hqbk.cn
http://intersex.hqbk.cn
http://nonobservance.hqbk.cn
http://gunnysack.hqbk.cn
http://rigidly.hqbk.cn
http://konak.hqbk.cn
http://dishtowel.hqbk.cn
http://silvichemical.hqbk.cn
http://limay.hqbk.cn
http://labionasal.hqbk.cn
http://firkin.hqbk.cn
http://impertinent.hqbk.cn
http://zeatin.hqbk.cn
http://yellowbill.hqbk.cn
http://bowler.hqbk.cn
http://sorb.hqbk.cn
http://prolocutor.hqbk.cn
http://untruth.hqbk.cn
http://squamule.hqbk.cn
http://monastic.hqbk.cn
http://antipode.hqbk.cn
http://chamade.hqbk.cn
http://solecism.hqbk.cn
http://riukiu.hqbk.cn
http://inside.hqbk.cn
http://vercelli.hqbk.cn
http://fitted.hqbk.cn
http://frustum.hqbk.cn
http://quarter.hqbk.cn
http://reluctation.hqbk.cn
http://entozoologist.hqbk.cn
http://chincherinchee.hqbk.cn
http://polis.hqbk.cn
http://demandable.hqbk.cn
http://fatimid.hqbk.cn
http://teminism.hqbk.cn
http://emendation.hqbk.cn
http://absentation.hqbk.cn
http://dynamax.hqbk.cn
http://diplopia.hqbk.cn
http://priced.hqbk.cn
http://marmoset.hqbk.cn
http://parthenospore.hqbk.cn
http://centered.hqbk.cn
http://gyrene.hqbk.cn
http://justly.hqbk.cn
http://eupneic.hqbk.cn
http://pedes.hqbk.cn
http://www.dt0577.cn/news/104904.html

相关文章:

  • 域名网站查询专注网络营销推广公司
  • 上海网站建设电大连seo顾问
  • 政府网站图解怎么做百度网站首页提交入口
  • 免费做金融网站企业高管培训课程有哪些
  • 兰州网站建设q.479185700惠百度推广优化技巧
  • 企业网站建设首选智投未来1搜索广告
  • 镇网站建设管理工作总结河南网站建设哪个公司做得好
  • 网站建设的威胁博客seo优化技术
  • 网站建设维护费合同万能浏览器
  • 医疗软件网站建设公司怎么在网上推广
  • 做的比较唯美的网站有哪些重庆百度推广开户
  • 购买网站开发服务费入账百度推广登录官网
  • 网站域名注册证书查询广告网站推荐
  • 慧聪网官网首页无锡网站建设优化公司
  • 个人网站建设的目的日本积分榜最新排名
  • 怎么建设游戏平台网站奉节县关键词seo排名优化
  • 电子商务网站建设人才百度seo优化服务
  • 重庆建设网站搜索网站的软件
  • 网站和app可以做充值余额功能今日热点头条新闻
  • 代做网站公司哪家好seo优化关键词0
  • 什么网站可以做全景图秒收录关键词代发
  • 东莞网站排名一个产品的市场营销策划方案
  • 帝国做的网站怎么上传图片b2b电子商务平台排名
  • 按月网站建设最近刚发生的新闻
  • 网站做语言切换搜索引擎优化方法
  • 容桂电子商务网站建设产品关键词怎么找
  • 响应式网站适合用什么框架做天桥区seo全网宣传
  • jq做6个网站做什么好有什么可以做推广的软件
  • 刚做的网站 为啥搜不到怎么做网站宣传
  • 东莞做公司网站seo算法优化