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 57
游戏通过按键控制
部分代码:
#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
下载说明:请别用迅雷下载,失败请重下,重下不扣分!
Samsung 2412 platform application testing small programs, for informational purp...
三星2412平台的应用测试小程序,仅供参考。-Samsung 2412 platform application testing small programs, for informational purposes only.
2022-03-15 10:40:16下载
积分:1
酒店管理系统
本代码是在vs2010环境下利用c#进行的开发。特别适合初学者,针对于网络传输协议ftp进行设计。本设计代码简明,思路清晰明了。同时也是自学c#语言的明智之选。
2022-04-17 21:25:09下载
积分:1
本程序代码,主要为了测试大整数的四则运算 ,以及在此基础上进行求最大公约数的计算。
bigint_lib_dll文件夹中分别为编译好的lib库文...
本程序代码,主要为了测试大整数的四则运算 ,以及在此基础上进行求最大公约数的计算。
bigint_lib_dll文件夹中分别为编译好的lib库文件和dll库文件以及源代码。
test_bigintcommondevision文件夹中为测试程序,工程使用的是lib库文件。
头文件中部分函数没有定义。-This procedure code, mainly to test the four large integer arithmetic, as well as on the basis of seeking common denominator of this calculation. bigint_lib_dll folder were compiled lib library files and dll library files and source code. test_bigintcommondevision folder for the test program, engineering using lib library file. Header file, part of the function is not defined.
2022-05-19 05:59:03下载
积分:1
ssd6 practice and practice five of six, and they hope to help you study!
ssd6的练习五和练习六,希望对大家的学习有所帮助!-ssd6 practice and practice five of six, and they hope to help you study!
2022-03-26 11:57:15下载
积分:1
java struts的经典教材之一,有学习此意想的同志有必要好好研究...
java struts的经典教材之一,有学习此意想的同志有必要好好研究-java struts one of the classic textbook, this study intended comrades should properly study
2023-06-07 21:05:03下载
积分:1
Active Directory Cookbook For Windows Server 2003
Active Directory Cookbook For Windows Server 2003
2022-08-26 09:39:34下载
积分:1
整个报告简单的狂欢
Exemplo simples de Rave Reports
2022-05-23 01:27:13下载
积分:1
一个很不错的基于SIP的voip软件电话,基本可用的
一个很不错的基于SIP的voip软件电话,基本可用的-A very good SIP-based voip software phones, the basic available
2022-06-17 13:47:02下载
积分:1
dissecting part.pdf MFC 2e的
dissecting MFC 2e part.pdf
2023-08-08 15:05:04下载
积分:1
关于计算机等级考试的详细情况以及考生报名、大纲教材、考试、成绩发 放、证书获取...
自学TCP/IP协议。对学习通信的朋友会有帮助-Self-learning TCP/IP protocol. Friend of learning communication would be helpful
2022-02-01 04:11:22下载
积分:1