添加update信号

This commit is contained in:
codeboss 2025-10-12 11:42:08 +08:00
parent 2ef64272f7
commit 9cee15a935
2 changed files with 15 additions and 2 deletions

View File

@ -204,3 +204,7 @@ bool PresentIndex::isValid() const
{
return row != INT_MAX && col != INT_MAX;
}
UnitPresentDelegate::UnitPresentDelegate(QObject* parent /*= nullptr*/)
:QObject(parent) {
}

View File

@ -42,9 +42,12 @@ struct PresentOption {
/// <summary>
/// 데禱삥齡官辜
/// </summary>
class UnitPresentDelegate {
class UnitPresentDelegate : public QObject {
Q_OBJECT
public:
UnitPresentDelegate(QObject* parent = nullptr);
virtual ~UnitPresentDelegate() = default;
/// <summary>
/// 튈토데禱잚謹
/// </summary>
@ -56,6 +59,12 @@ public:
/// <param name="p"></param>
/// <param name="option"></param>
virtual void paint(QPainter* p, const PresentOption& option) = 0;
signals:
/// <summary>
/// 更新通知/重绘请求
/// </summary>
void updateRequest();
};
/// <summary>
@ -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;