查看完整版本: [-- Qt自绘模拟时钟 --]

QTCN开发网 -> Qt 作品展 -> Qt自绘模拟时钟 [打印本页] 登录 -> 注册 -> 回复主题 -> 发表主题

amuuncle 2021-07-12 15:46

Qt自绘模拟时钟


[attachment=22456]
[attachment=22457]

Qt 自绘拟物时钟,纯代码实现,给新人一个参考,谢谢。
项目地址:https://gitee.com/hudejie/PerfectClock
项目动态截图:https://gitee.com/hudejie/PerfectClock/tree/master/screenshot
项目体验程序:https://gitee.com/hudejie/PerfectClock/blob/master/setup/PerfectClock.exe
  1. 黑白两种配色
  2. 鼠标控制放大缩小,置顶
  3. 秒针摆动时具有动画效果


angeltony 2021-07-12 18:15
不错不错

nigoole 2021-07-13 15:58
  1. // 秒针
        p->save();
        p->setPen(Qt::NoPen);
        p->setBrush(secondColor);
        p->rotate(-90);

        float fRotationAngle = this->property("RotationAngle").toFloat();
        fRotationAngle = qMax(fRotationAngle, (float)0.0);
        // 你提取了500毫秒来做动画,这里需要减掉1s,要不然led时钟不同步
        p->rotate((6.0 * (m_curTime.second() - 1)) + (6.0 * fRotationAngle));
        p->drawRoundedRect(-30, -2, 240, 4, 40, 40);
        p->restore();



秃尾巴 2022-10-27 09:42

zheguzai 2022-10-27 16:39


查看完整版本: [-- Qt自绘模拟时钟 --] [-- top --]



Powered by phpwind v8.7 Code ©2003-2011 phpwind
Gzip disabled