2019-07-28 02:40:49 +08:00
|
|
|
|
/*****************************************************************************
|
|
|
|
|
* Copyright (C) 2018-2019 NineChess authors
|
|
|
|
|
*
|
|
|
|
|
* Authors: liuweilhy <liuweilhy@163.com>
|
|
|
|
|
* Calcitem <calcitem@outlook.com>
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
|
* under the terms of the GNU Lesser General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU Lesser General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
|
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
// 派生这个类主要是为了让视图适应场景大小及图像旋转镜像操作
|
2018-05-21 23:43:19 +08:00
|
|
|
|
#ifndef GRAPHICSVIEW_H
|
|
|
|
|
#define GRAPHICSVIEW_H
|
|
|
|
|
|
|
|
|
|
#include <QGraphicsView>
|
|
|
|
|
|
2019-06-28 21:57:41 +08:00
|
|
|
|
#include "config.h"
|
|
|
|
|
|
2018-05-21 23:43:19 +08:00
|
|
|
|
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
|