资源简介
界面精美,简单游戏...代码量少
#include
#include
#include
Guessnum::Guessnum(QWidget *parent) :
QWidget(parent),
ui(new Ui::Guessnum)
{
ui->setupUi(this);
this->t=15;
this->total=0;
this->randNum=0;
this->showNum=0;
this->flag=0;
this->time_flag=0;
this->show_messg="";
this->timer = new QTimer(this);
this->timer->start(1000);
代码片段和文件信息
#include “guessnum.h“
#include “ui_guessnum.h“
#include
#include
#include
#include
#include
#include
#include
Guessnum::Guessnum(QWidget *parent) :
QWidget(parent)
ui(new Ui::Guessnum)
{
ui->setupUi(this);
this->t=15;
this->total=0;
this->randNum=0;
this->showNum=0;
this->flag=0;
this->time_flag=0;
this->show_messg=““;
this->timer = new QTimer(this);
this->timer->start(1000);
ui->lcdNumberTime->display(t);
this->movie_screen = new QMovie(this);
ui->label_screen->setMovie(movie_screen);
this->movie_screen->setFileName(“:/new/prefix1/image/13125047[1].gif“);
movie_screen->start();
this->gif = new QMovie(this);
ui->label->setMovie(gif);
this->gif->setFileName(“:/new/prefix1/image/6a24ab189.gif“);
this->movie = new QMovie(this);
ui->labelMainPic->setMovie(movie);
this->movie->setFileName(“:/new/prefix1/image/20090129.gif“);
movie->start();
ui->pushButtonstart->setEnabled(false);
ui->label->hide();
ui->textprompt->hide();
ui->labelError->hide();
ui->textError->hide();
ui->label->setScaledContents(true);
//ui->labelMainPic->setPixmap(QPixmap(“../image/program.jpg“));
qsrand(QTime(000).secsTo(QTime::currentTime())); //产生随机数
randNum = qrand()%9999+1;
while(randNum<1000)
randNum = qrand()%9000+999;
qDebug()<<“**************“<
connect(ui->pushButtonDelSIGNAL(clicked())thisSLOT(num_delete()));
connect(this->timerSIGNAL(timeout())thisSLOT(count_down()));
connect(ui->toolButtonSIGNAL(clicked())thisSLOT(game_start()));
connect(ui->pushButton0SIGNAL(clicked())thisSLOT(clicked_Num()));
connect(ui->pushButton1SIGNAL(clicked())thisSLOT(clicked_Num()));
connect(ui->pushButton2SIGNAL(clicked())thisSLOT(clicked_Num()));
connect(ui->pushButton3SIGNAL(clicked())thisSLOT(clicked_Num()));
connect(ui->pushButton4SIGNAL(clicked())thisSLOT(clicked_Num()));
connect(ui->pushButton5SIGNAL(clicked())thisSLOT(clicked_Num()));
connect(ui->pushButton6SIGNAL(clicked())thisSLOT(clicked_Num()));
connect(ui->pushButton7SIGNAL(clicked())thisSLOT(clicked_Num()));
connect(ui->pushButton8SIGNAL(clicked())thisSLOT(clicked_Num()));
connect(ui->pushButton9SIGNAL(clicked())thisSLOT(clicked_Num()));
connect(ui->pushButtonExitSIGNAL(clicked())thisSLOT(exit()));
connect(ui->pushButtonstartSIGNAL(clicked())thisSLOT(start()));
}
Guessnum::~Guessnum()
{
delete ui;
}
void Guessnum::clicked_Num()
{
QPushButton *button=(QPushButton *)this->sender();
if(button!=NULL)
{
int num = button->text().toInt();
if(total>999)
total=0;
total=total*10+num;
qDebug()<<“====“<<“total===“< ui->lcdNumberShowNum->setDigi
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 6305 2013-09-16 13:58 guessnum\guessnum.cpp
文件 674 2013-09-15 21:07 guessnum\guessnum.h
文件 357 2013-09-16 08:58 guessnum\guessnum.pro
文件 13513 2013-09-24 09:37 guessnum\guessnum.pro.user
文件 50224 2013-09-16 19:06 guessnum\guessnum.ui
文件 1072779 2013-09-13 08:33 guessnum\image\13125047[1].gif
文件 136455 2013-09-13 08:34 guessnum\image\20090129.gif
文件 422648 2013-09-13 08:37 guessnum\image\6a24ab189.gif
文件 15426 2010-11-14 11:41 guessnum\image\face-1.png
文件 40391 2011-09-29 12:45 guessnum\image\myheart.png
文件 269 2013-09-16 09:56 guessnum\image.qrc
文件 185 2013-09-13 19:51 guessnum\main.cpp
目录 0 2014-04-08 13:08 guessnum\image
目录 0 2014-04-08 13:08 guessnum
----------- --------- ---------- ----- ----
1759226 14
- 上一篇:ms17-010原理简介和复现
- 下一篇:Linux高级程序设计 第三版 源码杨宗德
相关资源
- 火车站售票系统 界面
- 美化Labview界面
- Qt管理员权限工具
- Qt pdf poppler
- QT的使用手册
- 聊天界面对话效果
- QT文件传输266846
- 基于Qt5的串口调试助手
- Labview 官方教程,很有用的入门级资料
- 棋盘格生成小工具
- ESP8266搭建MQTT客户端源码
- Qt 音乐播放器 实现歌词显示 网络播放
- LINUX 下QT电子书
- QT+VS点击按钮弹出新窗口的实现
- qt-vs-tools-msvc2015-2.0.0
- musicApp.rar
- Qt下的自定义图像显示控件
- 完美高仿QQ消息界面功能
- QT制作的QQ聊天室
- Qt帮助文档中文版264813
- 仿微信客服聊天界面已实现聊天记录
- 数据库课程设计-有图形界面-无需修改
- Photoshop智能手机APP界面设计part.
- QT下的小说阅读器
- 智能家居 环境温湿度采集系统
- Qt实现360安全卫士9.1(资源图片)
- Qt类关系图
- 华为hs8545m补全shell,恢复原厂界面,
- Game Programming Using QT.pdf
- Qt+Opencv-PCA人脸识别+视频
评论
共有 条评论