diff options
author | Valentin Fokin <fokinv@inf.u-szeged.hu> | 2018-05-25 15:40:36 +0200 |
---|---|---|
committer | Valentin Fokin <fokinv@inf.u-szeged.hu> | 2018-07-12 08:57:09 +0000 |
commit | 21291d78c528b798252a046db4f17872132259f4 (patch) | |
tree | e8884b64b47f605cd32049a9eff1351422ff5e13 | |
parent | 9146432dc66d41f22548bbb425b61458d241d28e (diff) |
Fix build with '-no-feature-action' configuration
Task-number: QTBUG-68353
Change-Id: Ia949e4a72a363df5fba86504e5f7e3ce8a3ad347
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
-rw-r--r-- | src/widgets/dialogs/qdialog.cpp | 4 | ||||
-rw-r--r-- | src/widgets/kernel/qwhatsthis.cpp | 10 | ||||
-rw-r--r-- | src/widgets/kernel/qwhatsthis.h | 4 | ||||
-rw-r--r-- | src/widgets/util/qsystemtrayicon.cpp | 2 | ||||
-rw-r--r-- | src/widgets/widgets/qlineedit.cpp | 2 | ||||
-rw-r--r-- | src/widgets/widgets/qlineedit_p.cpp | 6 |
6 files changed, 28 insertions, 0 deletions
diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp index 4a0a26f69e..06f0393b4c 100644 --- a/src/widgets/dialogs/qdialog.cpp +++ b/src/widgets/dialogs/qdialog.cpp @@ -100,6 +100,10 @@ static inline int themeDialogType(const QDialog *dialog) if (qobject_cast<const QErrorMessage *>(dialog)) return QPlatformTheme::MessageDialog; #endif +#if !QT_CONFIG(filedialog) && !QT_CONFIG(colordialog) && !QT_CONFIG(fontdialog) && \ + !QT_CONFIG(messagebox) && !QT_CONFIG(errormessage) + Q_UNUSED(dialog); +#endif return -1; } 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<QAction> 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 diff --git a/src/widgets/kernel/qwhatsthis.h b/src/widgets/kernel/qwhatsthis.h index 1f0f82b2a2..59c0b01c9b 100644 --- a/src/widgets/kernel/qwhatsthis.h +++ b/src/widgets/kernel/qwhatsthis.h @@ -48,7 +48,9 @@ QT_REQUIRE_CONFIG(whatsthis); QT_BEGIN_NAMESPACE +#if QT_CONFIG(action) class QAction; +#endif // QT_CONFIG(action) class Q_WIDGETS_EXPORT QWhatsThis { @@ -62,7 +64,9 @@ public: static void showText(const QPoint &pos, const QString &text, QWidget *w = nullptr); static void hideText(); +#if QT_CONFIG(action) static QAction *createAction(QObject *parent = nullptr); +#endif // QT_CONFIG(action) }; diff --git a/src/widgets/util/qsystemtrayicon.cpp b/src/widgets/util/qsystemtrayicon.cpp index 86c824afdb..d15f5e5955 100644 --- a/src/widgets/util/qsystemtrayicon.cpp +++ b/src/widgets/util/qsystemtrayicon.cpp @@ -523,6 +523,8 @@ QBalloonTip::QBalloonTip(const QIcon &icon, const QString &title, closeButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); closeButton->setFixedSize(closeButtonSize, closeButtonSize); QObject::connect(closeButton, SIGNAL(clicked()), this, SLOT(close())); +#else + Q_UNUSED(closeButtonSize); #endif #if QT_CONFIG(label) diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp index 27a94740ac..190ff8d2c5 100644 --- a/src/widgets/widgets/qlineedit.cpp +++ b/src/widgets/widgets/qlineedit.cpp @@ -497,6 +497,8 @@ void QLineEdit::setClearButtonEnabled(bool enable) d->removeAction(clearAction); delete clearAction; } +#else + Q_UNUSED(enable); #endif // QT_CONFIG(action) } diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp index 17d7e298a1..33d542abc0 100644 --- a/src/widgets/widgets/qlineedit_p.cpp +++ b/src/widgets/widgets/qlineedit_p.cpp @@ -465,6 +465,8 @@ void QLineEditPrivate::setClearButtonEnabled(bool enabled) break; } } +#else + Q_UNUSED(enabled); #endif } @@ -482,6 +484,8 @@ void QLineEditPrivate::positionSideWidgets() #if QT_CONFIG(action) if (e.action->isVisible()) widgetGeometry.moveLeft(widgetGeometry.left() + delta); +#else + Q_UNUSED(delta); #endif } widgetGeometry.moveLeft(contentRect.width() - p.widgetWidth - p.margin); @@ -595,6 +599,8 @@ void QLineEditPrivate::removeAction(QAction *action) if (!hasSideWidgets()) // Last widget, remove connection QObject::disconnect(q, SIGNAL(textChanged(QString)), q, SLOT(_q_textChanged(QString))); q->update(); +#else + Q_UNUSED(action); #endif // QT_CONFIG(action) } |