⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mywidget.h

📁 本人这两天在linux下用qt作的益智小游戏
💻 H
字号:
#ifndef MYWIDGET_H#define MYWIDGET_H#include"mypaint.h"#include<qapplication.h>#include<qevent.h>#include<qpicture.h>#include<qimage.h>#include<qpopupmenu.h>#include<qmenubar.h>#include<qfont.h>#include<qlabel.h>#include<qmessagebox.h>#include<qpushbutton.h>#include<qframe.h>#include<qlcdnumber.h>#include<qmultilineedit.h>#include<qtextcodec.h>#include<qtabdialog.h>#include<qstack.h>struct path{    int manChange;//whether the girl has walked    int manS;	      int ghostS1,ghostS2;    int manPath[2];    int ghostPath1[2];    int ghostPath2[2];};typedef QStack<struct path> Path;class MyWidget:public MyPaintWidget{    Q_OBJECTpublic:    MyWidget();private:    int distH,distV;     int click_counter;      int stag;      int button; 	  //state of button       int curPos[2];        //mouse's position    int step[2];          //girl's step    int state;		 //charactor's number in the original picture    int man_state;	     int ghost_state;    int ascii;		 //the acsii of the button pressed        Path p;	         //a stack for drawing back    struct path *p1;        QMessageBox *mess1,*mess2;    QPixmap *pic;    QPopupMenu *file;    QPopupMenu *set;    QPopupMenu *help;    QMenuBar *menu;    QPushButton *start;    QPushButton *stage;    QPushButton *_quit;    QPushButton *back;    QPushButton *add;    QPushButton *sub;    QLCDNumber *lcd;    QLabel *r;    QLabel *m;    QLabel *g;      virtual void mousePressEvent(QMouseEvent*);	    virtual void keyReleaseEvent(QKeyEvent *);    bool  judgement(int,int *,int *);	//judge whether the charactor can walk    void  paintEvent(QPaintEvent*);	//draw map    void  ghost_walk();			    void setButton(int);	        //check the ascii of the button pressed    void go(int ,int*,int *);		//animate the charactor when walkingpublic slots:       void IsWalking(int *);		    void man_walk(int *);    void win();    void gameOver();    void begin();    void choose_stage();    void changeStage(int);    void add_stage();    void sub_stage();    void setback();    void introduce();    void about();signals:    void cursor_pos(int *);		    void pressButton(int);    void walk(int *);      void stageChange(int);    void good();    void over();}; #endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -