setAutoFillBackground(true);//覆盖this->resize(480,270);this->setWindowIcon(QIcon("img/icon.jpg"));this->setWindowTitle("贪吃蛇");QPalettepalette;palette.setBrush(QPalette::Background,QBrush((QPixmap)"img/bjt.png"));this->setPalette(palette);//按扭区leftbtn=newQPushButton(this);leftbtn->setIcon((QIcon)"img/zuo.png");leftbtn->setIconSize(QSize(40,40));leftbtn->setGeometry(QRect(340,180,40,40));leftbtn->setFlat(true);rightbtn=newQPushButton(this);rightbtn->setIcon((QIcon)"img/you.png");rightbtn->setIconSize(QSize(40,40));rightbtn->setGeometry(QRect(430,180,40,40));rightbtn->setFlat(true-IMDN开发者社群-imdn.cn">
setAutoFillBackground(true);//覆盖this->resize(480,270);this->setWindowIcon(QIcon("img/icon.jpg"));this->setWindowTitle("贪吃蛇");QPalettepalette;palette.setBrush(QPalette::Background,QBrush((QPixmap)"img/bjt.png"));this->setPalette(palette);//按扭区leftbtn=newQPushButton(this);leftbtn->setIcon((QIcon)"img/zuo.png");leftbtn->setIconSize(QSize(40,40));leftbtn->setGeometry(QRect(340,180,40,40));leftbtn->setFlat(true);rightbtn=newQPushButton(this);rightbtn->setIcon((QIcon)"img/you.png");rightbtn->setIconSize(QSize(40,40));rightbtn->setGeometry(QRect(430,180,40,40));rightbtn->setFlat(true - IMDN开发者社群-imdn.cn">
于 2022-03-21 发布
文件大小:730.86 kB
0 207
游戏通过按键控制
部分代码:
#include "gamewidget.h"
#define ROW 13
#define COL 16
#define UP 0
#define DOWN 1
#define LEFT 2
#define RIGHT 3
GameWidget::GameWidget(QWidget *parent)
:QWidget(parent)
{
this->setAutoFillBackground(true);//覆盖
this->resize(480,270);
this->setWindowIcon(QIcon("img/icon.jpg"));
this->setWindowTitle("贪吃蛇");
QPalette palette;
palette.setBrush(QPalette::Background,QBrush((QPixmap)"img/bjt.png"));
this->setPalette(palette);
//按扭区
leftbtn=new QPushButton(this);
leftbtn->setIcon((QIcon)"img/zuo.png");
leftbtn->setIconSize(QSize(40,40));
leftbtn->setGeometry(QRect(340,180,40,40));
leftbtn->setFlat(true);
rightbtn=new QPushButton(this);
rightbtn->setIcon((QIcon)"img/you.png");
rightbtn->setIconSize(QSize(40,40));
rightbtn->setGeometry(QRect(430,180,40,40));
rightbtn->setFlat(true
下载说明:请别用迅雷下载,失败请重下,重下不扣分!
自己做的关于Modbus RTU通信的16位CRC校验码生成的示例,希望对各位有所帮助...
自己做的关于Modbus RTU通信的16位CRC校验码生成的示例,希望对各位有所帮助-Own on the Modbus RTU communication 16 CRC checksum generated code example, you want to be helpful
2022-05-29 20:41:28下载
积分:1
端口扫描器,可以扫描计算机的端口,例如程序的质量。
端口扫描程序,可用于计算机端口的扫描,作为例子程序,相当不错-Port scanner can be used to scan the computer ports, as an example procedure, quite good
2022-01-22 03:47:43下载
积分:1
北大ACM试题poj 第3063题源码,很好的代码,希望对搞ACM的同学有帮助...
北大ACM试题poj 第3063题源码,很好的代码,希望对搞ACM的同学有帮助
-Peking University ACM Chapter 3063 question Question poj source code, good code, and want to help students engage in ACM
2022-10-15 16:05:03下载
积分:1
Move the file to another folder from ftp
c#代码移走在ftp里的文件从文件夹到另一个文件夹。。。
2022-03-22 14:58:44下载
积分:1
下一代编程与开 发 Whidbey
下一代编程与开发 Whidbey-programming and the development of the next generation Whidbey
2022-07-10 08:29:12下载
积分:1
MFC控件,树形,像资源管理器一样,实现树形获取文档的功能...
MFC控件,树形,像资源管理器一样,实现树形获取文档的功能-MFC control, tree, like the Explorer, the same access to the document to achieve the function tree
2022-03-24 10:42:46下载
积分:1
一个VB开 发 的画图程序,模仿woindows画笔
一个VB开发的画图程序,模仿woindows画笔-a VB drawing programs, copying woindows brush
2023-02-09 06:40:03下载
积分:1
silverlight的p2p库,在sl上实现p2p功能的尝试
silverlight的p2p库,在sl上实现p2p功能的尝试-silverlight p2p lib
2022-07-05 12:18:02下载
积分:1
建立10个优先级不同的任务,并且察看每个任务的Angel
its a fartboy programm to fart
2022-02-24 22:40:44下载
积分:1
Microsoft Windows CE source code book, and they hope to have everyone help
Microsoft Windows CE书上源代码,希望对大家有帮助-Microsoft Windows CE source code book, and they hope to have everyone help
2022-05-06 14:52:26下载
积分:1