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 279
游戏通过按键控制
部分代码:
#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
下载说明:请别用迅雷下载,失败请重下,重下不扣分!
是一个培训管理系统
是一个培训管理系统-is a training management system
2022-02-10 13:02:42下载
积分:1
这种程序实在是简单得不能再简单,网上随处可见,不过我既然写了一个,也放上来吧,附上源码。使用方法请查看压缩包中的Readme文件。...
这种程序实在是简单得不能再简单,网上随处可见,不过我既然写了一个,也放上来吧,附上源码。使用方法请查看压缩包中的Readme文件。 -this procedure is utterly simple, Internet can be seen everywhere, but since I was an also Fangshanglai bar, accompanied source. Please see use of compressed readme file.
2023-08-22 17:40:03下载
积分:1
Transcode in Hex Binary. Перекодировать Hex в Binary.
Transcode in Hex Binary. Перекодировать Hex в Binary.
2023-06-01 12:45:03下载
积分:1
asgdemo T. Allen, the company uses the TMS VCL, this procedure is Demo
asgdemo用到了adv公司的TMS VCL,此程序是DEMO演示-asgdemo T. Allen, the company uses the TMS VCL, this procedure is Demo
2022-02-13 05:20:34下载
积分:1
显示ppt的vc源码
显示ppt的vc源码-show ppt of vc-source
2022-01-22 15:51:44下载
积分:1
学生信息管理 用于管理学生的相关成绩信息
实现分类统计等功能...
学生信息管理 用于管理学生的相关成绩信息
实现分类统计等功能-Student Information Management for the management of student performance information related to the achievement of the functional classification of statistics
2022-01-25 20:22:34下载
积分:1
WINDOWS mine own VC games, three junior
WINDOWS自带 VC 扫雷游戏,低级中级高级三级别-WINDOWS mine own VC games, three junior-level Advanced Intermediate
2022-11-11 23:40:04下载
积分:1
道路曲线测设
该代码用于任意桩距的道路曲线测设元素的计算 可以输出TXT EXCEL文件 ,涵盖平曲线 竖曲线 的计算 ,结果可以用于全站仪测设道路曲线
2023-02-03 01:20:04下载
积分:1
Simple micro kernel source code.
Simple micro kernel source code.
2022-03-07 22:12:58下载
积分:1
一个java的日历记事本,也就是一个java做的日记本
一个java的日历记事本,也就是一个java做的日记本-a calendar notebook, which is a java do this diary
2023-02-25 19:15:04下载
积分:1