Alarm::Alarm(QWidget*parent) :QDialog(parent) { init(); layout(); con(); }; // ****** // 初始化 // ****** voidAlarm::init() { setWindowTitle("Alarmclock"); //设置标题 setFixedSize(QSize(300,80)); //固定大小 timer=newQTimer; //控制lcd的时间刷新 uptimer=newQTimer; //控制对话框上升 dtimer=newQTimer; //控制对话框下降 itimer=newQTimer; lcdNumber=newQLCDNumber; //显示当前时间 lcdNumber->setFixedSize(QSize(150,50)); //固定大小 lcdNumber->setNumDigits(8); //显示八个数字-qt alarm实现闹钟-界面开发 - IMDN开发者社群-imdn.cn" /> Alarm::Alarm(QWidget*parent):QDialog(parent){init();layout();con();};// ******// 初始化// ******voidAlarm::init(){setWindowTitle("Alarmclock");//设置标题setFixedSize(QSize(300,80));//固定大小timer=newQTimer;//控制lcd的时间刷新uptimer=newQTimer;//控制对话框上升dtimer=newQTimer;//控制对话框下降itimer=newQTimer;lcdNumber=newQLCDNumber;//显示当前时间lcdNumber->setFixedSize(QSize(150,50));//固定大小lcdNumber->setNumDigits(8);//显示八个数字,默认是显示5个数字lcdNumber->setSegmentStyle(QLCDNumber::Flat);//填充颜色,默认是白色的lcdNumber->display(QTime::currentTime().toString("hh:mm:ss"));//设置格式,还有其他形式的label=newQLabel(QString::fromLocal8Bit("闹钟"));//提示设置下个闹钟-IMDN开发者社群-imdn.cn"> Alarm::Alarm(QWidget*parent):QDialog(parent){init();layout();con();};// ******// 初始化// ******voidAlarm::init(){setWindowTitle("Alarmclock");//设置标题setFixedSize(QSize(300,80));//固定大小timer=newQTimer;//控制lcd的时间刷新uptimer=newQTimer;//控制对话框上升dtimer=newQTimer;//控制对话框下降itimer=newQTimer;lcdNumber=newQLCDNumber;//显示当前时间lcdNumber->setFixedSize(QSize(150,50));//固定大小lcdNumber->setNumDigits(8);//显示八个数字,默认是显示5个数字lcdNumber->setSegmentStyle(QLCDNumber::Flat);//填充颜色,默认是白色的lcdNumber->display(QTime::currentTime().toString("hh:mm:ss"));//设置格式,还有其他形式的label=newQLabel(QString::fromLocal8Bit("闹钟"));//提示设置下个闹钟 - IMDN开发者社群-imdn.cn">
登录
首页 » 界面开发 » qt alarm实现闹钟

qt alarm实现闹钟

于 2022-01-28 发布 文件大小:15.48 kB
0 208
下载积分: 2 下载次数: 1

代码说明:

#include"alarm.h" #include Alarm::Alarm(QWidget * parent) :QDialog(parent) { init(); layout(); con(); }; //  ****** //  初始化 //  ****** void Alarm::init() { setWindowTitle("Alarm clock"); //设置标题 setFixedSize(QSize(300,80)); //固定大小 timer=new QTimer; //控制lcd的时间刷新 uptimer=new QTimer; //控制对话框上升 dtimer=new QTimer; //控制对话框下降 itimer=new QTimer; lcdNumber=new QLCDNumber; //显示当前时间 lcdNumber->setFixedSize(QSize(150,50)); //固定大小 lcdNumber->setNumDigits(8); //显示八个数字,默认是显示5个数字 lcdNumber->setSegmentStyle(QLCDNumber::Flat); //填充颜色,默认是白色的 lcdNumber->display(QTime::currentTime().toString("hh:mm:ss")); //设置格式,还有其他形式的 label=new QLabel(QString::fromLocal8Bit("闹钟")); //提示设置下个闹钟

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 一个制作圆形按钮的例子
    一个制作圆形按钮的例子-An example of the production of radio button
    2022-01-20 23:20:29下载
    积分:1
  • 课程管理和绩效管理,ASP的前景,台湾SQL2…
    用于课程表管理和成绩的管理,前台ASP后,台SQL2000,非常方便实用-for curriculum management and performance management, ASP prospects, Taiwan SQL2000, very convenient and practical
    2023-04-25 13:50:04下载
    积分:1
  • BusinessSkin 在Delphi 中应用广泛,可是在C++ Builder 中很多都安装不了,不能运行,这个版本经本人修改却能运行.在bcb5,bcb6...
    BusinessSkin 在Delphi 中应用广泛,可是在C++ Builder 中很多都安装不了,不能运行,这个版本经本人修改却能运行.在bcb5,bcb6中安装通过.-BusinessSkin in Delphi widely used, But in many C Builder can be installed in all, not running, This version was revised by the I able to run. In bcb5, bcb6 installed through.
    2022-03-11 21:56:21下载
    积分:1
  • 使用vc编写一个类似Windows资源管理器的源代码,大家可以参考参考!非常实用简单...
    使用vc编写一个类似Windows资源管理器的源代码,大家可以参考参考!非常实用简单-vc prepared to use a similar resource management for the Windows source code, you can refer to reference! Very simple practical
    2022-03-24 00:16:52下载
    积分:1
  • IP的创始人
    这是系统的一个纯粹的 gui 软件提供的 ip 地址、 主机名和 mac 地址的所有连接,与在同一网络中。
    2022-03-22 02:56:45下载
    积分:1
  • 推荐一款Vista模仿窗体的源码示例,做的是挺漂亮的,可以在WIN2K下运行...
    推荐一款Vista界面模仿窗体的源码示例,界面做的是挺漂亮的,可以在WIN2K下运行-Recommend a Vista interface mimic the form of source code examples, make the interface is pretty and can be run in WIN2K
    2022-01-28 20:41:52下载
    积分:1
  • 优秀的VB_GRID,可以查看源代码Visit vbAccelerator
    优秀的VB_GRID,可以查看源代码Visit vbAccelerator - the VB programmer s resourceS-Grid 2.0 is an all VB grid giving you the control other grids don t, and all in 480kb. Create Outlook-style grids, span column text across rows, freely set row and column heights, set colours and fonts for each cell, add icons to cells, sort and group data... -outstanding VB_GRID can view the source code Visit vbAccelerator-the VB programmer s resourceS-Grid 2.0 is an all VB grid control giving you the other grids don t, and all in 480kb. Create Outlook-style grids that span column text across rows, freely set row and column heights, set colors and fonts for each cell, add icons to cells, sort and group data ...
    2022-05-08 12:28:30下载
    积分:1
  • ucflash php上传头像
    从uchome里面剥离的在线flash头像上传功能,可以单独放到网站的任何位置,支持裁剪,生成三种大小的图片
    2023-07-15 16:00:03下载
    积分:1
  • 对话框的全屏显示
    对话框的全屏显示-the dialog full screen display
    2022-03-23 00:50:24下载
    积分:1
  • 此源文件可以使用和分配,而不受限制的提供。
    This source file may be used and distributed without restriction provided that this copyright statement is not removed from the file and that any derivative work contains the original copyright notice and the associated disclaimer. This software is provided “as is” and without any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. in no event shall the author or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services loss of use, data, or profits or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage. -This source file may be used and distributed without restriction p
    2022-05-06 01:26:04下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载