1
0

add checkerboard support

This commit is contained in:
Gary Wang
2019-09-30 23:02:44 +08:00
parent 89c21bc90b
commit 5067c04b91
7 changed files with 172 additions and 10 deletions

View File

@@ -17,6 +17,9 @@ public:
GraphicsScene * scene() const;
void setScene(GraphicsScene *scene);
public slots:
void toggleCheckerboard();
private:
void mousePressEvent(QMouseEvent * event) override;
void mouseMoveEvent(QMouseEvent * event) override;
@@ -30,8 +33,11 @@ private:
bool isThingSmallerThanWindowWith(const QTransform &transform) const;
bool shouldIgnoreMousePressMoveEvent(const QMouseEvent *event) const;
void checkAndDoFitInView();
void setCheckerboardEnabled(bool enabled);
bool m_enableFitInView = false;
bool m_checkerboardEnabled = false;
};
#endif // GRAPHICSVIEW_H