mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-03-21 17:34:57 -05:00
Show tooltip updates while the tooltip is visible
This commit is contained in:
parent
d088b86d89
commit
b0a4ed848a
|
|
@ -1,5 +1,7 @@
|
|||
#include "auto-update-tooltip-label.hpp"
|
||||
|
||||
#include <QToolTip>
|
||||
|
||||
namespace advss {
|
||||
|
||||
AutoUpdateHelpIcon::AutoUpdateHelpIcon(
|
||||
|
|
@ -16,6 +18,7 @@ AutoUpdateHelpIcon::AutoUpdateHelpIcon(
|
|||
|
||||
void AutoUpdateHelpIcon::enterEvent(QEnterEvent *event)
|
||||
{
|
||||
UpdateTooltip();
|
||||
_timer->start(_updateIntervalMs);
|
||||
QLabel::enterEvent(event);
|
||||
}
|
||||
|
|
@ -28,7 +31,12 @@ void AutoUpdateHelpIcon::leaveEvent(QEvent *event)
|
|||
|
||||
void AutoUpdateHelpIcon::UpdateTooltip()
|
||||
{
|
||||
setToolTip(_callback());
|
||||
if (!underMouse()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const QString text = _callback();
|
||||
QToolTip::showText(QCursor::pos(), text, this);
|
||||
}
|
||||
|
||||
} // namespace advss
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user