diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-10-01 13:07:31 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-10-02 12:48:59 +0000 |
commit | bfaa08a335f21e6fdf533969779f806883fe27b0 (patch) | |
tree | 2f6ff3425b6ae74670a46922c51a7cb779508693 /src/quicktemplates2/qquicktooltip_p.h | |
parent | eb7bf1825ede649ae35ebec91ef430686ae2c70a (diff) |
Fix QQuickToolTip's delay and visibility
The imperative open() and close() methods used to be the only ways to
open and close popups, but the visible-property was later made writable
to allow declarative visibility bindings. Since then, it is no longer
sufficient for QQuickToolTip to overshadow open() and close() in QML,
because setting the visible-property would bypass these overshadowed
method.
There was a bit of duplicate code between setVisible(), open(), and
close(). This change moves the logic to one place by changing open()
and close() to call setVisible(). Furthermore, setVisible() has been
made virtual to make it possible for QQuickToolTip to apply its delay
properly. QQuickToolTip needs to control the delay and timeout timers
before the effective visibility is applied on the popup.
Task-number: QTBUG-55572
Change-Id: I5a109157f9ec5d0db145e710426665a9a8d7e870
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquicktooltip_p.h')
-rw-r--r-- | src/quicktemplates2/qquicktooltip_p.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/quicktemplates2/qquicktooltip_p.h b/src/quicktemplates2/qquicktooltip_p.h index e39862bf..730e38d9 100644 --- a/src/quicktemplates2/qquicktooltip_p.h +++ b/src/quicktemplates2/qquicktooltip_p.h @@ -75,11 +75,9 @@ public: int timeout() const; void setTimeout(int timeout); - static QQuickToolTipAttached *qmlAttachedProperties(QObject *object); + void setVisible(bool visible) override; -public Q_SLOTS: - void open(); - void close(); + static QQuickToolTipAttached *qmlAttachedProperties(QObject *object); Q_SIGNALS: void textChanged(); |