diff --git a/MapPresent/MapPresent.cpp b/MapPresent/MapPresent.cpp
index 93cb9a6..721d3d4 100644
--- a/MapPresent/MapPresent.cpp
+++ b/MapPresent/MapPresent.cpp
@@ -204,3 +204,7 @@ bool PresentIndex::isValid() const
{
return row != INT_MAX && col != INT_MAX;
}
+
+UnitPresentDelegate::UnitPresentDelegate(QObject* parent /*= nullptr*/)
+ :QObject(parent) {
+}
diff --git a/MapPresent/MapPresent.h b/MapPresent/MapPresent.h
index 5a47759..1968ed1 100644
--- a/MapPresent/MapPresent.h
+++ b/MapPresent/MapPresent.h
@@ -42,9 +42,12 @@ struct PresentOption {
///
/// 单元绘制委托
///
-class UnitPresentDelegate {
+class UnitPresentDelegate : public QObject {
+ Q_OBJECT
public:
+ UnitPresentDelegate(QObject* parent = nullptr);
virtual ~UnitPresentDelegate() = default;
+
///
/// 匹配单元类型
///
@@ -56,6 +59,12 @@ public:
///
///
virtual void paint(QPainter* p, const PresentOption& option) = 0;
+
+signals:
+ ///
+ /// 更新通知/重绘请求
+ ///
+ void updateRequest();
};
///
@@ -106,7 +115,7 @@ public:
signals:
void mouseIn();
void mouseOut();
- void mouseHover(const PresentIndex &unit_index);
+ void mouseHover(const PresentIndex& unit_index);
protected:
void paintEvent(QPaintEvent* ev) override;