diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-04-07 17:49:43 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-04-21 20:35:29 +0200 |
commit | 1c80d056e4f45b4ee7c4863cd792e83c889513c5 (patch) | |
tree | fce424d5dcc18710bd88a479ec48c443209a1115 /src/widgets/widgets/qtoolbox.cpp | |
parent | fbb7c98e91ec9a0a253864d7621ee7ec73b1a480 (diff) |
Port QT_NO_TOOLTIP to QT_CONFIG(tooltip)
We remove the QT_NO_TOOLTIP check from qstandarditemmodel.h, because as
the 'tooltip' feature is in QtWidgets, we cannot use it properly in
QtGui. Also this affects just two non-virtual inline methods, i.e. it
has no effect on library size.
Task-number: QTBUG-82785
Change-Id: Ic166f14fb1cf3e9dd789573a6b9db6a87fb50e10
Reviewed-by: Tasuku Suzuki <tasuku.suzuki@kdab.com>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Diffstat (limited to 'src/widgets/widgets/qtoolbox.cpp')
-rw-r--r-- | src/widgets/widgets/qtoolbox.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/widgets/widgets/qtoolbox.cpp b/src/widgets/widgets/qtoolbox.cpp index 5500104afb..57d26bb6ee 100644 --- a/src/widgets/widgets/qtoolbox.cpp +++ b/src/widgets/widgets/qtoolbox.cpp @@ -47,7 +47,9 @@ #include <qscrollarea.h> #include <qstyle.h> #include <qstyleoption.h> +#if QT_CONFIG(tooltip) #include <qtooltip.h> +#endif #include <qabstractbutton.h> #include <private/qmemory_p.h> @@ -96,7 +98,7 @@ public: inline void setText(const QString &text) { button->setText(text); } inline void setIcon(const QIcon &is) { button->setIcon(is); } -#ifndef QT_NO_TOOLTIP +#if QT_CONFIG(tooltip) inline void setToolTip(const QString &tip) { button->setToolTip(tip); } inline QString toolTip() const { return button->toolTip(); } #endif @@ -638,7 +640,7 @@ void QToolBox::setItemIcon(int index, const QIcon &icon) c->setIcon(icon); } -#ifndef QT_NO_TOOLTIP +#if QT_CONFIG(tooltip) /*! Sets the tooltip of the item at position \a index to \a toolTip. */ @@ -650,7 +652,7 @@ void QToolBox::setItemToolTip(int index, const QString &toolTip) if (c) c->setToolTip(toolTip); } -#endif // QT_NO_TOOLTIP +#endif // QT_CONFIG(tooltip) /*! Returns \c true if the item at position \a index is enabled; otherwise returns \c false. @@ -687,7 +689,7 @@ QIcon QToolBox::itemIcon(int index) const return (c ? c->icon() : QIcon()); } -#ifndef QT_NO_TOOLTIP +#if QT_CONFIG(tooltip) /*! Returns the tooltip of the item at position \a index, or an empty string if \a index is out of range. @@ -699,7 +701,7 @@ QString QToolBox::itemToolTip(int index) const const QToolBoxPrivate::Page *c = d->page(index); return (c ? c->toolTip() : QString()); } -#endif // QT_NO_TOOLTIP +#endif // QT_CONFIG(tooltip) /*! \reimp */ void QToolBox::showEvent(QShowEvent *e) |