diff --git a/src/declarativeimports/core/tooltip.cpp b/src/declarativeimports/core/tooltip.cpp index 0b0a38573..4fd08fff7 100644 --- a/src/declarativeimports/core/tooltip.cpp +++ b/src/declarativeimports/core/tooltip.cpp @@ -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()) { diff --git a/src/declarativeimports/core/tooltip.h b/src/declarativeimports/core/tooltip.h index e77a5f6c7..5124f59f4 100644 --- a/src/declarativeimports/core/tooltip.h +++ b/src/declarativeimports/core/tooltip.h @@ -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;