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

📄 target.h

📁 本文件是<精通QT4编程>的配套源代码
💻 H
字号:
#ifndef TARGET_H#define TARGET_H#include <QGraphicsItem>#include <QObject>class Target : public QObject, public QGraphicsItem{    Q_OBJECTpublic:    Target();    Target(qreal speed, qreal course, short type, short attribute);    QRectF boundingRect() const;    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,               QWidget *widget);public:    qreal m_course;    qreal m_speed;    short m_type; 		// surface, undersurface, air    short m_attribute; 	// friend, foe, unknown    QColor m_color;    protected:    void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);    void mousePressEvent(QGraphicsSceneMouseEvent * event);    void dragEnterEvent(QGraphicsSceneDragDropEvent * event);    void dragMoveEvent(QGraphicsSceneDragDropEvent * event);      void dropEvent(QGraphicsSceneDragDropEvent * event);private:	enum Attr {		Foe,		Us,		Unknown	};	enum Type {		Surface,		UnderSurface,		Air	};};#endif

⌨️ 快捷键说明

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