File indexing completed on 2024-05-05 04:02:56

0001 /*
0002     SPDX-FileCopyrightText: 2010 Ni Hui <shuizhuyuanluo@126.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef GAMEVIEW_H
0008 #define GAMEVIEW_H
0009 
0010 #include <QGraphicsView>
0011 
0012 class QGraphicsScene;
0013 /**
0014  * This class represents a graphics view for the game scene.
0015  * It is just a standard QGraphicsView but specialized for resizeEvent.
0016  * When resizing, it can notify the scene so that the scene can adjust
0017  * its layout according to the new size.
0018  */
0019 class GameView : public QGraphicsView
0020 {
0021     public:
0022         /** Constructor */
0023         explicit GameView( QGraphicsScene* scene, QWidget* parent = nullptr );
0024     protected:
0025         /** Reimplemented for notifying game scene of the resize event */
0026         void resizeEvent( QResizeEvent *event ) override;
0027 };
0028 
0029 #endif // GAMEVIEW_H