diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2019-03-06 09:36:50 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2019-03-08 13:24:06 +0000 |
commit | 1ef176b5da8ad8d4993fa9296e64e44ee8de6560 (patch) | |
tree | 02c74a1308ab767883230ab3e55fb6f9fafc9168 /src/quicktemplates2 | |
parent | 73914e00dba2fe259108197d01b6744ce16b63d8 (diff) |
Fix attached ToolTips using the timeout of the last shown tool tip
Attached ToolTips share a single ToolTip item and set properties
(such as delay) on it before showing it. Before 63899f3185,
this wasn't a problem, but now QQuickToolTip has its own show()
function that QQuickToolTipAttached calls. QQuickToolTipAttached
passes -1 by default, which QQuickToolTip sees as the "default"
and hence doesn't set a timeout at all. However, since that
QQuickToolTip instance is shared, it still has a previous
timeout value from the last time it was shown by a different
QQuickToolTipAttached object.
So, instead of QQuickToolTipAttached passing the timeout to
QQuickToolTip::show(), make it set it on the QQuickToolTip
instead. This ensures that it has the correct value if no
timeout was specified for an attached tool tip.
Task-number: QTBUG-74226
Change-Id: Iceed17bbb640a929fae3b9c975519df36cc2d210
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'src/quicktemplates2')
-rw-r--r-- | src/quicktemplates2/qquicktooltip.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/quicktemplates2/qquicktooltip.cpp b/src/quicktemplates2/qquicktooltip.cpp index 00090f66..ddf434a2 100644 --- a/src/quicktemplates2/qquicktooltip.cpp +++ b/src/quicktemplates2/qquicktooltip.cpp @@ -534,7 +534,8 @@ void QQuickToolTipAttached::show(const QString &text, int ms) tip->resetHeight(); tip->setParentItem(qobject_cast<QQuickItem *>(parent())); tip->setDelay(d->delay); - tip->show(text, ms >= 0 ? ms : d->timeout); + tip->setTimeout(ms >= 0 ? ms : d->timeout); + tip->show(text); } /*! |