summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/widgets/dialogs/qdialog.cpp4
-rw-r--r--src/widgets/kernel/qwhatsthis.cpp10
-rw-r--r--src/widgets/kernel/qwhatsthis.h4
-rw-r--r--src/widgets/util/qsystemtrayicon.cpp2
-rw-r--r--src/widgets/widgets/qlineedit.cpp2
-rw-r--r--src/widgets/widgets/qlineedit_p.cpp6
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)
}