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 193
游戏通过按键控制
部分代码:
#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
下载说明:请别用迅雷下载,失败请重下,重下不扣分!
VB考勤系统源程序
VB考勤系统源程序-VB source appraisal system
2023-07-31 01:50:03下载
积分:1
自由拼音输入程序
自由拼音输入程序-free phonetic input program
2022-02-06 16:46:55下载
积分:1
处理器访问当前状态的程序
获取当前cpu状态的程序-cpu access to the current state of procedure
2022-07-24 05:30:22下载
积分:1
实现最小生成树算法,通过PRIM算法实现.通过输入一串字符显示最小生成树.求得最小路径...
实现最小生成树算法,通过PRIM算法实现.通过输入一串字符显示最小生成树.求得最小路径-Realize minimum spanning tree algorithm, through the PRIM algorithm. By entering a string of characters show minimal spanning tree. Find the smallest path
2023-01-21 06:40:04下载
积分:1
the code to teach you how to make your VB string manipulation and the C language...
这个代码教你如何使你在VB中的字符串操作和C语言实现的一样快!
-the code to teach you how to make your VB string manipulation and the C language as fast!
2022-04-01 05:05:00下载
积分:1
《程序自修改实现》
《程序自修改实现》-对于相关编程技术有用-《Self-modifying programs to achieve》- for relevant programming techniques useful for
2023-02-04 16:25:03下载
积分:1
日梭万年历,各地经纬,日月位置,前后500年,时间方面最好最全的万年历。...
日梭万年历,各地经纬,日月位置,前后500年,时间方面最好最全的万年历。-Soe calendar day, around the latitude, the sun position, before and after 500 years, the timing of the best and the whole of the calendar.
2022-02-04 11:23:28下载
积分:1
虚拟磁盘技术,非常有用的论文资料。部下会后悔的
虚拟磁盘技术,非常有用的论文资料。部下会后悔的-Virtual disk technology, the paper very useful information. Subordinates will be sorry
2022-03-19 01:26:52下载
积分:1
wince 可以让你自动显示中文,不需要添加代码页,字库的,显示中文...
wince 可以让你自动显示中文,不需要添加代码页,字库的,显示中文
2022-08-07 15:51:05下载
积分:1
procedures how to read and write DOS Windows clipboard, small learning process f...
DOS程序如何读写Windows剪贴板,小程序供大家学习使用-procedures how to read and write DOS Windows clipboard, small learning process for everyone to use
2022-01-26 01:50:05下载
积分:1