diff options
Diffstat (limited to 'src/mapentity.h')
-rw-r--r-- | src/mapentity.h | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/mapentity.h b/src/mapentity.h index 788e02d..f08f1b0 100644 --- a/src/mapentity.h +++ b/src/mapentity.h @@ -52,6 +52,12 @@ public: inline const float location(int index) const { return entity_location[index]; } + +signals: + /** + * @brief the clicked() signal is emitted if the entity is clicked with the left mouse button + * */ + void clicked(MapEntity *entity); public slots: @@ -74,11 +80,26 @@ public slots: * @brief set the entity location * */ void set_location(const float x, const float y, const float z); + + /** + * @brief set the selected state + * */ + void set_selected(const bool selected); protected: + /** + * @brief handle draw events + * */ virtual void paintEvent(QPaintEvent *event); + /** + * @brief handle mouse button press events + * */ + virtual void mousePressEvent(QMouseEvent *event); + private: + bool is_selected; + QString entity_label; QString entity_name; QString entity_type; @@ -91,4 +112,4 @@ private: } -#endif // __INCLUDED_EDITOR_MAPENTITY__
\ No newline at end of file +#endif // __INCLUDED_EDITOR_MAPENTITY__ |