Merge pull request #10644 from shuffle2/hide-balloon

Qt: hide balloon tooltip when parent gets hidden
This commit is contained in:
JosJuice 2022-05-08 17:46:12 +02:00 committed by GitHub
commit e19b995a1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 9 deletions

View File

@ -33,15 +33,8 @@ private:
m_timer_id = this->startTimer(TOOLTIP_DELAY);
}
void leaveEvent(QEvent* event) override
{
if (m_timer_id)
{
this->killTimer(*m_timer_id);
m_timer_id.reset();
}
BalloonTip::HideBalloon();
}
void leaveEvent(QEvent* event) override { KillAndHide(); }
void hideEvent(QHideEvent* event) override { KillAndHide(); }
void timerEvent(QTimerEvent* event) override
{
@ -54,6 +47,16 @@ private:
virtual QPoint GetToolTipPosition() const = 0;
void KillAndHide()
{
if (m_timer_id)
{
this->killTimer(*m_timer_id);
m_timer_id.reset();
}
BalloonTip::HideBalloon();
}
std::optional<int> m_timer_id;
QString m_title;
QString m_description;