Add function to hide tooltip immediately

The built in delay causes trouble on wayland where it can cause
closing of other popups.
This commit is contained in:
David Redondo 2021-06-28 11:52:45 +02:00
parent ce39def7d1
commit 52b95888d5
2 changed files with 13 additions and 1 deletions

View File

@ -256,6 +256,12 @@ void ToolTip::hideToolTip()
tooltipDialogInstance()->dismiss();
}
void ToolTip::hideImmediately()
{
m_showTimer->stop();
tooltipDialogInstance()->setVisible(false);
}
QVariant ToolTip::icon() const
{
if (m_icon.isValid()) {

View File

@ -164,10 +164,16 @@ public Q_SLOTS:
void showToolTip();
/**
* Hides the tooltip if shown. Does not affect whether the tooltip area is active.
* Hides the tooltip after a grace period if shown. Does not affect whether the tooltip area is active.
*/
void hideToolTip();
/**
* Hides the tooltip immediately, in comparison to hideToolTip.
* @since 5.84
*/
void hideImmediately();
protected:
/// @cond INTERNAL_DOCS
bool childMouseEventFilter(QQuickItem *item, QEvent *event) override;