summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Binner <stephan.binner@basyskom.com>2017-06-10 07:09:50 +0200
committerStephan Binner <stephan.binner@basyskom.com>2017-06-29 02:22:34 +0000
commit150ee7f4f1fb6280aa7fd8c15b6d72d806c0f68c (patch)
treed5d0d4bf551358aa8d8d1ea6462e0605ccc6bfaf
parentfa7626713b3a943609453459190e16c49d61dfd3 (diff)
downloadqtbase-150ee7f4f1fb6280aa7fd8c15b6d72d806c0f68c.tar.gz
Convert features.whatsthis to QT_[REQUIRE_]CONFIG
Move feature definition to gui/configure.json Change-Id: I00b35c0e259d0a695d84a9bf6803eba74d41465a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
-rw-r--r--src/gui/configure.json6
-rw-r--r--src/gui/itemmodels/qstandarditemmodel.h4
-rw-r--r--src/gui/kernel/qevent.cpp4
-rw-r--r--src/gui/kernel/qevent.h2
-rw-r--r--src/gui/kernel/qwindowsysteminterface.cpp2
-rw-r--r--src/gui/kernel/qwindowsysteminterface.h2
-rw-r--r--src/widgets/accessible/complexwidgets.cpp2
-rw-r--r--src/widgets/accessible/qaccessiblewidget.cpp4
-rw-r--r--src/widgets/configure.json7
-rw-r--r--src/widgets/dialogs/qdialog.cpp6
-rw-r--r--src/widgets/itemviews/qabstractitemdelegate.cpp4
-rw-r--r--src/widgets/itemviews/qabstractitemview.cpp1
-rw-r--r--src/widgets/itemviews/qheaderview.cpp6
-rw-r--r--src/widgets/itemviews/qlistwidget.h4
-rw-r--r--src/widgets/itemviews/qtablewidget.h4
-rw-r--r--src/widgets/itemviews/qtreewidget.h4
-rw-r--r--src/widgets/kernel/kernel.pri7
-rw-r--r--src/widgets/kernel/qapplication.cpp8
-rw-r--r--src/widgets/kernel/qshortcut.cpp4
-rw-r--r--src/widgets/kernel/qwhatsthis.cpp4
-rw-r--r--src/widgets/kernel/qwhatsthis.h7
-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
-rw-r--r--src/widgets/statemachine/qguistatemachine.cpp4
-rw-r--r--src/widgets/widgets/qlineedit.cpp1
-rw-r--r--src/widgets/widgets/qmdisubwindow.cpp4
-rw-r--r--src/widgets/widgets/qmenu.cpp16
-rw-r--r--src/widgets/widgets/qmenubar.cpp6
-rw-r--r--src/widgets/widgets/qtabbar.cpp10
-rw-r--r--src/widgets/widgets/qtabbar.h2
-rw-r--r--src/widgets/widgets/qtabbar_p.h2
-rw-r--r--src/widgets/widgets/qtabwidget.cpp4
-rw-r--r--src/widgets/widgets/qtabwidget.h2
-rw-r--r--src/widgets/widgets/qtextbrowser.cpp4
-rw-r--r--src/widgets/widgets/qtoolbutton.cpp2
36 files changed, 90 insertions, 75 deletions
diff --git a/src/gui/configure.json b/src/gui/configure.json
index 1b2b0775a2..343cfcf798 100644
--- a/src/gui/configure.json
+++ b/src/gui/configure.json
@@ -1020,6 +1020,12 @@
"section": "Utilities",
"condition": "!config.integrity",
"output": [ "privateFeature" ]
+ },
+ "whatsthis": {
+ "label": "QWhatsThis",
+ "purpose": "Supports displaying \"What's this\" help.",
+ "section": "Widget Support",
+ "output": [ "publicFeature", "feature" ]
}
},
diff --git a/src/gui/itemmodels/qstandarditemmodel.h b/src/gui/itemmodels/qstandarditemmodel.h
index a9cde106c1..73107b827c 100644
--- a/src/gui/itemmodels/qstandarditemmodel.h
+++ b/src/gui/itemmodels/qstandarditemmodel.h
@@ -95,7 +95,7 @@ public:
inline void setStatusTip(const QString &statusTip);
#endif
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
inline QString whatsThis() const {
return qvariant_cast<QString>(data(Qt::WhatsThisRole));
}
@@ -272,7 +272,7 @@ inline void QStandardItem::setStatusTip(const QString &astatusTip)
{ setData(astatusTip, Qt::StatusTipRole); }
#endif
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
inline void QStandardItem::setWhatsThis(const QString &awhatsThis)
{ setData(awhatsThis, Qt::WhatsThisRole); }
#endif
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index 5ae76abb55..680acb16e7 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -3325,7 +3325,7 @@ QStatusTipEvent::~QStatusTipEvent()
#endif // QT_NO_STATUSTIP
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
/*!
\class QWhatsThisClickedEvent
@@ -3362,7 +3362,7 @@ QWhatsThisClickedEvent::~QWhatsThisClickedEvent()
This?" text.
*/
-#endif // QT_NO_WHATSTHIS
+#endif // QT_CONFIG(whatsthis)
#ifndef QT_NO_ACTION
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h
index 18f8718330..b8f86acd75 100644
--- a/src/gui/kernel/qevent.h
+++ b/src/gui/kernel/qevent.h
@@ -699,7 +699,7 @@ private:
};
#endif
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
class Q_GUI_EXPORT QWhatsThisClickedEvent : public QEvent
{
public:
diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp
index 3982b5568e..b8299e2cb8 100644
--- a/src/gui/kernel/qwindowsysteminterface.cpp
+++ b/src/gui/kernel/qwindowsysteminterface.cpp
@@ -860,7 +860,7 @@ void QWindowSystemInterface::handleContextMenuEvent(QWindow *window, bool mouseT
}
#endif
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
void QWindowSystemInterface::handleEnterWhatsThisEvent()
{
QWindowSystemInterfacePrivate::WindowSystemEvent *e =
diff --git a/src/gui/kernel/qwindowsysteminterface.h b/src/gui/kernel/qwindowsysteminterface.h
index aadf63782f..e582787dd9 100644
--- a/src/gui/kernel/qwindowsysteminterface.h
+++ b/src/gui/kernel/qwindowsysteminterface.h
@@ -236,7 +236,7 @@ public:
const QPoint &pos, const QPoint &globalPos,
Qt::KeyboardModifiers modifiers);
#endif
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
static void handleEnterWhatsThisEvent();
#endif
diff --git a/src/widgets/accessible/complexwidgets.cpp b/src/widgets/accessible/complexwidgets.cpp
index 397a58a5d4..4770c513cf 100644
--- a/src/widgets/accessible/complexwidgets.cpp
+++ b/src/widgets/accessible/complexwidgets.cpp
@@ -51,7 +51,9 @@
#include <qstyle.h>
#include <qstyleoption.h>
#include <qtooltip.h>
+#if QT_CONFIG(whatsthis)
#include <qwhatsthis.h>
+#endif
#include <qtreeview.h>
#include <private/qtabbar_p.h>
#include <QAbstractScrollArea>
diff --git a/src/widgets/accessible/qaccessiblewidget.cpp b/src/widgets/accessible/qaccessiblewidget.cpp
index d5f7449e57..f18930f273 100644
--- a/src/widgets/accessible/qaccessiblewidget.cpp
+++ b/src/widgets/accessible/qaccessiblewidget.cpp
@@ -48,7 +48,9 @@
#include "qlabel.h"
#endif
#include "qtooltip.h"
+#if QT_CONFIG(whatsthis)
#include "qwhatsthis.h"
+#endif
#include "qwidget.h"
#include "qdebug.h"
#include <qmath.h>
@@ -436,7 +438,7 @@ QString QAccessibleWidget::text(QAccessible::Text t) const
#endif
break;
case QAccessible::Help:
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
str = widget()->whatsThis();
#endif
break;
diff --git a/src/widgets/configure.json b/src/widgets/configure.json
index f0fce9b52b..7e2f8e1552 100644
--- a/src/widgets/configure.json
+++ b/src/widgets/configure.json
@@ -432,13 +432,6 @@
"section": "Widgets",
"output": [ "publicFeature", "feature" ]
},
- "whatsthis": {
- "label": "QWhatsThis",
- "purpose": "Supports displaying \"What's this\" help.",
- "section": "Widgets",
- "condition": "features.toolbutton",
- "output": [ "publicFeature", "feature" ]
- },
"sizegrip": {
"label": "QSizeGrip",
"purpose": "Provides corner-grips for resizing top-level windows.",
diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp
index 60e1c43721..a6e9cda8ce 100644
--- a/src/widgets/dialogs/qdialog.cpp
+++ b/src/widgets/dialogs/qdialog.cpp
@@ -46,7 +46,9 @@
#include "qapplication.h"
#include "qlayout.h"
#include "qsizegrip.h"
+#if QT_CONFIG(whatsthis)
#include "qwhatsthis.h"
+#endif
#include "qmenu.h"
#include "qcursor.h"
#include "qmessagebox.h"
@@ -607,7 +609,7 @@ bool QDialog::eventFilter(QObject *o, QEvent *e)
/*! \reimp */
void QDialog::contextMenuEvent(QContextMenuEvent *e)
{
-#if defined(QT_NO_WHATSTHIS) || defined(QT_NO_MENU)
+#if !QT_CONFIG(whatsthis) || defined(QT_NO_MENU)
Q_UNUSED(e);
#else
QWidget *w = childAt(e->pos());
@@ -672,7 +674,7 @@ void QDialog::keyPressEvent(QKeyEvent *e)
/*! \reimp */
void QDialog::closeEvent(QCloseEvent *e)
{
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
if (isModal() && QWhatsThis::inWhatsThisMode())
QWhatsThis::leaveWhatsThisMode();
#endif
diff --git a/src/widgets/itemviews/qabstractitemdelegate.cpp b/src/widgets/itemviews/qabstractitemdelegate.cpp
index f7c170f0bb..5b119cc79e 100644
--- a/src/widgets/itemviews/qabstractitemdelegate.cpp
+++ b/src/widgets/itemviews/qabstractitemdelegate.cpp
@@ -43,7 +43,9 @@
#include <qabstractitemmodel.h>
#include <qabstractitemview.h>
#include <qfontmetrics.h>
+#if QT_CONFIG(whatsthis)
#include <qwhatsthis.h>
+#endif
#include <qtooltip.h>
#include <qevent.h>
#include <qstring.h>
@@ -393,7 +395,7 @@ bool QAbstractItemDelegate::helpEvent(QHelpEvent *event,
}
break;}
#endif
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
case QEvent::QueryWhatsThis: {
if (index.data(Qt::WhatsThisRole).isValid())
return true;
diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp
index d24456edef..e8db228256 100644
--- a/src/widgets/itemviews/qabstractitemview.cpp
+++ b/src/widgets/itemviews/qabstractitemview.cpp
@@ -48,7 +48,6 @@
#include <qdrag.h>
#include <qevent.h>
#include <qscrollbar.h>
-#include <qwhatsthis.h>
#include <qtooltip.h>
#include <qdatetime.h>
#include <qlineedit.h>
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp
index 76f80c680e..c31b00959d 100644
--- a/src/widgets/itemviews/qheaderview.cpp
+++ b/src/widgets/itemviews/qheaderview.cpp
@@ -47,7 +47,9 @@
#include <qpainter.h>
#include <qscrollbar.h>
#include <qtooltip.h>
+#if QT_CONFIG(whatsthis)
#include <qwhatsthis.h>
+#endif
#include <qstyle.h>
#include <qstyleoption.h>
#include <qvector.h>
@@ -2641,7 +2643,7 @@ bool QHeaderView::viewportEvent(QEvent *e)
}
break; }
#endif
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
case QEvent::QueryWhatsThis: {
QHelpEvent *he = static_cast<QHelpEvent*>(e);
int logical = logicalIndexAt(he->pos());
@@ -2661,7 +2663,7 @@ bool QHeaderView::viewportEvent(QEvent *e)
}
}
break; }
-#endif // QT_NO_WHATSTHIS
+#endif // QT_CONFIG(whatsthis)
#ifndef QT_NO_STATUSTIP
case QEvent::StatusTip: {
QHelpEvent *he = static_cast<QHelpEvent*>(e);
diff --git a/src/widgets/itemviews/qlistwidget.h b/src/widgets/itemviews/qlistwidget.h
index 4e67486708..8471645fb0 100644
--- a/src/widgets/itemviews/qlistwidget.h
+++ b/src/widgets/itemviews/qlistwidget.h
@@ -99,7 +99,7 @@ public:
inline void setToolTip(const QString &toolTip);
#endif
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
inline QString whatsThis() const
{ return data(Qt::WhatsThisRole).toString(); }
inline void setWhatsThis(const QString &whatsThis);
@@ -179,7 +179,7 @@ inline void QListWidgetItem::setToolTip(const QString &atoolTip)
{ setData(Qt::ToolTipRole, atoolTip); }
#endif
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
inline void QListWidgetItem::setWhatsThis(const QString &awhatsThis)
{ setData(Qt::WhatsThisRole, awhatsThis); }
#endif
diff --git a/src/widgets/itemviews/qtablewidget.h b/src/widgets/itemviews/qtablewidget.h
index d3bcba57dd..3fecf194e4 100644
--- a/src/widgets/itemviews/qtablewidget.h
+++ b/src/widgets/itemviews/qtablewidget.h
@@ -116,7 +116,7 @@ public:
inline void setToolTip(const QString &toolTip);
#endif
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
inline QString whatsThis() const
{ return data(Qt::WhatsThisRole).toString(); }
inline void setWhatsThis(const QString &whatsThis);
@@ -196,7 +196,7 @@ inline void QTableWidgetItem::setToolTip(const QString &atoolTip)
{ setData(Qt::ToolTipRole, atoolTip); }
#endif
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
inline void QTableWidgetItem::setWhatsThis(const QString &awhatsThis)
{ setData(Qt::WhatsThisRole, awhatsThis); }
#endif
diff --git a/src/widgets/itemviews/qtreewidget.h b/src/widgets/itemviews/qtreewidget.h
index 27b7fa4fb1..d258f76621 100644
--- a/src/widgets/itemviews/qtreewidget.h
+++ b/src/widgets/itemviews/qtreewidget.h
@@ -119,7 +119,7 @@ public:
inline void setToolTip(int column, const QString &toolTip);
#endif
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
inline QString whatsThis(int column) const
{ return data(column, Qt::WhatsThisRole).toString(); }
inline void setWhatsThis(int column, const QString &whatsThis);
@@ -234,7 +234,7 @@ inline void QTreeWidgetItem::setToolTip(int column, const QString &atoolTip)
{ setData(column, Qt::ToolTipRole, atoolTip); }
#endif
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
inline void QTreeWidgetItem::setWhatsThis(int column, const QString &awhatsThis)
{ setData(column, Qt::WhatsThisRole, awhatsThis); }
#endif
diff --git a/src/widgets/kernel/kernel.pri b/src/widgets/kernel/kernel.pri
index c91be918b6..3e3c795839 100644
--- a/src/widgets/kernel/kernel.pri
+++ b/src/widgets/kernel/kernel.pri
@@ -24,7 +24,6 @@ HEADERS += \
kernel/qsizepolicy.h \
kernel/qstackedlayout.h \
kernel/qtooltip.h \
- kernel/qwhatsthis.h \
kernel/qwidget.h \
kernel/qwidget_p.h \
kernel/qwidgetaction.h \
@@ -52,7 +51,6 @@ SOURCES += \
kernel/qsizepolicy.cpp \
kernel/qstackedlayout.cpp \
kernel/qtooltip.cpp \
- kernel/qwhatsthis.cpp \
kernel/qwidget.cpp \
kernel/qwidgetaction.cpp \
kernel/qgesture.cpp \
@@ -87,3 +85,8 @@ qtConfig(formlayout) {
HEADERS += kernel/qformlayout.h
SOURCES += kernel/qformlayout.cpp
}
+
+qtConfig(whatsthis) {
+ HEADERS += kernel/qwhatsthis.h
+ SOURCES += kernel/qwhatsthis.cpp
+}
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index fe7a9c2500..01bd1c5033 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -73,7 +73,7 @@
#include <QtGui/private/qwindow_p.h>
#include <QtGui/qtouchdevice.h>
#include <qpa/qplatformtheme.h>
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
#include <QtWidgets/QWhatsThis>
#endif
@@ -1999,7 +1999,7 @@ bool QApplication::event(QEvent *e)
} else if (te->timerId() == d->toolTipFallAsleep.timerId()) {
d->toolTipFallAsleep.stop();
}
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
} else if (e->type() == QEvent::EnterWhatsThisMode) {
QWhatsThis::enterWhatsThisMode();
return true;
@@ -3381,7 +3381,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
break;
#endif // QT_CONFIG(tabletevent)
-#if !defined(QT_NO_TOOLTIP) || !defined(QT_NO_WHATSTHIS)
+#if !defined(QT_NO_TOOLTIP) || QT_CONFIG(whatsthis)
case QEvent::ToolTip:
case QEvent::WhatsThis:
case QEvent::QueryWhatsThis:
@@ -3406,7 +3406,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
}
break;
#endif
-#if !defined(QT_NO_STATUSTIP) || !defined(QT_NO_WHATSTHIS)
+#if !defined(QT_NO_STATUSTIP) || QT_CONFIG(whatsthis)
case QEvent::StatusTip:
case QEvent::WhatsThisClicked:
{
diff --git a/src/widgets/kernel/qshortcut.cpp b/src/widgets/kernel/qshortcut.cpp
index be5788274e..a09cba0ddc 100644
--- a/src/widgets/kernel/qshortcut.cpp
+++ b/src/widgets/kernel/qshortcut.cpp
@@ -42,7 +42,9 @@
#ifndef QT_NO_SHORTCUT
#include <qevent.h>
+#if QT_CONFIG(whatsthis)
#include <qwhatsthis.h>
+#endif
#include <qmenu.h>
#include <qmenubar.h>
#include <qapplication.h>
@@ -641,7 +643,7 @@ bool QShortcut::event(QEvent *e)
if (d->sc_enabled && e->type() == QEvent::Shortcut) {
QShortcutEvent *se = static_cast<QShortcutEvent *>(e);
if (se->shortcutId() == d->sc_id && se->key() == d->sc_sequence){
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
if (QWhatsThis::inWhatsThisMode()) {
QWhatsThis::showText(QCursor::pos(), d->sc_whatsthis);
handled = true;
diff --git a/src/widgets/kernel/qwhatsthis.cpp b/src/widgets/kernel/qwhatsthis.cpp
index 4286019717..e2cfebb8a1 100644
--- a/src/widgets/kernel/qwhatsthis.cpp
+++ b/src/widgets/kernel/qwhatsthis.cpp
@@ -38,7 +38,6 @@
****************************************************************************/
#include "qwhatsthis.h"
-#ifndef QT_NO_WHATSTHIS
#include "qpointer.h"
#include "qapplication.h"
#include <private/qguiapplication_p.h>
@@ -54,7 +53,6 @@
#include "qtextdocument.h"
#include <qpa/qplatformtheme.h>
#include "private/qtextdocumentlayout_p.h"
-#include "qtoolbutton.h"
#include "qdebug.h"
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
@@ -681,5 +679,3 @@ QAction *QWhatsThis::createAction(QObject *parent)
QT_END_NAMESPACE
#include "qwhatsthis.moc"
-
-#endif // QT_NO_WHATSTHIS
diff --git a/src/widgets/kernel/qwhatsthis.h b/src/widgets/kernel/qwhatsthis.h
index 746fd3ff22..3211796d3e 100644
--- a/src/widgets/kernel/qwhatsthis.h
+++ b/src/widgets/kernel/qwhatsthis.h
@@ -44,10 +44,9 @@
#include <QtCore/qobject.h>
#include <QtGui/qcursor.h>
-QT_BEGIN_NAMESPACE
-
+QT_REQUIRE_CONFIG(whatsthis);
-#ifndef QT_NO_WHATSTHIS
+QT_BEGIN_NAMESPACE
class QAction;
@@ -67,8 +66,6 @@ public:
};
-#endif // QT_NO_WHATSTHIS
-
QT_END_NAMESPACE
#endif // QWHATSTHIS_H
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index deb638f410..3104f72e82 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -71,7 +71,9 @@
#include "private/qwidgetwindow_p.h"
#include "qpainter.h"
#include "qtooltip.h"
+#if QT_CONFIG(whatsthis)
#include "qwhatsthis.h"
+#endif
#include "qdebug.h"
#include "private/qstylesheetstyle_p.h"
#include "private/qstyle_p.h"
@@ -8853,7 +8855,7 @@ bool QWidget::event(QEvent *event)
}
}
#endif
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
if (!k->isAccepted()
&& k->modifiers() & Qt::ShiftModifier && k->key() == Qt::Key_F1
&& d->whatsThis.size()) {
@@ -9152,7 +9154,7 @@ bool QWidget::event(QEvent *event)
event->ignore();
break;
#endif
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
case QEvent::WhatsThis:
if (d->whatsThis.size())
QWhatsThis::showText(static_cast<QHelpEvent *>(event)->globalPos(), d->whatsThis, this);
@@ -11579,7 +11581,7 @@ QString QWidget::statusTip() const
}
#endif // QT_NO_STATUSTIP
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
/*!
\property QWidget::whatsThis
@@ -11600,7 +11602,7 @@ QString QWidget::whatsThis() const
Q_D(const QWidget);
return d->whatsThis;
}
-#endif // QT_NO_WHATSTHIS
+#endif // QT_CONFIG(whatsthis)
#ifndef QT_NO_ACCESSIBILITY
/*!
diff --git a/src/widgets/kernel/qwidget.h b/src/widgets/kernel/qwidget.h
index 59e2ddd24d..48bc120324 100644
--- a/src/widgets/kernel/qwidget.h
+++ b/src/widgets/kernel/qwidget.h
@@ -186,7 +186,7 @@ class Q_WIDGETS_EXPORT QWidget : public QObject, public QPaintDevice
#ifndef QT_NO_STATUSTIP
Q_PROPERTY(QString statusTip READ statusTip WRITE setStatusTip)
#endif
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
Q_PROPERTY(QString whatsThis READ whatsThis WRITE setWhatsThis)
#endif
#ifndef QT_NO_ACCESSIBILITY
@@ -390,7 +390,7 @@ public:
void setStatusTip(const QString &);
QString statusTip() const;
#endif
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
void setWhatsThis(const QString &);
QString whatsThis() const;
#endif
diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h
index 68e063c25a..cc0940fc08 100644
--- a/src/widgets/kernel/qwidget_p.h
+++ b/src/widgets/kernel/qwidget_p.h
@@ -697,7 +697,7 @@ public:
#ifndef QT_NO_STATUSTIP
QString statusTip;
#endif
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
QString whatsThis;
#endif
#ifndef QT_NO_ACCESSIBILITY
diff --git a/src/widgets/statemachine/qguistatemachine.cpp b/src/widgets/statemachine/qguistatemachine.cpp
index 26d0a9615f..bbe723a55a 100644
--- a/src/widgets/statemachine/qguistatemachine.cpp
+++ b/src/widgets/statemachine/qguistatemachine.cpp
@@ -243,10 +243,10 @@ static QEvent *cloneEvent(QEvent *e)
case QEvent::ShortcutOverride:
return new QKeyEvent(*static_cast<QKeyEvent*>(e));
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
case QEvent::WhatsThisClicked:
return new QWhatsThisClickedEvent(*static_cast<QWhatsThisClickedEvent*>(e));
-#endif //QT_NO_WHATSTHIS
+#endif // QT_CONFIG(whatsthis)
#ifndef QT_NO_TOOLBAR
case QEvent::ToolBarChange:
diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp
index 7e24704de3..863c1e9bbe 100644
--- a/src/widgets/widgets/qlineedit.cpp
+++ b/src/widgets/widgets/qlineedit.cpp
@@ -60,7 +60,6 @@
#include "qvalidator.h"
#include "qvariant.h"
#include "qvector.h"
-#include "qwhatsthis.h"
#include "qdebug.h"
#include "qtextedit.h"
#include <private/qtextedit_p.h>
diff --git a/src/widgets/widgets/qmdisubwindow.cpp b/src/widgets/widgets/qmdisubwindow.cpp
index a8cdca1719..b4f2c97e04 100644
--- a/src/widgets/widgets/qmdisubwindow.cpp
+++ b/src/widgets/widgets/qmdisubwindow.cpp
@@ -153,7 +153,9 @@
#include <QStylePainter>
#include <QVBoxLayout>
#include <QMouseEvent>
+#if QT_CONFIG(whatsthis)
#include <QWhatsThis>
+#endif
#include <QToolTip>
#include <QMainWindow>
#include <QScrollBar>
@@ -1490,7 +1492,7 @@ void QMdiSubWindowPrivate::processClickedSubControl()
Q_Q(QMdiSubWindow);
switch (activeSubControl) {
case QStyle::SC_TitleBarContextHelpButton:
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
QWhatsThis::enterWhatsThisMode();
#endif
break;
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index 95bb976566..0b874cb09a 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -59,7 +59,7 @@
#ifndef QT_NO_EFFECTS
# include <private/qeffects_p.h>
#endif
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
# include <qwhatsthis.h>
#endif
@@ -187,7 +187,7 @@ private:
void QMenuPrivate::init()
{
Q_Q(QMenu);
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
q->setAttribute(Qt::WA_CustomWhatsThis);
#endif
q->setAttribute(Qt::WA_X11NetWmWindowTypePopupMenu);
@@ -1327,12 +1327,12 @@ void QMenuPrivate::activateCausedStack(const QVector<QPointer<QWidget> > &caused
void QMenuPrivate::activateAction(QAction *action, QAction::ActionEvent action_e, bool self)
{
Q_Q(QMenu);
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
bool inWhatsThisMode = QWhatsThis::inWhatsThisMode();
#endif
if (!action || !q->isEnabled()
|| (action_e == QAction::Trigger
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
&& !inWhatsThisMode
#endif
&& (action->isSeparator() ||!action->isEnabled())))
@@ -1343,7 +1343,7 @@ void QMenuPrivate::activateAction(QAction *action, QAction::ActionEvent action_e
*/
const QVector<QPointer<QWidget> > causedStack = calcCausedStack();
if (action_e == QAction::Trigger) {
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
if (!inWhatsThisMode)
actionAboutToTrigger = action;
#endif
@@ -1362,7 +1362,7 @@ void QMenuPrivate::activateAction(QAction *action, QAction::ActionEvent action_e
}
}
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
if (inWhatsThisMode) {
QString s = action->whatsThis();
if (s.isEmpty())
@@ -2971,7 +2971,7 @@ QMenu::event(QEvent *e)
}
break;
#endif // QT_NO_TOOLTIP
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
case QEvent::QueryWhatsThis:
e->setAccepted(d->whatsThis.size());
if (QAction *action = d->actionAt(static_cast<QHelpEvent*>(e)->pos())) {
@@ -3233,7 +3233,7 @@ void QMenu::keyPressEvent(QKeyEvent *e)
key_consumed = true;
break; }
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
case Qt::Key_F1:
if (!d->currentAction || d->currentAction->whatsThis().isNull())
break;
diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp
index c16b2a5ac1..8ec2a3ed94 100644
--- a/src/widgets/widgets/qmenubar.cpp
+++ b/src/widgets/widgets/qmenubar.cpp
@@ -52,7 +52,9 @@
#include <qmainwindow.h>
#include <qtoolbar.h>
#include <qtoolbutton.h>
+#if QT_CONFIG(whatsthis)
#include <qwhatsthis.h>
+#endif
#include <qpa/qplatformtheme.h>
#include "private/qguiapplication_p.h"
#include "qpa/qplatformintegration.h"
@@ -1013,7 +1015,7 @@ void QMenuBar::mousePressEvent(QMouseEvent *e)
QAction *action = d->actionAt(e->pos());
if (!action || !d->isVisible(action) || !action->isEnabled()) {
d->setCurrentAction(0);
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
if (QWhatsThis::inWhatsThisMode())
QWhatsThis::showText(e->globalPos(), d->whatsThis, this);
#endif
@@ -1432,7 +1434,7 @@ bool QMenuBar::event(QEvent *e)
}
break;
#endif
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
case QEvent::QueryWhatsThis:
e->setAccepted(d->whatsThis.size());
if (QAction *action = d->actionAt(static_cast<QHelpEvent*>(e)->pos())) {
diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp
index 85bc9a4a09..9e803f4388 100644
--- a/src/widgets/widgets/qtabbar.cpp
+++ b/src/widgets/widgets/qtabbar.cpp
@@ -49,7 +49,9 @@
#include "qstylepainter.h"
#include "qtabwidget.h"
#include "qtooltip.h"
+#if QT_CONFIG(whatsthis)
#include "qwhatsthis.h"
+#endif
#include "private/qtextengine_p.h"
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
@@ -1220,7 +1222,7 @@ QString QTabBar::tabToolTip(int index) const
}
#endif // QT_NO_TOOLTIP
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
/*!
\since 4.1
@@ -1248,7 +1250,7 @@ QString QTabBar::tabWhatsThis(int index) const
return QString();
}
-#endif // QT_NO_WHATSTHIS
+#endif // QT_CONFIG(whatsthis)
/*!
Sets the data of the tab at position \a index to \a data.
@@ -1628,7 +1630,7 @@ bool QTabBar::event(QEvent *event)
}
}
#endif // QT_NO_TOOLTIP
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
} else if (event->type() == QEvent::QueryWhatsThis) {
const QTabBarPrivate::Tab *tab = d->at(d->indexAtPos(static_cast<QHelpEvent*>(event)->pos()));
if (!tab || tab->whatsThis.isEmpty())
@@ -1642,7 +1644,7 @@ bool QTabBar::event(QEvent *event)
return true;
}
}
-#endif // QT_NO_WHATSTHIS
+#endif // QT_CONFIG(whatsthis)
#ifndef QT_NO_SHORTCUT
} else if (event->type() == QEvent::Shortcut) {
QShortcutEvent *se = static_cast<QShortcutEvent *>(event);
diff --git a/src/widgets/widgets/qtabbar.h b/src/widgets/widgets/qtabbar.h
index c7d9f95d93..2a27a98661 100644
--- a/src/widgets/widgets/qtabbar.h
+++ b/src/widgets/widgets/qtabbar.h
@@ -123,7 +123,7 @@ public:
QString tabToolTip(int index) const;
#endif
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
void setTabWhatsThis(int index, const QString &text);
QString tabWhatsThis(int index) const;
#endif
diff --git a/src/widgets/widgets/qtabbar_p.h b/src/widgets/widgets/qtabbar_p.h
index 7c653a95e9..354c2fc05a 100644
--- a/src/widgets/widgets/qtabbar_p.h
+++ b/src/widgets/widgets/qtabbar_p.h
@@ -118,7 +118,7 @@ public:
#ifndef QT_NO_TOOLTIP
QString toolTip;
#endif
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
QString whatsThis;
#endif
QIcon icon;
diff --git a/src/widgets/widgets/qtabwidget.cpp b/src/widgets/widgets/qtabwidget.cpp
index 7c75f859ed..c84c78275d 100644
--- a/src/widgets/widgets/qtabwidget.cpp
+++ b/src/widgets/widgets/qtabwidget.cpp
@@ -1163,7 +1163,7 @@ QString QTabWidget::tabToolTip(int index) const
}
#endif // QT_NO_TOOLTIP
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
/*!
\since 4.1
@@ -1187,7 +1187,7 @@ QString QTabWidget::tabWhatsThis(int index) const
Q_D(const QTabWidget);
return d->tabs->tabWhatsThis(index);
}
-#endif // QT_NO_WHATSTHIS
+#endif // QT_CONFIG(whatsthis)
/*!
This virtual handler is called after a new tab was added or
diff --git a/src/widgets/widgets/qtabwidget.h b/src/widgets/widgets/qtabwidget.h
index 59fcea223f..7d8864241a 100644
--- a/src/widgets/widgets/qtabwidget.h
+++ b/src/widgets/widgets/qtabwidget.h
@@ -94,7 +94,7 @@ public:
QString tabToolTip(int index) const;
#endif
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
void setTabWhatsThis(int index, const QString &text);
QString tabWhatsThis(int index) const;
#endif
diff --git a/src/widgets/widgets/qtextbrowser.cpp b/src/widgets/widgets/qtextbrowser.cpp
index df92fc0e1e..902a6afb8a 100644
--- a/src/widgets/widgets/qtextbrowser.cpp
+++ b/src/widgets/widgets/qtextbrowser.cpp
@@ -52,7 +52,9 @@
#include <qtextcodec.h>
#include <qpainter.h>
#include <qdir.h>
+#if QT_CONFIG(whatsthis)
#include <qwhatsthis.h>
+#endif
#include <qtextobject.h>
#include <qdesktopservices.h>
@@ -307,7 +309,7 @@ void QTextBrowserPrivate::setSource(const QUrl &url)
#ifndef QT_NO_CURSOR
QApplication::restoreOverrideCursor();
#endif
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
QWhatsThis::showText(QCursor::pos(), txt, q);
#endif
return;
diff --git a/src/widgets/widgets/qtoolbutton.cpp b/src/widgets/widgets/qtoolbutton.cpp
index 80a061e6d5..1d06f57d7b 100644
--- a/src/widgets/widgets/qtoolbutton.cpp
+++ b/src/widgets/widgets/qtoolbutton.cpp
@@ -922,7 +922,7 @@ void QToolButton::setDefaultAction(QAction *action)
#ifndef QT_NO_STATUSTIP
setStatusTip(action->statusTip());
#endif
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
setWhatsThis(action->whatsThis());
#endif
#ifndef QT_NO_MENU