2018-05-21 23:43:19 +08:00
|
|
|
|
// 派生这个类主要是为了让视图适应场景大小及图像旋转镜像操作
|
|
|
|
|
#ifndef GRAPHICSVIEW_H
|
|
|
|
|
#define GRAPHICSVIEW_H
|
|
|
|
|
|
|
|
|
|
#include <QGraphicsView>
|
|
|
|
|
|
|
|
|
|
class GameView : public QGraphicsView
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2019-06-21 01:26:37 +08:00
|
|
|
|
explicit GameView(QWidget *parent);
|
2018-05-21 23:43:19 +08:00
|
|
|
|
~GameView();
|
|
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
void flip();
|
|
|
|
|
void mirror();
|
|
|
|
|
void turnRight();
|
|
|
|
|
void turnLeft();
|
|
|
|
|
|
|
|
|
|
protected:
|
2019-06-21 01:26:37 +08:00
|
|
|
|
void resizeEvent(QResizeEvent *event);
|
2018-05-21 23:43:19 +08:00
|
|
|
|
|
|
|
|
|
private:
|
2018-09-21 02:13:15 +08:00
|
|
|
|
// 缩放因子,代码更新后不使用了
|
|
|
|
|
// qreal sx, sy;
|
2018-05-21 23:43:19 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // GRAPHICSVIEW_H
|