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 251
游戏通过按键控制
部分代码:
#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
下载说明:请别用迅雷下载,失败请重下,重下不扣分!
Five
五笔字型字典程序,可查不会写的五笔字-Five-Stroke dictionary procedures, the investigation will not write five words
2022-03-21 23:01:31下载
积分:1
此为在线招聘管理系统,具体操作里面有详细的word文档说明,管理员帐户为admin,密码为1234。...
此为在线招聘管理系统,具体操作里面有详细的word文档说明,管理员帐户为admin,密码为1234。-for this online recruitment management system, the specific operation with a detailed note of the word document, Administrator account for the admin password to 1234.-This is the online recruitment management system, specific operations which have detailed documentation of the word, the administrator account is admin, password is 1234.-for this online recruitment management system, the specific operation with a detailed note of the word document, Administrator account for the admin password to 1234.
2022-08-25 10:24:38下载
积分:1
Ball Controll, VTM Vietnam, This is execute files
Ball Controll, VTM Vietnam, This is execute files
2022-03-20 01:35:36下载
积分:1
一个封装的进度条类.可以替换自己的颜色显示百分比
一个封装的进度条类.可以替换自己的颜色显示百分比-The progress of a package of classes. Can replace their percentage of the color display
2022-08-24 11:17:26下载
积分:1
一个新的哈夫曼程序
一个新的哈夫曼程序-a new procedure Huffman
2022-08-03 21:55:58下载
积分:1
Respberry Smart car 开 源代码, 包含控制,video, 等开 =可继续扩展开 发 。
这是Respberry smart car的开源代码,已包含前进,后退,速度等控制代码和控制界面, 可继续扩展开发,源程序使用Python语言,平台可以Windows,同时兼容C语言。适合于新手学习使用。
2023-09-04 08:20:05下载
积分:1
视频捕获程序,很有指导意义,希望对你有帮助。
视频捕获程序,很有指导意义,希望对你有帮助。-Video capture process, is guiding significance, and they hope to help you.
2022-08-23 13:28:40下载
积分:1
ramasubramanian
在这里,我附上一个PG学生的项目源代码
2022-03-21 23:49:11下载
积分:1
Math
处理加减乘除字符串的源程序,编译后可以直接运行-Math
2022-03-07 04:43:01下载
积分:1
基于TCP/IP的一个消息服务器。可以作为系统内部的通信服务器。...
基于TCP/IP的一个消息服务器。可以作为系统内部的通信服务器。-Message Server based on TCP/IP
2022-06-19 16:49:41下载
积分:1