Merge QToolTip::showText overloads as per ### Qt 6 comments
Change-Id: Ic156fed27bd535daf828e5d95049591833614307 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
This commit is contained in:
parent
ea09e2f466
commit
fa5ae76356
@ -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
|
Otherwise this argument can be \nullptr but it is used to
|
||||||
determine the appropriate screen on multi-head systems.
|
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
|
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.
|
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,
|
You can force moving by first hiding the tip with an empty text,
|
||||||
and then showing the new tip at the new position.
|
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)
|
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
|
if (QTipLabel::instance && QTipLabel::instance->isVisible()){ // a tip does already exist
|
||||||
@ -522,18 +514,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()
|
\fn void QToolTip::hideText()
|
||||||
\since 4.2
|
\since 4.2
|
||||||
|
@ -50,10 +50,8 @@ class Q_WIDGETS_EXPORT QToolTip
|
|||||||
{
|
{
|
||||||
QToolTip() = delete;
|
QToolTip() = delete;
|
||||||
public:
|
public:
|
||||||
// ### Qt 6 - merge the three showText functions below
|
static void showText(const QPoint &pos, const QString &text,
|
||||||
static void showText(const QPoint &pos, const QString &text, QWidget *w = nullptr);
|
QWidget *w = nullptr, const QRect &rect = {}, int msecShowTime = -1);
|
||||||
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 inline void hideText() { showText(QPoint(), QString()); }
|
static inline void hideText() { showText(QPoint(), QString()); }
|
||||||
|
|
||||||
static bool isVisible();
|
static bool isVisible();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user