summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2020-06-08 17:31:10 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2020-06-10 19:59:05 +0200
commitfa5ae7635660cc382d0b0ed3ce728433848e4ec3 (patch)
tree503ef1644243249b155e5c340526d9ef02a290eb /src/widgets
parentea09e2f466ce5ba072eb1b2e8259c4300c272fcd (diff)
Merge QToolTip::showText overloads as per ### Qt 6 comments
Change-Id: Ic156fed27bd535daf828e5d95049591833614307 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/kernel/qtooltip.cpp28
-rw-r--r--src/widgets/kernel/qtooltip.h6
2 files changed, 6 insertions, 28 deletions
diff --git a/src/widgets/kernel/qtooltip.cpp b/src/widgets/kernel/qtooltip.cpp
index 8aca4db58a..d46bf3b2bf 100644
--- a/src/widgets/kernel/qtooltip.cpp
+++ b/src/widgets/kernel/qtooltip.cpp
@@ -451,24 +451,16 @@ bool QTipLabel::tipChanged(const QPoint &pos, const QString &text, QObject *o)
Otherwise this argument can be \nullptr but it is used to
determine the appropriate screen on multi-head systems.
+ The \a msecDisplayTime parameter specifies for how long the tool tip
+ will be displayed, in milliseconds. With the default value of -1, the
+ time is based on the length of the text.
+
If \a text is empty the tool tip is hidden. If the text is the
same as the currently shown tooltip, the tip will \e not move.
You can force moving by first hiding the tip with an empty text,
and then showing the new tip at the new position.
*/
-void QToolTip::showText(const QPoint &pos, const QString &text, QWidget *w, const QRect &rect)
-{
- showText(pos, text, w, rect, -1);
-}
-
-/*!
- \since 5.2
- \overload
- This is similar to QToolTip::showText(\a pos, \a text, \a w, \a rect) but with an extra parameter \a msecDisplayTime
- that specifies how long the tool tip will be displayed, in milliseconds.
-*/
-
void QToolTip::showText(const QPoint &pos, const QString &text, QWidget *w, const QRect &rect, int msecDisplayTime)
{
if (QTipLabel::instance && QTipLabel::instance->isVisible()){ // a tip does already exist
@@ -523,18 +515,6 @@ void QToolTip::showText(const QPoint &pos, const QString &text, QWidget *w, cons
}
/*!
- \overload
-
- This is analogous to calling QToolTip::showText(\a pos, \a text, \a w, QRect())
-*/
-
-void QToolTip::showText(const QPoint &pos, const QString &text, QWidget *w)
-{
- QToolTip::showText(pos, text, w, QRect());
-}
-
-
-/*!
\fn void QToolTip::hideText()
\since 4.2
diff --git a/src/widgets/kernel/qtooltip.h b/src/widgets/kernel/qtooltip.h
index 9f786bdee1..c78e4c3251 100644
--- a/src/widgets/kernel/qtooltip.h
+++ b/src/widgets/kernel/qtooltip.h
@@ -50,10 +50,8 @@ class Q_WIDGETS_EXPORT QToolTip
{
QToolTip() = delete;
public:
- // ### Qt 6 - merge the three showText functions below
- static void showText(const QPoint &pos, const QString &text, QWidget *w = nullptr);
- static void showText(const QPoint &pos, const QString &text, QWidget *w, const QRect &rect);
- static void showText(const QPoint &pos, const QString &text, QWidget *w, const QRect &rect, int msecShowTime);
+ static void showText(const QPoint &pos, const QString &text,
+ QWidget *w = nullptr, const QRect &rect = {}, int msecShowTime = -1);
static inline void hideText() { showText(QPoint(), QString()); }
static bool isVisible();