summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r--src/widgets/kernel/qapplication.cpp6
-rw-r--r--src/widgets/kernel/qtooltip.cpp2
-rw-r--r--src/widgets/kernel/qtooltip.h6
-rw-r--r--src/widgets/kernel/qwidget.cpp10
-rw-r--r--src/widgets/kernel/qwidget.h4
-rw-r--r--src/widgets/kernel/qwidget_p.h2
6 files changed, 14 insertions, 16 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index c5577e2772b..27af52e1991 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -58,7 +58,9 @@
#include "qstyle.h"
#include "qstyleoption.h"
#include "qstylefactory.h"
+#if QT_CONFIG(tooltip)
#include "qtooltip.h"
+#endif
#include "qtranslator.h"
#include "qvariant.h"
#include "qwidget.h"
@@ -515,7 +517,7 @@ void QApplicationPrivate::init()
void qt_init_tooltip_palette()
{
-#ifndef QT_NO_TOOLTIP
+#if QT_CONFIG(tooltip)
if (const QPalette *toolTipPalette = QGuiApplicationPrivate::platformTheme()->palette(QPlatformTheme::ToolTipPalette))
QToolTip::setPalette(*toolTipPalette);
#endif
@@ -3157,7 +3159,7 @@ QT_WARNING_POP
break;
#endif // QT_CONFIG(tabletevent)
-#if !defined(QT_NO_TOOLTIP) || QT_CONFIG(whatsthis)
+#if QT_CONFIG(tooltip) || QT_CONFIG(whatsthis)
case QEvent::ToolTip:
case QEvent::WhatsThis:
case QEvent::QueryWhatsThis:
diff --git a/src/widgets/kernel/qtooltip.cpp b/src/widgets/kernel/qtooltip.cpp
index 661568dcadf..eda3be0ba34 100644
--- a/src/widgets/kernel/qtooltip.cpp
+++ b/src/widgets/kernel/qtooltip.cpp
@@ -57,7 +57,6 @@
#include <qpa/qplatformcursor.h>
#include <private/qstylesheetstyle_p.h>
-#ifndef QT_NO_TOOLTIP
#include <qlabel.h>
#include <QtWidgets/private/qlabel_p.h>
#include <QtGui/private/qhighdpiscaling_p.h>
@@ -628,4 +627,3 @@ void QToolTip::setFont(const QFont &font)
QT_END_NAMESPACE
#include "qtooltip.moc"
-#endif // QT_NO_TOOLTIP
diff --git a/src/widgets/kernel/qtooltip.h b/src/widgets/kernel/qtooltip.h
index 1b263a6629d..9f786bdee1d 100644
--- a/src/widgets/kernel/qtooltip.h
+++ b/src/widgets/kernel/qtooltip.h
@@ -43,11 +43,9 @@
#include <QtWidgets/qtwidgetsglobal.h>
#include <QtWidgets/qwidget.h>
+QT_REQUIRE_CONFIG(tooltip);
QT_BEGIN_NAMESPACE
-
-#ifndef QT_NO_TOOLTIP
-
class Q_WIDGETS_EXPORT QToolTip
{
QToolTip() = delete;
@@ -67,8 +65,6 @@ public:
static void setFont(const QFont &);
};
-#endif // QT_NO_TOOLTIP
-
QT_END_NAMESPACE
#endif // QTOOLTIP_H
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 4e391bf4ae0..8afacb9dab4 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -64,7 +64,9 @@
#include <qpa/qplatformwindow.h>
#include "private/qwidgetwindow_p.h"
#include "qpainter.h"
+#if QT_CONFIG(tooltip)
#include "qtooltip.h"
+#endif
#if QT_CONFIG(whatsthis)
#include "qwhatsthis.h"
#endif
@@ -147,7 +149,7 @@ QWidgetPrivate::QWidgetPrivate(int version)
#if !defined(QT_NO_IM)
, imHints(Qt::ImhNone)
#endif
-#ifndef QT_NO_TOOLTIP
+#if QT_CONFIG(tooltip)
, toolTipDuration(-1)
#endif
, directFontResolveMask(0)
@@ -8972,7 +8974,7 @@ bool QWidget::event(QEvent *event)
}
}
break;
-#ifndef QT_NO_TOOLTIP
+#if QT_CONFIG(tooltip)
case QEvent::ToolTip:
if (!d->toolTip.isEmpty())
QToolTip::showText(static_cast<QHelpEvent*>(event)->globalPos(), d->toolTip, this, QRect(), d->toolTipDuration);
@@ -11237,7 +11239,7 @@ void QWidgetPrivate::setWindowModified_helper()
}
}
-#ifndef QT_NO_TOOLTIP
+#if QT_CONFIG(tooltip)
/*!
\property QWidget::toolTip
@@ -11294,7 +11296,7 @@ int QWidget::toolTipDuration() const
return d->toolTipDuration;
}
-#endif // QT_NO_TOOLTIP
+#endif // QT_CONFIG(tooltip)
#if QT_CONFIG(statustip)
diff --git a/src/widgets/kernel/qwidget.h b/src/widgets/kernel/qwidget.h
index 8ca75b67b0e..d13e2732924 100644
--- a/src/widgets/kernel/qwidget.h
+++ b/src/widgets/kernel/qwidget.h
@@ -182,7 +182,7 @@ class Q_WIDGETS_EXPORT QWidget : public QObject, public QPaintDevice
Q_PROPERTY(QString windowIconText READ windowIconText WRITE setWindowIconText NOTIFY windowIconTextChanged) // deprecated
Q_PROPERTY(double windowOpacity READ windowOpacity WRITE setWindowOpacity)
Q_PROPERTY(bool windowModified READ isWindowModified WRITE setWindowModified)
-#ifndef QT_NO_TOOLTIP
+#if QT_CONFIG(tooltip)
Q_PROPERTY(QString toolTip READ toolTip WRITE setToolTip)
Q_PROPERTY(int toolTipDuration READ toolTipDuration WRITE setToolTipDuration)
#endif
@@ -382,7 +382,7 @@ public:
qreal windowOpacity() const;
bool isWindowModified() const;
-#ifndef QT_NO_TOOLTIP
+#if QT_CONFIG(tooltip)
void setToolTip(const QString &);
QString toolTip() const;
void setToolTipDuration(int msec);
diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h
index b71b72fe13d..3e52a6ad2f4 100644
--- a/src/widgets/kernel/qwidget_p.h
+++ b/src/widgets/kernel/qwidget_p.h
@@ -654,7 +654,7 @@ public:
// Implicit pointers (shared_null/shared_empty).
QRegion opaqueChildren;
QRegion dirty;
-#ifndef QT_NO_TOOLTIP
+#if QT_CONFIG(tooltip)
QString toolTip;
int toolTipDuration;
#endif