Walls And Holes  1
tilemapbrushtool.h
Go to the documentation of this file.
1 #ifndef TILEMAPBRUSHTOOL_H
2 #define TILEMAPBRUSHTOOL_H
3 
4 #include "abstracttilemaptool.h"
5 #include "tilemap.h"
6 #include "tiletemplate.h"
7 
8 #include <QWidgetAction>
9 #include <QUndoStack>
10 
12 {
13 public:
14  TileMapBrushTool(TileMapPreviewGraphicsItem *previewItem, QUndoStack *undoStack);
15 
16  void cellActivated(int x, int y, QMouseEvent *) override;
17  void cellHovered(int x, int y, QMouseEvent *) override;
18  void cellReleased(int, int, QMouseEvent *) override;
19  void mouseExitedMap(QMouseEvent *);
20 
21  QList<QAction *> contextActions() override { return {mRadiusSpinner}; }
22 
23 private:
24  int mRadius;
25 
26  QWidgetAction *mRadiusSpinner;
27 
28  QUndoStack *mUndoStack;
29 };
30 
31 #endif // TILEMAPBRUSHTOOL_H
QList< QAction * > contextActions() override
Returns a vector of qactions which can be used to modify the behaviour of the tool. Will be used by the tool manager to add the actions to a context tool bar.
Definition: tilemapbrushtool.h:21
Definition: abstracttilemaptool.h:9
Definition: tilemapbrushtool.h:11
void cellActivated(int x, int y, QMouseEvent *) override
Called when the left mouse button is down over a new cell.
Definition: tilemapbrushtool.cpp:31
void cellHovered(int x, int y, QMouseEvent *) override
Called when the mouse hovers over a new cell.
Definition: tilemapbrushtool.cpp:50
void mouseExitedMap(QMouseEvent *)
Called when the mouse is no longer hovering over a cell.
Definition: tilemapbrushtool.cpp:77
TileMapBrushTool(TileMapPreviewGraphicsItem *previewItem, QUndoStack *undoStack)
Definition: tilemapbrushtool.cpp:8
void cellReleased(int, int, QMouseEvent *) override
Called when the left mouse button is released over a cell.
Definition: tilemapbrushtool.cpp:65
Definition: tilemappreviewgraphicsitem.h:9