From 21291d78c528b798252a046db4f17872132259f4 Mon Sep 17 00:00:00 2001 From: Valentin Fokin Date: Fri, 25 May 2018 15:40:36 +0200 Subject: Fix build with '-no-feature-action' configuration Task-number: QTBUG-68353 Change-Id: Ia949e4a72a363df5fba86504e5f7e3ce8a3ad347 Reviewed-by: Ulf Hermann Reviewed-by: Oswald Buddenhagen --- src/widgets/kernel/qwhatsthis.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/widgets/kernel/qwhatsthis.cpp') diff --git a/src/widgets/kernel/qwhatsthis.cpp b/src/widgets/kernel/qwhatsthis.cpp index 96d0cf61c4..1fa83d3238 100644 --- a/src/widgets/kernel/qwhatsthis.cpp +++ b/src/widgets/kernel/qwhatsthis.cpp @@ -48,7 +48,9 @@ #include "qscreen.h" #include "qpainter.h" #include "qtimer.h" +#if QT_CONFIG(action) #include "qaction.h" +#endif // QT_CONFIG(action) #include "qcursor.h" #include "qbitmap.h" #include "qtextdocument.h" @@ -366,7 +368,9 @@ class QWhatsThisPrivate : public QObject ~QWhatsThisPrivate(); static QWhatsThisPrivate *instance; bool eventFilter(QObject *, QEvent *) override; +#if QT_CONFIG(action) QPointer action; +#endif // QT_CONFIG(action) static void say(QWidget *, const QString &, int x = 0, int y = 0); static void notifyToplevels(QEvent *e); bool leaveOnMouseRelease; @@ -408,8 +412,10 @@ QWhatsThisPrivate::QWhatsThisPrivate() QWhatsThisPrivate::~QWhatsThisPrivate() { +#if QT_CONFIG(action) if (action) action->setChecked(false); +#endif // QT_CONFIG(action) #ifndef QT_NO_CURSOR QApplication::restoreOverrideCursor(); #endif @@ -485,6 +491,7 @@ bool QWhatsThisPrivate::eventFilter(QObject *o, QEvent *e) return true; } +#if QT_CONFIG(action) class QWhatsThisAction: public QAction { Q_OBJECT @@ -516,6 +523,7 @@ void QWhatsThisAction::actionTriggered() QWhatsThisPrivate::instance->action = this; } } +#endif // QT_CONFIG(action) /*! This function switches the user interface into "What's This?" @@ -672,10 +680,12 @@ void QWhatsThis::hideText() The returned QAction provides a convenient way to let users enter "What's This?" mode. */ +#if QT_CONFIG(action) QAction *QWhatsThis::createAction(QObject *parent) { return new QWhatsThisAction(parent); } +#endif // QT_CONFIG(action) QT_END_NAMESPACE -- cgit v1.2.3