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">
登录
首页 » Windows开发 » QT编写的C++贪吃蛇小游戏

QT编写的C++贪吃蛇小游戏

于 2022-03-21 发布 文件大小:730.86 kB
0 228
下载积分: 2 下载次数: 1

代码说明:

游戏通过按键控制 部分代码: #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

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 类在视觉基础知识中的示例使用
    Sample usage of Class in Visual Basics
    2022-07-17 10:38:43下载
    积分:1
  • 2022-01-26 05:37:46下载
    积分:1
  • 这是一个学习DLL编程的非常好的例子,非常经典,强烈建议好好学习...
    这是一个学习DLL编程的非常好的例子,非常经典,强烈建议好好学习-This is a DLL program to learn a very good example, very classic, is strongly recommended that learn
    2022-05-13 22:12:33下载
    积分:1
  • “C++程序设计教程”钱可以回答清华练习…
    《C++程序设计教程》钱能 清华 习题原版答案全集 《C++程序设计教程》钱能 清华 习题原版答案全集-" C++ Programming Tutorial" Money can be the answer Tsinghua Exercises original Complete Works of " C++ Programming Tutorial" Money can be the answer Tsinghua original Complete Works of Exercise
    2022-02-10 07:50:10下载
    积分:1
  • 一个如何给应用程序加帮助文件响应的例子
    一个如何给应用程序加帮助文件响应的例子--An example about how to add help files response to application
    2022-04-20 19:01:32下载
    积分:1
  • CJJ可视化的编程工具,你可以写CJJ代码,有兴趣去看看
    cjj的可视化编程工具,可以写cjj的代码,有兴趣的-cjj visual programming tool, you can write cjj code, interested to see if
    2023-05-16 03:05:03下载
    积分:1
  • 经典的动态规划算法,多路图最短路径的求取
    经典的动态规划算法,多路图最短路径的求取-The classic dynamic programming algorithm
    2022-02-12 06:04:40下载
    积分:1
  • materials management is general industrial, commercial enterprise production man...
    物资管理是一般工业、商业企业生产管理还击中重要的一环,需要对物资基本信息管理、物资调配信息等进行完整的监控。物资入库首先需要登记物资的基本信息,包括物资的种类、名称、型号、单位等;然后登记入库信息,包括物资基本信息、入库地点、入库人、经办人、数量等;出库物资需要登记出库信息,包括物资基本信息、出库地点、出库人、经办人、数量等;根据物资的入库、出库过程的综合,得到各种物资的余额信息,方便进行后续工作。因此物资管理信息系统需要记录物资流通的全过程。-materials management is general industrial, commercial enterprise production management responded important aspect of a need for basic supplies information management, materials information for the deployment of a complete monitoring. The amount of material goods must first register the basic information, including the type of materials, name, type, units, etc.; Arsenal then registration information, including basic information materials, storage location, storage, handling, and so on; Out-up materials needed for registration information, including material basic information out of the hangar location, out of the hangar, handling, and so on; based on the amount of material in and out of the process of integration, access to the material balance information and faci
    2022-07-01 15:03:22下载
    积分:1
  • WebDownLoader 下载者附程序
    WebDownLoader 下载者附程序-That those who download the WebDownLoader
    2023-03-12 09:10:03下载
    积分:1
  • 验证码简单去背景+ORC识别
    资源描述 验证码简单去背景+ORC识别  m_tesseract = new TesseractProcessor();             m_tesseract.Init(m_path, m_lang, (int)TesseractEngineMode.DEFAULT);             m_tesseract.SetVariable("tessedit_pageseg_mode", TesseractPageSegMode.PSM_AUTO.ToString());
    2023-03-31 01:45:04下载
    积分:1
  • 696516资源总数
  • 106658会员总数
  • 16今日下载