summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-07-04 15:19:36 +0200
committerLiang Qi <liang.qi@qt.io>2017-07-04 16:05:53 +0200
commitc2b224a758ce7e6dcf3748444fa8e29ab81904be (patch)
tree277cb99bf054190c935579142506caa4ec9861dd /src/widgets
parent10de063ff12cdba07b4620182aced8ed05ee3505 (diff)
parenteaee1209f0ead5be786e81db8aee604ccfea85b0 (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts: src/corelib/io/qprocess_unix.cpp src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/widgets/util/util.pri tests/auto/corelib/thread/qthread/qthread.pro tests/auto/corelib/thread/qthread/tst_qthread.cpp Change-Id: I5c45ab54d46d3c75a5c6c116777ebf5bc47a871b
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/accessible/complexwidgets.cpp2
-rw-r--r--src/widgets/accessible/itemviews.cpp2
-rw-r--r--src/widgets/accessible/qaccessiblewidget.cpp4
-rw-r--r--src/widgets/configure.json7
-rw-r--r--src/widgets/dialogs/dialogs.pri98
-rw-r--r--src/widgets/dialogs/qcolordialog.cpp5
-rw-r--r--src/widgets/dialogs/qcolordialog.h7
-rw-r--r--src/widgets/dialogs/qdialog.cpp23
-rw-r--r--src/widgets/dialogs/qerrormessage.cpp8
-rw-r--r--src/widgets/dialogs/qerrormessage.h7
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp44
-rw-r--r--src/widgets/dialogs/qfiledialog.h8
-rw-r--r--src/widgets/dialogs/qfiledialog_p.h12
-rw-r--r--src/widgets/dialogs/qfileinfogatherer.cpp4
-rw-r--r--src/widgets/dialogs/qfileinfogatherer_p.h7
-rw-r--r--src/widgets/dialogs/qfilesystemmodel.cpp10
-rw-r--r--src/widgets/dialogs/qfilesystemmodel.h8
-rw-r--r--src/widgets/dialogs/qfilesystemmodel_p.h6
-rw-r--r--src/widgets/dialogs/qfscompleter_p.h6
-rw-r--r--src/widgets/dialogs/qinputdialog.cpp6
-rw-r--r--src/widgets/dialogs/qinputdialog.h7
-rw-r--r--src/widgets/dialogs/qmessagebox.cpp4
-rw-r--r--src/widgets/dialogs/qmessagebox.h7
-rw-r--r--src/widgets/dialogs/qprogressdialog.cpp4
-rw-r--r--src/widgets/dialogs/qprogressdialog.h7
-rw-r--r--src/widgets/dialogs/qsidebar.cpp4
-rw-r--r--src/widgets/dialogs/qsidebar_p.h6
-rw-r--r--src/widgets/dialogs/qwizard.cpp4
-rw-r--r--src/widgets/dialogs/qwizard.h8
-rw-r--r--src/widgets/dialogs/qwizard_win.cpp4
-rw-r--r--src/widgets/dialogs/qwizard_win_p.h4
-rw-r--r--src/widgets/graphicsview/qgraphicsproxywidget.cpp2
-rw-r--r--src/widgets/graphicsview/qgraphicsproxywidget.h2
-rw-r--r--src/widgets/graphicsview/qgraphicsview.cpp4
-rw-r--r--src/widgets/graphicsview/qgraphicsview.h2
-rw-r--r--src/widgets/itemviews/itemviews.pri38
-rw-r--r--src/widgets/itemviews/qabstractitemdelegate.cpp4
-rw-r--r--src/widgets/itemviews/qabstractitemview.cpp7
-rw-r--r--src/widgets/itemviews/qheaderview.cpp10
-rw-r--r--src/widgets/itemviews/qlistview.cpp4
-rw-r--r--src/widgets/itemviews/qlistview.h2
-rw-r--r--src/widgets/itemviews/qlistwidget.cpp3
-rw-r--r--src/widgets/itemviews/qlistwidget.h11
-rw-r--r--src/widgets/itemviews/qlistwidget_p.h4
-rw-r--r--src/widgets/itemviews/qtablewidget.cpp3
-rw-r--r--src/widgets/itemviews/qtablewidget.h12
-rw-r--r--src/widgets/itemviews/qtablewidget_p.h4
-rw-r--r--src/widgets/itemviews/qtreewidget.cpp3
-rw-r--r--src/widgets/itemviews/qtreewidget.h13
-rw-r--r--src/widgets/itemviews/qtreewidget_p.h4
-rw-r--r--src/widgets/itemviews/qtreewidgetitemiterator.cpp4
-rw-r--r--src/widgets/itemviews/qtreewidgetitemiterator.h7
-rw-r--r--src/widgets/kernel/kernel.pri7
-rw-r--r--src/widgets/kernel/qaction.cpp2
-rw-r--r--src/widgets/kernel/qapplication.cpp28
-rw-r--r--src/widgets/kernel/qapplication.h4
-rw-r--r--src/widgets/kernel/qapplication_p.h2
-rw-r--r--src/widgets/kernel/qopenglwidget.cpp2
-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.cpp43
-rw-r--r--src/widgets/kernel/qwidget.h12
-rw-r--r--src/widgets/kernel/qwidget_p.h4
-rw-r--r--src/widgets/kernel/qwidgetwindow.cpp12
-rw-r--r--src/widgets/kernel/qwidgetwindow_p.h4
-rw-r--r--src/widgets/statemachine/qguistatemachine.cpp20
-rw-r--r--src/widgets/styles/qcommonstyle.cpp4
-rw-r--r--src/widgets/styles/qfusionstyle.cpp4
-rw-r--r--src/widgets/styles/qwindowsstyle.cpp4
-rw-r--r--src/widgets/util/qcompleter.cpp18
-rw-r--r--src/widgets/util/qsystemtrayicon_x11.cpp2
-rw-r--r--src/widgets/util/qundogroup.cpp4
-rw-r--r--src/widgets/util/qundogroup.h7
-rw-r--r--src/widgets/util/qundostack.cpp18
-rw-r--r--src/widgets/util/qundostack.h11
-rw-r--r--src/widgets/util/qundostack_p.h5
-rw-r--r--src/widgets/util/qundoview.cpp20
-rw-r--r--src/widgets/util/qundoview.h9
-rw-r--r--src/widgets/util/util.pri29
-rw-r--r--src/widgets/widgets/qabstractbutton.cpp2
-rw-r--r--src/widgets/widgets/qabstractscrollarea.cpp4
-rw-r--r--src/widgets/widgets/qabstractscrollarea.h2
-rw-r--r--src/widgets/widgets/qabstractslider.cpp4
-rw-r--r--src/widgets/widgets/qabstractslider.h2
-rw-r--r--src/widgets/widgets/qabstractspinbox.cpp2
-rw-r--r--src/widgets/widgets/qabstractspinbox.h2
-rw-r--r--src/widgets/widgets/qcalendarwidget.cpp4
-rw-r--r--src/widgets/widgets/qcombobox.cpp2
-rw-r--r--src/widgets/widgets/qcombobox.h2
-rw-r--r--src/widgets/widgets/qdatetimeedit.cpp2
-rw-r--r--src/widgets/widgets/qdatetimeedit.h2
-rw-r--r--src/widgets/widgets/qfontcombobox.cpp4
-rw-r--r--src/widgets/widgets/qfontcombobox.h4
-rw-r--r--src/widgets/widgets/qlineedit.cpp1
-rw-r--r--src/widgets/widgets/qmainwindow.cpp4
-rw-r--r--src/widgets/widgets/qmdisubwindow.cpp4
-rw-r--r--src/widgets/widgets/qmenu.cpp20
-rw-r--r--src/widgets/widgets/qmenu.h2
-rw-r--r--src/widgets/widgets/qmenubar.cpp10
-rw-r--r--src/widgets/widgets/qplaintextedit.cpp2
-rw-r--r--src/widgets/widgets/qplaintextedit.h2
-rw-r--r--src/widgets/widgets/qscrollbar.cpp2
-rw-r--r--src/widgets/widgets/qscrollbar.h2
-rw-r--r--src/widgets/widgets/qtabbar.cpp36
-rw-r--r--src/widgets/widgets/qtabbar.h4
-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/qtextedit.cpp2
-rw-r--r--src/widgets/widgets/qtextedit.h2
-rw-r--r--src/widgets/widgets/qtoolbutton.cpp4
-rw-r--r--src/widgets/widgets/widgets.pri7
114 files changed, 441 insertions, 479 deletions
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/itemviews.cpp b/src/widgets/accessible/itemviews.cpp
index eec9a0021c..3cef564781 100644
--- a/src/widgets/accessible/itemviews.cpp
+++ b/src/widgets/accessible/itemviews.cpp
@@ -43,7 +43,7 @@
#include <qtableview.h>
#include <qlistview.h>
#include <qtreeview.h>
-#include <private/qtreewidget_p.h>
+#include <private/qtreeview_p.h>
#ifndef QT_NO_ACCESSIBILITY
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 f19188e584..2c183dad65 100644
--- a/src/widgets/configure.json
+++ b/src/widgets/configure.json
@@ -426,13 +426,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/dialogs.pri b/src/widgets/dialogs/dialogs.pri
index c9438696fa..c2625ec1f4 100644
--- a/src/widgets/dialogs/dialogs.pri
+++ b/src/widgets/dialogs/dialogs.pri
@@ -1,42 +1,17 @@
# Qt dialogs module
HEADERS += \
- dialogs/qcolordialog.h \
- dialogs/qfscompleter_p.h \
- dialogs/qerrormessage.h \
- dialogs/qfiledialog.h \
- dialogs/qfiledialog_p.h \
dialogs/qfontdialog.h \
- dialogs/qfontdialog_p.h \
- dialogs/qinputdialog.h \
- dialogs/qmessagebox.h \
- dialogs/qprogressdialog.h \
- dialogs/qsidebar_p.h \
- dialogs/qfilesystemmodel.h \
- dialogs/qfilesystemmodel_p.h \
- dialogs/qfileinfogatherer_p.h \
- dialogs/qwizard.h
-
-win32 {
- HEADERS += dialogs/qwizard_win_p.h
- SOURCES += dialogs/qwizard_win.cpp
-}
-
-FORMS += dialogs/qfiledialog.ui
+ dialogs/qfontdialog_p.h
INCLUDEPATH += $$PWD
SOURCES += \
- dialogs/qcolordialog.cpp \
- dialogs/qerrormessage.cpp \
- dialogs/qfiledialog.cpp \
- dialogs/qfontdialog.cpp \
- dialogs/qinputdialog.cpp \
- dialogs/qmessagebox.cpp \
- dialogs/qprogressdialog.cpp \
- dialogs/qsidebar.cpp \
- dialogs/qfilesystemmodel.cpp \
- dialogs/qfileinfogatherer.cpp \
- dialogs/qwizard.cpp \
+ dialogs/qfontdialog.cpp
+
+qtConfig(colordialog) {
+ HEADERS += dialogs/qcolordialog.h
+ SOURCES += dialogs/qcolordialog.cpp
+}
qtConfig(dialog) {
HEADERS += \
@@ -47,4 +22,61 @@ qtConfig(dialog) {
dialogs/qdialog.cpp
}
-RESOURCES += dialogs/qmessagebox.qrc
+qtConfig(errormessage) {
+ HEADERS += dialogs/qerrormessage.h
+ SOURCES += dialogs/qerrormessage.cpp
+}
+
+qtConfig(filedialog) {
+ HEADERS += \
+ dialogs/qfiledialog.h \
+ dialogs/qfiledialog_p.h \
+ dialogs/qsidebar_p.h
+
+ SOURCES += \
+ dialogs/qfiledialog.cpp \
+ dialogs/qsidebar.cpp
+
+ FORMS += dialogs/qfiledialog.ui
+}
+
+qtConfig(filesystemmodel) {
+ HEADERS += \
+ dialogs/qfilesystemmodel.h \
+ dialogs/qfilesystemmodel_p.h \
+ dialogs/qfileinfogatherer_p.h
+
+ SOURCES += \
+ dialogs/qfilesystemmodel.cpp \
+ dialogs/qfileinfogatherer.cpp
+}
+
+qtConfig(fscompleter) {
+ HEADERS += dialogs/qfscompleter_p.h
+}
+
+qtConfig(inputdialog) {
+ HEADERS += dialogs/qinputdialog.h
+ SOURCES += dialogs/qinputdialog.cpp
+}
+
+qtConfig(messagebox) {
+ HEADERS += dialogs/qmessagebox.h
+ SOURCES += dialogs/qmessagebox.cpp
+ RESOURCES += dialogs/qmessagebox.qrc
+}
+
+qtConfig(progressdialog) {
+ HEADERS += dialogs/qprogressdialog.h
+ SOURCES += dialogs/qprogressdialog.cpp
+}
+
+qtConfig(wizard) {
+ HEADERS += dialogs/qwizard.h
+ SOURCES += dialogs/qwizard.cpp
+
+ win32 {
+ HEADERS += dialogs/qwizard_win_p.h
+ SOURCES += dialogs/qwizard_win.cpp
+ }
+}
diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp
index dbcd2d7fe2..f361770c3e 100644
--- a/src/widgets/dialogs/qcolordialog.cpp
+++ b/src/widgets/dialogs/qcolordialog.cpp
@@ -39,8 +39,6 @@
#include "qcolordialog.h"
-#ifndef QT_NO_COLORDIALOG
-
#include "qapplication.h"
#include "qdesktopwidget.h"
#include "qdrawutil.h"
@@ -2289,6 +2287,3 @@ QT_END_NAMESPACE
#include "qcolordialog.moc"
#include "moc_qcolordialog.cpp"
-
-#endif // QT_NO_COLORDIALOG
-
diff --git a/src/widgets/dialogs/qcolordialog.h b/src/widgets/dialogs/qcolordialog.h
index fb5b843ce4..a27cfaf953 100644
--- a/src/widgets/dialogs/qcolordialog.h
+++ b/src/widgets/dialogs/qcolordialog.h
@@ -42,12 +42,11 @@
#include <QtWidgets/qtwidgetsglobal.h>
-#ifndef QT_NO_COLORDIALOG
-
#include <QtWidgets/qdialog.h>
-QT_BEGIN_NAMESPACE
+QT_REQUIRE_CONFIG(colordialog);
+QT_BEGIN_NAMESPACE
class QColorDialogPrivate;
@@ -127,6 +126,4 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QColorDialog::ColorDialogOptions)
QT_END_NAMESPACE
-#endif // QT_NO_COLORDIALOG
-
#endif // QCOLORDIALOG_H
diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp
index 60e1c43721..7cb24d65fc 100644
--- a/src/widgets/dialogs/qdialog.cpp
+++ b/src/widgets/dialogs/qdialog.cpp
@@ -37,20 +37,31 @@
**
****************************************************************************/
+#include <QtWidgets/qtwidgetsglobal.h>
+#if QT_CONFIG(colordialog)
#include "qcolordialog.h"
+#endif
#include "qfontdialog.h"
+#if QT_CONFIG(filedialog)
#include "qfiledialog.h"
+#endif
#include "qevent.h"
#include "qdesktopwidget.h"
#include "qapplication.h"
#include "qlayout.h"
#include "qsizegrip.h"
+#if QT_CONFIG(whatsthis)
#include "qwhatsthis.h"
+#endif
#include "qmenu.h"
#include "qcursor.h"
+#if QT_CONFIG(messagebox)
#include "qmessagebox.h"
+#endif
+#if QT_CONFIG(errormessage)
#include "qerrormessage.h"
+#endif
#include <qpa/qplatformtheme.h>
#include "private/qdialog_p.h"
#include "private/qguiapplication_p.h"
@@ -62,11 +73,11 @@ QT_BEGIN_NAMESPACE
static inline int themeDialogType(const QDialog *dialog)
{
-#ifndef QT_NO_FILEDIALOG
+#if QT_CONFIG(filedialog)
if (qobject_cast<const QFileDialog *>(dialog))
return QPlatformTheme::FileDialog;
#endif
-#ifndef QT_NO_COLORDIALOG
+#if QT_CONFIG(colordialog)
if (qobject_cast<const QColorDialog *>(dialog))
return QPlatformTheme::ColorDialog;
#endif
@@ -74,11 +85,11 @@ static inline int themeDialogType(const QDialog *dialog)
if (qobject_cast<const QFontDialog *>(dialog))
return QPlatformTheme::FontDialog;
#endif
-#ifndef QT_NO_MESSAGEBOX
+#if QT_CONFIG(messagebox)
if (qobject_cast<const QMessageBox *>(dialog))
return QPlatformTheme::MessageDialog;
#endif
-#ifndef QT_NO_ERRORMESSAGE
+#if QT_CONFIG(errormessage)
if (qobject_cast<const QErrorMessage *>(dialog))
return QPlatformTheme::MessageDialog;
#endif
@@ -607,7 +618,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 +683,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/dialogs/qerrormessage.cpp b/src/widgets/dialogs/qerrormessage.cpp
index 4ec4da6e1a..39035b743d 100644
--- a/src/widgets/dialogs/qerrormessage.cpp
+++ b/src/widgets/dialogs/qerrormessage.cpp
@@ -39,13 +39,13 @@
#include "qerrormessage.h"
-#ifndef QT_NO_ERRORMESSAGE
-
#include "qapplication.h"
#include "qcheckbox.h"
#include "qlabel.h"
#include "qlayout.h"
+#if QT_CONFIG(messagebox)
#include "qmessagebox.h"
+#endif
#include "qpushbutton.h"
#include "qstringlist.h"
#include "qtextedit.h"
@@ -234,7 +234,7 @@ QErrorMessage::QErrorMessage(QWidget * parent)
grid->setColumnStretch(1, 42);
grid->setRowStretch(0, 42);
-#ifndef QT_NO_MESSAGEBOX
+#if QT_CONFIG(messagebox)
d->icon->setPixmap(QMessageBox::standardIcon(QMessageBox::Information));
d->icon->setAlignment(Qt::AlignHCenter | Qt::AlignTop);
#endif
@@ -390,5 +390,3 @@ void QErrorMessagePrivate::retranslateStrings()
QT_END_NAMESPACE
#include "moc_qerrormessage.cpp"
-
-#endif // QT_NO_ERRORMESSAGE
diff --git a/src/widgets/dialogs/qerrormessage.h b/src/widgets/dialogs/qerrormessage.h
index 976ba9abd5..4cb1fad845 100644
--- a/src/widgets/dialogs/qerrormessage.h
+++ b/src/widgets/dialogs/qerrormessage.h
@@ -42,12 +42,11 @@
#include <QtWidgets/qtwidgetsglobal.h>
-#ifndef QT_NO_ERRORMESSAGE
-
#include <QtWidgets/qdialog.h>
-QT_BEGIN_NAMESPACE
+QT_REQUIRE_CONFIG(errormessage);
+QT_BEGIN_NAMESPACE
class QErrorMessagePrivate;
@@ -75,6 +74,4 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_ERRORMESSAGE
-
#endif // QERRORMESSAGE_H
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index 98f8147236..b638adeaec 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -43,7 +43,6 @@
#include <private/qwidgetitemdata_p.h>
#include "qfiledialog.h"
-#ifndef QT_NO_FILEDIALOG
#include "qfiledialog_p.h"
#include <private/qguiapplication_p.h>
#include <qfontmetrics.h>
@@ -52,8 +51,9 @@
#include <qshortcut.h>
#include <qgridlayout.h>
#include <qmenu.h>
+#if QT_CONFIG(messagebox)
#include <qmessagebox.h>
-#include <qinputdialog.h>
+#endif
#include <stdlib.h>
#include <qsettings.h>
#include <qdebug.h>
@@ -841,7 +841,7 @@ void QFileDialog::setVisible(bool visible)
// Set WA_DontShowOnScreen so that QDialog::setVisible(visible) below
// updates the state correctly, but skips showing the non-native version:
setAttribute(Qt::WA_DontShowOnScreen);
-#ifndef QT_NO_FSCOMPLETER
+#if QT_CONFIG(fscompleter)
// So the completer doesn't try to complete and therefore show a popup
if (!d->nativeDialogInUse)
d->completer->setModel(0);
@@ -849,7 +849,7 @@ void QFileDialog::setVisible(bool visible)
} else {
d->createWidgets();
setAttribute(Qt::WA_DontShowOnScreen, false);
-#ifndef QT_NO_FSCOMPLETER
+#if QT_CONFIG(fscompleter)
if (!d->nativeDialogInUse) {
if (d->proxyModel != 0)
d->completer->setModel(d->proxyModel);
@@ -922,7 +922,7 @@ void QFileDialog::setDirectory(const QString &directory)
if (!d->nativeDialogInUse) {
d->qFileDialogUi->newFolderButton->setEnabled(d->model->flags(root) & Qt::ItemIsDropEnabled);
if (root != d->rootIndex()) {
-#ifndef QT_NO_FSCOMPLETER
+#if QT_CONFIG(fscompleter)
if (directory.endsWith(QLatin1Char('/')))
d->completer->setCompletionPrefix(newDirectory);
else
@@ -2629,11 +2629,11 @@ void QFileDialog::accept()
if (!info.exists())
info = QFileInfo(d->getEnvironmentVariable(fn));
if (!info.exists()) {
-#ifndef QT_NO_MESSAGEBOX
+#if QT_CONFIG(messagebox)
QString message = tr("%1\nDirectory not found.\nPlease verify the "
"correct directory name was given.");
QMessageBox::warning(this, windowTitle(), message.arg(info.fileName()));
-#endif // QT_NO_MESSAGEBOX
+#endif // QT_CONFIG(messagebox)
return;
}
if (info.isDir()) {
@@ -2661,7 +2661,7 @@ void QFileDialog::accept()
if (!info.exists() || !confirmOverwrite() || acceptMode() == AcceptOpen) {
d->emitFilesSelected(QStringList(fn));
QDialog::accept();
-#ifndef QT_NO_MESSAGEBOX
+#if QT_CONFIG(messagebox)
} else {
if (QMessageBox::warning(this, windowTitle(),
tr("%1 already exists.\nDo you want to replace it?")
@@ -2683,11 +2683,11 @@ void QFileDialog::accept()
if (!info.exists())
info = QFileInfo(d->getEnvironmentVariable(file));
if (!info.exists()) {
-#ifndef QT_NO_MESSAGEBOX
+#if QT_CONFIG(messagebox)
QString message = tr("%1\nFile not found.\nPlease verify the "
"correct file name was given.");
QMessageBox::warning(this, windowTitle(), message.arg(info.fileName()));
-#endif // QT_NO_MESSAGEBOX
+#endif // QT_CONFIG(messagebox)
return;
}
if (info.isDir()) {
@@ -2909,10 +2909,10 @@ void QFileDialogPrivate::createWidgets()
#ifndef QT_NO_SHORTCUT
qFileDialogUi->fileNameLabel->setBuddy(qFileDialogUi->fileNameEdit);
#endif
-#ifndef QT_NO_FSCOMPLETER
+#if QT_CONFIG(fscompleter)
completer = new QFSCompleter(model, q);
qFileDialogUi->fileNameEdit->setCompleter(completer);
-#endif // QT_NO_FSCOMPLETER
+#endif // QT_CONFIG(fscompleter)
qFileDialogUi->fileNameEdit->setInputMethodHints(Qt::ImhNoPredictiveText);
@@ -3078,7 +3078,7 @@ void QFileDialog::setProxyModel(QAbstractProxyModel *proxyModel)
proxyModel->setSourceModel(d->model);
d->qFileDialogUi->listView->setModel(d->proxyModel);
d->qFileDialogUi->treeView->setModel(d->proxyModel);
-#ifndef QT_NO_FSCOMPLETER
+#if QT_CONFIG(fscompleter)
d->completer->setModel(d->proxyModel);
d->completer->proxyModel = d->proxyModel;
#endif
@@ -3088,7 +3088,7 @@ void QFileDialog::setProxyModel(QAbstractProxyModel *proxyModel)
d->proxyModel = 0;
d->qFileDialogUi->listView->setModel(d->model);
d->qFileDialogUi->treeView->setModel(d->model);
-#ifndef QT_NO_FSCOMPLETER
+#if QT_CONFIG(fscompleter)
d->completer->setModel(d->model);
d->completer->sourceModel = d->model;
d->completer->proxyModel = 0;
@@ -3430,7 +3430,7 @@ void QFileDialogPrivate::_q_deleteCurrent()
bool isDir = model->isDir(index);
QFile::Permissions p(index.parent().data(QFileSystemModel::FilePermissions).toInt());
-#ifndef QT_NO_MESSAGEBOX
+#if QT_CONFIG(messagebox)
Q_Q(QFileDialog);
if (!(p & QFile::WriteUser) && (QMessageBox::warning(q_func(), QFileDialog::tr("Delete"),
QFileDialog::tr("'%1' is write protected.\nDo you want to delete it anyway?")
@@ -3446,12 +3446,12 @@ void QFileDialogPrivate::_q_deleteCurrent()
#else
if (!(p & QFile::WriteUser))
return;
-#endif // QT_NO_MESSAGEBOX
+#endif // QT_CONFIG(messagebox)
// the event loop has run, we can NOT reuse index because the model might have removed it.
if (isDir) {
if (!removeDirectory(filePath)) {
-#ifndef QT_NO_MESSAGEBOX
+#if QT_CONFIG(messagebox)
QMessageBox::warning(q, q->windowTitle(),
QFileDialog::tr("Could not delete directory."));
#endif
@@ -3632,7 +3632,7 @@ void QFileDialogPrivate::_q_enterDirectory(const QModelIndex &index)
*/
void QFileDialogPrivate::_q_goToDirectory(const QString &path)
{
- #ifndef QT_NO_MESSAGEBOX
+ #if QT_CONFIG(messagebox)
Q_Q(QFileDialog);
#endif
QModelIndex index = qFileDialogUi->lookInCombo->model()->index(qFileDialogUi->lookInCombo->currentIndex(),
@@ -3651,12 +3651,12 @@ void QFileDialogPrivate::_q_goToDirectory(const QString &path)
if (dir.exists() || path2.isEmpty() || path2 == model->myComputer().toString()) {
_q_enterDirectory(index);
-#ifndef QT_NO_MESSAGEBOX
+#if QT_CONFIG(messagebox)
} else {
QString message = QFileDialog::tr("%1\nDirectory not found.\nPlease verify the "
"correct directory name was given.");
QMessageBox::warning(q, q->windowTitle(), message.arg(path2));
-#endif // QT_NO_MESSAGEBOX
+#endif // QT_CONFIG(messagebox)
}
}
@@ -4028,7 +4028,7 @@ void QFileDialogLineEdit::keyPressEvent(QKeyEvent *e)
e->accept();
}
-#ifndef QT_NO_FSCOMPLETER
+#if QT_CONFIG(fscompleter)
QString QFSCompleter::pathFromIndex(const QModelIndex &index) const
{
@@ -4134,5 +4134,3 @@ QStringList QFSCompleter::splitPath(const QString &path) const
QT_END_NAMESPACE
#include "moc_qfiledialog.cpp"
-
-#endif // QT_NO_FILEDIALOG
diff --git a/src/widgets/dialogs/qfiledialog.h b/src/widgets/dialogs/qfiledialog.h
index 733dd03092..b9092e036d 100644
--- a/src/widgets/dialogs/qfiledialog.h
+++ b/src/widgets/dialogs/qfiledialog.h
@@ -44,13 +44,11 @@
#include <QtCore/qdir.h>
#include <QtCore/qstring.h>
#include <QtCore/qurl.h>
-
-#ifndef QT_NO_FILEDIALOG
-
#include <QtWidgets/qdialog.h>
-QT_BEGIN_NAMESPACE
+QT_REQUIRE_CONFIG(filedialog);
+QT_BEGIN_NAMESPACE
class QModelIndex;
class QItemSelection;
@@ -316,6 +314,4 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QFileDialog::Options)
QT_END_NAMESPACE
-#endif // QT_NO_FILEDIALOG
-
#endif // QFILEDIALOG_H
diff --git a/src/widgets/dialogs/qfiledialog_p.h b/src/widgets/dialogs/qfiledialog_p.h
index d5df7542b6..f7a3c6b091 100644
--- a/src/widgets/dialogs/qfiledialog_p.h
+++ b/src/widgets/dialogs/qfiledialog_p.h
@@ -53,8 +53,6 @@
#include <QtWidgets/private/qtwidgetsglobal_p.h>
-#ifndef QT_NO_FILEDIALOG
-
#include "qfiledialog.h"
#include "private/qdialog_p.h"
#include "qplatformdefs.h"
@@ -75,12 +73,16 @@
#include <qpointer.h>
#include <qdebug.h>
#include "qsidebar_p.h"
+#if QT_CONFIG(fscompleter)
#include "qfscompleter_p.h"
+#endif
#if defined (Q_OS_UNIX)
#include <unistd.h>
#endif
+QT_REQUIRE_CONFIG(filedialog);
+
QT_BEGIN_NAMESPACE
class QFileDialogListView;
@@ -231,9 +233,9 @@ public:
QStringList watching;
QFileSystemModel *model;
-#ifndef QT_NO_FSCOMPLETER
+#if QT_CONFIG(fscompleter)
QFSCompleter *completer;
-#endif //QT_NO_FSCOMPLETER
+#endif //QT_CONFIG(fscompleter)
QString setWindowTitle;
@@ -432,6 +434,4 @@ QString QFileDialogPrivate::selectedNameFilter_sys() const
QT_END_NAMESPACE
-#endif // QT_NO_FILEDIALOG
-
#endif // QFILEDIALOG_P_H
diff --git a/src/widgets/dialogs/qfileinfogatherer.cpp b/src/widgets/dialogs/qfileinfogatherer.cpp
index 08c5a40c7c..9f2d15d31b 100644
--- a/src/widgets/dialogs/qfileinfogatherer.cpp
+++ b/src/widgets/dialogs/qfileinfogatherer.cpp
@@ -50,8 +50,6 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_FILESYSTEMMODEL
-
#ifdef QT_BUILD_INTERNAL
static QBasicAtomicInt fetchedRoot = Q_BASIC_ATOMIC_INITIALIZER(false);
Q_AUTOTEST_EXPORT void qt_test_resetFetchedRoot()
@@ -366,8 +364,6 @@ void QFileInfoGatherer::fetch(const QFileInfo &fileInfo, QElapsedTimer &base, bo
}
}
-#endif // QT_NO_FILESYSTEMMODEL
-
QT_END_NAMESPACE
#include "moc_qfileinfogatherer_p.cpp"
diff --git a/src/widgets/dialogs/qfileinfogatherer_p.h b/src/widgets/dialogs/qfileinfogatherer_p.h
index 0018b6c387..52578126de 100644
--- a/src/widgets/dialogs/qfileinfogatherer_p.h
+++ b/src/widgets/dialogs/qfileinfogatherer_p.h
@@ -66,6 +66,8 @@
#include <private/qfilesystemengine_p.h>
+QT_REQUIRE_CONFIG(filesystemmodel);
+
QT_BEGIN_NAMESPACE
class QExtendedInformation {
@@ -150,8 +152,6 @@ private :
class QFileIconProvider;
-#ifndef QT_NO_FILESYSTEMMODEL
-
class Q_AUTOTEST_EXPORT QFileInfoGatherer : public QThread
{
Q_OBJECT
@@ -208,9 +208,6 @@ private:
QFileIconProvider *m_iconProvider; // not accessed by run()
QFileIconProvider defaultProvider;
};
-#endif // QT_NO_FILESYSTEMMODEL
-
QT_END_NAMESPACE
#endif // QFILEINFOGATHERER_H
-
diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp
index 45a6b4f8a0..872b8daf22 100644
--- a/src/widgets/dialogs/qfilesystemmodel.cpp
+++ b/src/widgets/dialogs/qfilesystemmodel.cpp
@@ -43,7 +43,9 @@
#include <qmimedata.h>
#include <qurl.h>
#include <qdebug.h>
+#if QT_CONFIG(messagebox)
#include <qmessagebox.h>
+#endif
#include <qapplication.h>
#include <QtCore/qcollator.h>
@@ -56,8 +58,6 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_FILESYSTEMMODEL
-
/*!
\enum QFileSystemModel::Roles
\value FileIconRole
@@ -867,12 +867,12 @@ bool QFileSystemModel::setData(const QModelIndex &idx, const QVariant &value, in
if (newName.isEmpty()
|| QDir::toNativeSeparators(newName).contains(QDir::separator())
|| !QDir(parentPath).rename(oldName, newName)) {
-#ifndef QT_NO_MESSAGEBOX
+#if QT_CONFIG(messagebox)
QMessageBox::information(0, QFileSystemModel::tr("Invalid filename"),
QFileSystemModel::tr("<b>The name \"%1\" can not be used.</b><p>Try using another name, with fewer characters or no punctuations marks.")
.arg(newName),
QMessageBox::Ok);
-#endif // QT_NO_MESSAGEBOX
+#endif // QT_CONFIG(messagebox)
return false;
} else {
/*
@@ -1979,5 +1979,3 @@ bool QFileSystemModelPrivate::passNameFilters(const QFileSystemNode *node) const
QT_END_NAMESPACE
#include "moc_qfilesystemmodel.cpp"
-
-#endif // QT_NO_FILESYSTEMMODEL
diff --git a/src/widgets/dialogs/qfilesystemmodel.h b/src/widgets/dialogs/qfilesystemmodel.h
index 7d790124c8..a5f23c9220 100644
--- a/src/widgets/dialogs/qfilesystemmodel.h
+++ b/src/widgets/dialogs/qfilesystemmodel.h
@@ -47,10 +47,9 @@
#include <QtGui/qicon.h>
#include <QtCore/qdiriterator.h>
-QT_BEGIN_NAMESPACE
-
+QT_REQUIRE_CONFIG(filesystemmodel);
-#ifndef QT_NO_FILESYSTEMMODEL
+QT_BEGIN_NAMESPACE
class ExtendedInformation;
class QFileSystemModelPrivate;
@@ -166,9 +165,6 @@ inline QString QFileSystemModel::fileName(const QModelIndex &aindex) const
inline QIcon QFileSystemModel::fileIcon(const QModelIndex &aindex) const
{ return qvariant_cast<QIcon>(aindex.data(Qt::DecorationRole)); }
-#endif // QT_NO_FILESYSTEMMODEL
-
QT_END_NAMESPACE
#endif // QFILESYSTEMMODEL_H
-
diff --git a/src/widgets/dialogs/qfilesystemmodel_p.h b/src/widgets/dialogs/qfilesystemmodel_p.h
index e7149a3097..640225529b 100644
--- a/src/widgets/dialogs/qfilesystemmodel_p.h
+++ b/src/widgets/dialogs/qfilesystemmodel_p.h
@@ -54,8 +54,6 @@
#include <QtWidgets/private/qtwidgetsglobal_p.h>
#include "qfilesystemmodel.h"
-#ifndef QT_NO_FILESYSTEMMODEL
-
#include <private/qabstractitemmodel_p.h>
#include <qabstractitemmodel.h>
#include "qfileinfogatherer_p.h"
@@ -66,6 +64,8 @@
#include <qtimer.h>
#include <qhash.h>
+QT_REQUIRE_CONFIG(filesystemmodel);
+
QT_BEGIN_NAMESPACE
class ExtendedInformation;
@@ -313,9 +313,7 @@ public:
};
Q_DECLARE_TYPEINFO(QFileSystemModelPrivate::Fetching, Q_MOVABLE_TYPE);
-#endif // QT_NO_FILESYSTEMMODEL
QT_END_NAMESPACE
#endif
-
diff --git a/src/widgets/dialogs/qfscompleter_p.h b/src/widgets/dialogs/qfscompleter_p.h
index c073fa1521..ce0612f293 100644
--- a/src/widgets/dialogs/qfscompleter_p.h
+++ b/src/widgets/dialogs/qfscompleter_p.h
@@ -55,9 +55,9 @@
#include "qcompleter.h"
#include <QtWidgets/qfilesystemmodel.h>
-QT_BEGIN_NAMESPACE
+QT_REQUIRE_CONFIG(fscompleter);
-#ifndef QT_NO_FSCOMPLETER
+QT_BEGIN_NAMESPACE
/*!
QCompleter that can deal with QFileSystemModel
@@ -78,8 +78,6 @@ public:
QFileSystemModel *sourceModel;
};
-#endif // QT_NO_FSCOMPLETER
-
QT_END_NAMESPACE
#endif // QFSCOMPLETOR_P_H
diff --git a/src/widgets/dialogs/qinputdialog.cpp b/src/widgets/dialogs/qinputdialog.cpp
index 4ca3923d8d..04d13045e5 100644
--- a/src/widgets/dialogs/qinputdialog.cpp
+++ b/src/widgets/dialogs/qinputdialog.cpp
@@ -39,8 +39,6 @@
#include "qinputdialog.h"
-#ifndef QT_NO_INPUTDIALOG
-
#include "qapplication.h"
#include "qcombobox.h"
#include "qdialogbuttonbox.h"
@@ -48,7 +46,7 @@
#include "qlayout.h"
#include "qlineedit.h"
#include "qplaintextedit.h"
-#include "qlistwidget.h"
+#include "qlistview.h"
#include "qpushbutton.h"
#include "qspinbox.h"
#include "qstackedlayout.h"
@@ -1507,5 +1505,3 @@ QT_END_NAMESPACE
#include "qinputdialog.moc"
#include "moc_qinputdialog.cpp"
-
-#endif // QT_NO_INPUTDIALOG
diff --git a/src/widgets/dialogs/qinputdialog.h b/src/widgets/dialogs/qinputdialog.h
index 7b43e774a7..5f06785886 100644
--- a/src/widgets/dialogs/qinputdialog.h
+++ b/src/widgets/dialogs/qinputdialog.h
@@ -44,12 +44,11 @@
#include <QtCore/qstring.h>
#include <QtWidgets/qlineedit.h>
-#ifndef QT_NO_INPUTDIALOG
-
#include <QtWidgets/qdialog.h>
-QT_BEGIN_NAMESPACE
+QT_REQUIRE_CONFIG(inputdialog);
+QT_BEGIN_NAMESPACE
class QInputDialogPrivate;
@@ -212,6 +211,4 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QInputDialog::InputDialogOptions)
QT_END_NAMESPACE
-#endif // QT_NO_INPUTDIALOG
-
#endif // QINPUTDIALOG_H
diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp
index 7a98fae99c..843a1bf341 100644
--- a/src/widgets/dialogs/qmessagebox.cpp
+++ b/src/widgets/dialogs/qmessagebox.cpp
@@ -39,8 +39,6 @@
#include <QtWidgets/qmessagebox.h>
-#ifndef QT_NO_MESSAGEBOX
-
#include <QtWidgets/qdialogbuttonbox.h>
#include "private/qlabel_p.h"
#include "private/qapplication_p.h"
@@ -2737,5 +2735,3 @@ QT_END_NAMESPACE
#include "moc_qmessagebox.cpp"
#include "qmessagebox.moc"
-
-#endif // QT_NO_MESSAGEBOX
diff --git a/src/widgets/dialogs/qmessagebox.h b/src/widgets/dialogs/qmessagebox.h
index 40e5c701fe..6d5179602b 100644
--- a/src/widgets/dialogs/qmessagebox.h
+++ b/src/widgets/dialogs/qmessagebox.h
@@ -42,12 +42,11 @@
#include <QtWidgets/qtwidgetsglobal.h>
-#ifndef QT_NO_MESSAGEBOX
-
#include <QtWidgets/qdialog.h>
-QT_BEGIN_NAMESPACE
+QT_REQUIRE_CONFIG(messagebox);
+QT_BEGIN_NAMESPACE
class QLabel;
class QMessageBoxPrivate;
@@ -325,6 +324,4 @@ str)).arg(QString::fromLatin1(qVersion())); QMessageBox::critical(0, QApplicatio
QT_END_NAMESPACE
-#endif // QT_NO_MESSAGEBOX
-
#endif // QMESSAGEBOX_H
diff --git a/src/widgets/dialogs/qprogressdialog.cpp b/src/widgets/dialogs/qprogressdialog.cpp
index 0a6253ea27..a276e28a0c 100644
--- a/src/widgets/dialogs/qprogressdialog.cpp
+++ b/src/widgets/dialogs/qprogressdialog.cpp
@@ -39,8 +39,6 @@
#include "qprogressdialog.h"
-#ifndef QT_NO_PROGRESSDIALOG
-
#include "qshortcut.h"
#include "qpainter.h"
#include "qdrawutil.h"
@@ -886,5 +884,3 @@ void QProgressDialog::open(QObject *receiver, const char *member)
QT_END_NAMESPACE
#include "moc_qprogressdialog.cpp"
-
-#endif // QT_NO_PROGRESSDIALOG
diff --git a/src/widgets/dialogs/qprogressdialog.h b/src/widgets/dialogs/qprogressdialog.h
index f4e63fb088..902a4de5d2 100644
--- a/src/widgets/dialogs/qprogressdialog.h
+++ b/src/widgets/dialogs/qprogressdialog.h
@@ -42,12 +42,11 @@
#include <QtWidgets/qtwidgetsglobal.h>
-#ifndef QT_NO_PROGRESSDIALOG
-
#include <QtWidgets/qdialog.h>
-QT_BEGIN_NAMESPACE
+QT_REQUIRE_CONFIG(progressdialog);
+QT_BEGIN_NAMESPACE
class QPushButton;
class QLabel;
@@ -130,6 +129,4 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_PROGRESSDIALOG
-
#endif // QPROGRESSDIALOG_H
diff --git a/src/widgets/dialogs/qsidebar.cpp b/src/widgets/dialogs/qsidebar.cpp
index 9bb046db61..b8b042ddb5 100644
--- a/src/widgets/dialogs/qsidebar.cpp
+++ b/src/widgets/dialogs/qsidebar.cpp
@@ -40,8 +40,6 @@
#include "qsidebar_p.h"
#include "qfilesystemmodel.h"
-#ifndef QT_NO_FILEDIALOG
-
#include <qaction.h>
#include <qurl.h>
#include <qmenu.h>
@@ -518,5 +516,3 @@ bool QSidebar::event(QEvent * event)
QT_END_NAMESPACE
#include "moc_qsidebar_p.cpp"
-
-#endif
diff --git a/src/widgets/dialogs/qsidebar_p.h b/src/widgets/dialogs/qsidebar_p.h
index 0685e81b2b..17d576e54d 100644
--- a/src/widgets/dialogs/qsidebar_p.h
+++ b/src/widgets/dialogs/qsidebar_p.h
@@ -52,13 +52,13 @@
//
#include <QtWidgets/private/qtwidgetsglobal_p.h>
-#include <qlistwidget.h>
+#include <qlistview.h>
#include <qstandarditemmodel.h>
#include <qstyleditemdelegate.h>
#include <qurl.h>
#include <qvector.h>
-#ifndef QT_NO_FILEDIALOG
+QT_REQUIRE_CONFIG(filedialog);
QT_BEGIN_NAMESPACE
@@ -159,7 +159,5 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_FILEDIALOG
-
#endif // QSIDEBAR_H
diff --git a/src/widgets/dialogs/qwizard.cpp b/src/widgets/dialogs/qwizard.cpp
index c272511aae..7bb72a00b7 100644
--- a/src/widgets/dialogs/qwizard.cpp
+++ b/src/widgets/dialogs/qwizard.cpp
@@ -40,8 +40,6 @@
#include "qwizard.h"
#include <QtWidgets/private/qtwidgetsglobal_p.h>
-#ifndef QT_NO_WIZARD
-
#include "qabstractspinbox.h"
#include "qalgorithms.h"
#include "qapplication.h"
@@ -3986,5 +3984,3 @@ QWizard *QWizardPage::wizard() const
QT_END_NAMESPACE
#include "moc_qwizard.cpp"
-
-#endif // QT_NO_WIZARD
diff --git a/src/widgets/dialogs/qwizard.h b/src/widgets/dialogs/qwizard.h
index 3236ee90df..4d03bf91d4 100644
--- a/src/widgets/dialogs/qwizard.h
+++ b/src/widgets/dialogs/qwizard.h
@@ -41,13 +41,11 @@
#define QWIZARD_H
#include <QtWidgets/qtwidgetsglobal.h>
-
-#ifndef QT_NO_WIZARD
-
#include <QtWidgets/qdialog.h>
-QT_BEGIN_NAMESPACE
+QT_REQUIRE_CONFIG(wizard);
+QT_BEGIN_NAMESPACE
class QAbstractButton;
class QWizardPage;
@@ -261,6 +259,4 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_WIZARD
-
#endif // QWIZARD_H
diff --git a/src/widgets/dialogs/qwizard_win.cpp b/src/widgets/dialogs/qwizard_win.cpp
index 4ab01aca66..666b192e9c 100644
--- a/src/widgets/dialogs/qwizard_win.cpp
+++ b/src/widgets/dialogs/qwizard_win.cpp
@@ -37,8 +37,6 @@
**
****************************************************************************/
-#ifndef QT_NO_WIZARD
-
#include <QtWidgets/private/qtwidgetsglobal_p.h>
#if QT_CONFIG(style_windowsvista)
@@ -724,5 +722,3 @@ int QVistaHelper::topOffset()
QT_END_NAMESPACE
#endif // style_windowsvista
-
-#endif // QT_NO_WIZARD
diff --git a/src/widgets/dialogs/qwizard_win_p.h b/src/widgets/dialogs/qwizard_win_p.h
index bbba53b879..f9122865c2 100644
--- a/src/widgets/dialogs/qwizard_win_p.h
+++ b/src/widgets/dialogs/qwizard_win_p.h
@@ -53,7 +53,6 @@
#include <QtWidgets/private/qtwidgetsglobal_p.h>
-#ifndef QT_NO_WIZARD
#if QT_CONFIG(style_windowsvista)
#include <qobject.h>
@@ -63,6 +62,8 @@
#include <QtWidgets/private/qstylehelper_p.h>
#include <qt_windows.h>
+QT_REQUIRE_CONFIG(wizard);
+
QT_BEGIN_NAMESPACE
class QVistaBackButton : public QAbstractButton
@@ -157,5 +158,4 @@ private:
QT_END_NAMESPACE
#endif // style_windowsvista
-#endif // QT_NO_WIZARD
#endif // QWIZARD_WIN_P_H
diff --git a/src/widgets/graphicsview/qgraphicsproxywidget.cpp b/src/widgets/graphicsview/qgraphicsproxywidget.cpp
index 0b9e6e7216..eface182ae 100644
--- a/src/widgets/graphicsview/qgraphicsproxywidget.cpp
+++ b/src/widgets/graphicsview/qgraphicsproxywidget.cpp
@@ -1273,7 +1273,7 @@ void QGraphicsProxyWidget::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event
/*!
\reimp
*/
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void QGraphicsProxyWidget::wheelEvent(QGraphicsSceneWheelEvent *event)
{
Q_D(QGraphicsProxyWidget);
diff --git a/src/widgets/graphicsview/qgraphicsproxywidget.h b/src/widgets/graphicsview/qgraphicsproxywidget.h
index 8112c65d63..c1564cba34 100644
--- a/src/widgets/graphicsview/qgraphicsproxywidget.h
+++ b/src/widgets/graphicsview/qgraphicsproxywidget.h
@@ -103,7 +103,7 @@ protected:
void mousePressEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void wheelEvent(QGraphicsSceneWheelEvent *event) Q_DECL_OVERRIDE;
#endif
diff --git a/src/widgets/graphicsview/qgraphicsview.cpp b/src/widgets/graphicsview/qgraphicsview.cpp
index 9d7412340f..f5f24649c2 100644
--- a/src/widgets/graphicsview/qgraphicsview.cpp
+++ b/src/widgets/graphicsview/qgraphicsview.cpp
@@ -3409,7 +3409,7 @@ void QGraphicsView::mouseReleaseEvent(QMouseEvent *event)
#endif
}
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
/*!
\reimp
*/
@@ -3437,7 +3437,7 @@ void QGraphicsView::wheelEvent(QWheelEvent *event)
if (!event->isAccepted())
QAbstractScrollArea::wheelEvent(event);
}
-#endif // QT_NO_WHEELEVENT
+#endif // QT_CONFIG(wheelevent)
/*!
\reimp
diff --git a/src/widgets/graphicsview/qgraphicsview.h b/src/widgets/graphicsview/qgraphicsview.h
index 64d5f5b430..fb975b9d71 100644
--- a/src/widgets/graphicsview/qgraphicsview.h
+++ b/src/widgets/graphicsview/qgraphicsview.h
@@ -259,7 +259,7 @@ protected:
void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
#endif
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
diff --git a/src/widgets/itemviews/itemviews.pri b/src/widgets/itemviews/itemviews.pri
index ed0e3fe072..af0a6f6898 100644
--- a/src/widgets/itemviews/itemviews.pri
+++ b/src/widgets/itemviews/itemviews.pri
@@ -17,16 +17,9 @@ HEADERS += \
itemviews/qabstractitemdelegate_p.h \
itemviews/qitemdelegate.h \
itemviews/qdirmodel.h \
- itemviews/qlistwidget.h \
- itemviews/qlistwidget_p.h \
- itemviews/qtablewidget.h \
- itemviews/qtablewidget_p.h \
- itemviews/qtreewidget.h \
- itemviews/qtreewidget_p.h \
itemviews/qwidgetitemdata_p.h \
itemviews/qitemeditorfactory.h \
itemviews/qitemeditorfactory_p.h \
- itemviews/qtreewidgetitemiterator.h \
itemviews/qdatawidgetmapper.h \
itemviews/qstyleditemdelegate.h
@@ -40,11 +33,7 @@ SOURCES += \
itemviews/qabstractitemdelegate.cpp \
itemviews/qitemdelegate.cpp \
itemviews/qdirmodel.cpp \
- itemviews/qlistwidget.cpp \
- itemviews/qtablewidget.cpp \
- itemviews/qtreewidget.cpp \
itemviews/qitemeditorfactory.cpp \
- itemviews/qtreewidgetitemiterator.cpp \
itemviews/qdatawidgetmapper.cpp \
itemviews/qstyleditemdelegate.cpp
}
@@ -60,6 +49,33 @@ qtConfig(columnview) {
itemviews/qcolumnviewgrip.cpp
}
+qtConfig(listwidget) {
+ HEADERS += \
+ itemviews/qlistwidget.h \
+ itemviews/qlistwidget_p.h
+
+ SOURCES += itemviews/qlistwidget.cpp
+}
+
+qtConfig(tablewidget) {
+ HEADERS += \
+ itemviews/qtablewidget.h \
+ itemviews/qtablewidget_p.h
+
+ SOURCES += itemviews/qtablewidget.cpp
+}
+
+qtConfig(treewidget) {
+ HEADERS += \
+ itemviews/qtreewidget.h \
+ itemviews/qtreewidget_p.h \
+ itemviews/qtreewidgetitemiterator.h
+
+ SOURCES += \
+ itemviews/qtreewidget.cpp \
+ itemviews/qtreewidgetitemiterator.cpp
+}
+
HEADERS += \
itemviews/qfileiconprovider.h \
itemviews/qfileiconprovider_p.h \
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 e1b6f52225..b225678e0b 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>
@@ -174,7 +173,7 @@ void QAbstractItemViewPrivate::checkMouseMove(const QPersistentModelIndex &index
if (index.isValid()) {
emit q->entered(index);
-#ifndef QT_NO_STATUSTIP
+#if QT_CONFIG(statustip)
QString statustip = model->data(index, Qt::StatusTipRole).toString();
if (parent && (shouldClearStatusTip || !statustip.isEmpty())) {
QStatusTipEvent tip(statustip);
@@ -183,7 +182,7 @@ void QAbstractItemViewPrivate::checkMouseMove(const QPersistentModelIndex &index
}
#endif
} else {
-#ifndef QT_NO_STATUSTIP
+#if QT_CONFIG(statustip)
if (parent && shouldClearStatusTip) {
QString emptyString;
QStatusTipEvent tip( emptyString );
@@ -1704,7 +1703,7 @@ bool QAbstractItemView::viewportEvent(QEvent *event)
break;
case QEvent::Leave:
d->setHoverIndex(QModelIndex()); // If we've left, no hover should be needed anymore
- #ifndef QT_NO_STATUSTIP
+ #if QT_CONFIG(statustip)
if (d->shouldClearStatusTip && d->parent) {
QString empty;
QStatusTipEvent tip(empty);
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp
index 20b160c03d..89d0c7f93c 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>
@@ -2653,7 +2655,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());
@@ -2673,8 +2675,8 @@ bool QHeaderView::viewportEvent(QEvent *e)
}
}
break; }
-#endif // QT_NO_WHATSTHIS
-#ifndef QT_NO_STATUSTIP
+#endif // QT_CONFIG(whatsthis)
+#if QT_CONFIG(statustip)
case QEvent::StatusTip: {
QHelpEvent *he = static_cast<QHelpEvent*>(e);
int logical = logicalIndexAt(he->pos());
@@ -2685,7 +2687,7 @@ bool QHeaderView::viewportEvent(QEvent *e)
setStatusTip(statustip);
}
return true; }
-#endif // QT_NO_STATUSTIP
+#endif // QT_CONFIG(statustip)
case QEvent::FontChange:
case QEvent::StyleChange:
d->invalidateCachedSizeHint();
diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp
index 33943399d1..bc0ca7dc1c 100644
--- a/src/widgets/itemviews/qlistview.cpp
+++ b/src/widgets/itemviews/qlistview.cpp
@@ -800,7 +800,7 @@ void QListView::mouseReleaseEvent(QMouseEvent *e)
}
}
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
/*!
\reimp
*/
@@ -827,7 +827,7 @@ void QListView::wheelEvent(QWheelEvent *e)
QApplication::sendEvent(d->hbar, e);
}
}
-#endif // QT_NO_WHEELEVENT
+#endif // QT_CONFIG(wheelevent)
/*!
\reimp
diff --git a/src/widgets/itemviews/qlistview.h b/src/widgets/itemviews/qlistview.h
index e918e66d38..6b164aeec8 100644
--- a/src/widgets/itemviews/qlistview.h
+++ b/src/widgets/itemviews/qlistview.h
@@ -153,7 +153,7 @@ protected:
void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *e) Q_DECL_OVERRIDE;
#endif
diff --git a/src/widgets/itemviews/qlistwidget.cpp b/src/widgets/itemviews/qlistwidget.cpp
index 7611e5c1ca..95ad3f82d0 100644
--- a/src/widgets/itemviews/qlistwidget.cpp
+++ b/src/widgets/itemviews/qlistwidget.cpp
@@ -39,7 +39,6 @@
#include "qlistwidget.h"
-#ifndef QT_NO_LISTWIDGET
#include <qitemdelegate.h>
#include <private/qlistview_p.h>
#include <private/qwidgetitemdata_p.h>
@@ -1983,5 +1982,3 @@ QT_END_NAMESPACE
#include "moc_qlistwidget.cpp"
#include "moc_qlistwidget_p.cpp"
-
-#endif // QT_NO_LISTWIDGET
diff --git a/src/widgets/itemviews/qlistwidget.h b/src/widgets/itemviews/qlistwidget.h
index fee99fa428..50f4e2ac84 100644
--- a/src/widgets/itemviews/qlistwidget.h
+++ b/src/widgets/itemviews/qlistwidget.h
@@ -46,10 +46,9 @@
#include <QtCore/qvector.h>
#include <QtCore/qitemselectionmodel.h>
-QT_BEGIN_NAMESPACE
-
+QT_REQUIRE_CONFIG(listwidget);
-#ifndef QT_NO_LISTWIDGET
+QT_BEGIN_NAMESPACE
class QListWidget;
class QListModel;
@@ -100,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);
@@ -180,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
@@ -340,8 +339,6 @@ inline void QListWidgetItem::setHidden(bool ahide)
inline bool QListWidgetItem::isHidden() const
{ return (view ? view->isItemHidden(this) : false); }
-#endif // QT_NO_LISTWIDGET
-
QT_END_NAMESPACE
#endif // QLISTWIDGET_H
diff --git a/src/widgets/itemviews/qlistwidget_p.h b/src/widgets/itemviews/qlistwidget_p.h
index 0594fd511e..e8f5540f9c 100644
--- a/src/widgets/itemviews/qlistwidget_p.h
+++ b/src/widgets/itemviews/qlistwidget_p.h
@@ -58,7 +58,7 @@
#include <private/qlistview_p.h>
#include <private/qwidgetitemdata_p.h>
-#ifndef QT_NO_LISTWIDGET
+QT_REQUIRE_CONFIG(listwidget);
QT_BEGIN_NAMESPACE
@@ -171,6 +171,4 @@ public:
QT_END_NAMESPACE
-#endif // QT_NO_LISTWIDGET
-
#endif // QLISTWIDGET_P_H
diff --git a/src/widgets/itemviews/qtablewidget.cpp b/src/widgets/itemviews/qtablewidget.cpp
index 7bb11aef14..bb1970e3ac 100644
--- a/src/widgets/itemviews/qtablewidget.cpp
+++ b/src/widgets/itemviews/qtablewidget.cpp
@@ -39,7 +39,6 @@
#include "qtablewidget.h"
-#ifndef QT_NO_TABLEWIDGET
#include <qitemdelegate.h>
#include <qpainter.h>
#include <private/qtablewidget_p.h>
@@ -2729,5 +2728,3 @@ QT_END_NAMESPACE
#include "moc_qtablewidget.cpp"
#include "moc_qtablewidget_p.cpp"
-
-#endif // QT_NO_TABLEWIDGET
diff --git a/src/widgets/itemviews/qtablewidget.h b/src/widgets/itemviews/qtablewidget.h
index 092ce77306..9c231d5127 100644
--- a/src/widgets/itemviews/qtablewidget.h
+++ b/src/widgets/itemviews/qtablewidget.h
@@ -44,12 +44,10 @@
#include <QtWidgets/qtableview.h>
#include <QtCore/qvariant.h>
#include <QtCore/qvector.h>
-//#include <QtWidgets/qitemselectionmodel.h>
-
-QT_BEGIN_NAMESPACE
+QT_REQUIRE_CONFIG(tablewidget);
-#ifndef QT_NO_TABLEWIDGET
+QT_BEGIN_NAMESPACE
class Q_WIDGETS_EXPORT QTableWidgetSelectionRange
{
@@ -118,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);
@@ -198,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
@@ -379,8 +377,6 @@ inline void QTableWidgetItem::setSelected(bool aselect)
inline bool QTableWidgetItem::isSelected() const
{ return (view ? view->isItemSelected(this) : false); }
-#endif // QT_NO_TABLEWIDGET
-
QT_END_NAMESPACE
#endif // QTABLEWIDGET_H
diff --git a/src/widgets/itemviews/qtablewidget_p.h b/src/widgets/itemviews/qtablewidget_p.h
index 2db7337cd6..6412477be0 100644
--- a/src/widgets/itemviews/qtablewidget_p.h
+++ b/src/widgets/itemviews/qtablewidget_p.h
@@ -58,7 +58,7 @@
#include <private/qtableview_p.h>
#include <private/qwidgetitemdata_p.h>
-#ifndef QT_NO_TABLEWIDGET
+QT_REQUIRE_CONFIG(tablewidget);
QT_BEGIN_NAMESPACE
@@ -218,6 +218,4 @@ public:
QT_END_NAMESPACE
-#endif // QT_NO_TABLEWIDGET
-
#endif // QTABLEWIDGET_P_H
diff --git a/src/widgets/itemviews/qtreewidget.cpp b/src/widgets/itemviews/qtreewidget.cpp
index a58da489aa..d7b46a0835 100644
--- a/src/widgets/itemviews/qtreewidget.cpp
+++ b/src/widgets/itemviews/qtreewidget.cpp
@@ -39,7 +39,6 @@
#include "qtreewidget.h"
-#ifndef QT_NO_TREEWIDGET
#include <qheaderview.h>
#include <qpainter.h>
#include <qitemdelegate.h>
@@ -3476,5 +3475,3 @@ QT_END_NAMESPACE
#include "moc_qtreewidget.cpp"
#include "moc_qtreewidget_p.cpp"
-
-#endif // QT_NO_TREEWIDGET
diff --git a/src/widgets/itemviews/qtreewidget.h b/src/widgets/itemviews/qtreewidget.h
index 5fa6ffcd17..783627cde9 100644
--- a/src/widgets/itemviews/qtreewidget.h
+++ b/src/widgets/itemviews/qtreewidget.h
@@ -46,10 +46,9 @@
#include <QtCore/qvariant.h>
#include <QtCore/qvector.h>
-QT_BEGIN_NAMESPACE
-
+QT_REQUIRE_CONFIG(treewidget);
-#ifndef QT_NO_TREEWIDGET
+QT_BEGIN_NAMESPACE
class QTreeWidget;
class QTreeModel;
@@ -120,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);
@@ -225,7 +224,7 @@ inline void QTreeWidgetItem::setText(int column, const QString &atext)
inline void QTreeWidgetItem::setIcon(int column, const QIcon &aicon)
{ setData(column, Qt::DecorationRole, aicon); }
-#ifndef QT_NO_STATUSTIP
+#if QT_CONFIG(statustip)
inline void QTreeWidgetItem::setStatusTip(int column, const QString &astatusTip)
{ setData(column, Qt::StatusTipRole, astatusTip); }
#endif
@@ -235,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
@@ -432,8 +431,6 @@ inline void QTreeWidgetItem::setDisabled(bool disabled)
inline bool QTreeWidgetItem::isDisabled() const
{ return !(flags() & Qt::ItemIsEnabled); }
-#endif // QT_NO_TREEWIDGET
-
QT_END_NAMESPACE
#endif // QTREEWIDGET_H
diff --git a/src/widgets/itemviews/qtreewidget_p.h b/src/widgets/itemviews/qtreewidget_p.h
index 7789693db4..7aa4daefc0 100644
--- a/src/widgets/itemviews/qtreewidget_p.h
+++ b/src/widgets/itemviews/qtreewidget_p.h
@@ -59,7 +59,7 @@
#include <private/qtreeview_p.h>
#include <QtWidgets/qheaderview.h>
-#ifndef QT_NO_TREEWIDGET
+QT_REQUIRE_CONFIG(treewidget);
QT_BEGIN_NAMESPACE
@@ -242,6 +242,4 @@ public:
QT_END_NAMESPACE
-#endif // QT_NO_TREEWIDGET
-
#endif // QTREEWIDGET_P_H
diff --git a/src/widgets/itemviews/qtreewidgetitemiterator.cpp b/src/widgets/itemviews/qtreewidgetitemiterator.cpp
index 4f27af70a8..1c1f60bc37 100644
--- a/src/widgets/itemviews/qtreewidgetitemiterator.cpp
+++ b/src/widgets/itemviews/qtreewidgetitemiterator.cpp
@@ -42,8 +42,6 @@
#include "qtreewidget_p.h"
#include "qwidgetitemdata_p.h"
-#ifndef QT_NO_TREEWIDGET
-
QT_BEGIN_NAMESPACE
/*!
@@ -453,5 +451,3 @@ void QTreeWidgetItemIteratorPrivate::ensureValidIterator(const QTreeWidgetItem *
*/
QT_END_NAMESPACE
-
-#endif // QT_NO_TREEWIDGET
diff --git a/src/widgets/itemviews/qtreewidgetitemiterator.h b/src/widgets/itemviews/qtreewidgetitemiterator.h
index db17a96abd..39e0244776 100644
--- a/src/widgets/itemviews/qtreewidgetitemiterator.h
+++ b/src/widgets/itemviews/qtreewidgetitemiterator.h
@@ -43,10 +43,9 @@
#include <QtWidgets/qtwidgetsglobal.h>
#include <QtCore/qscopedpointer.h>
-QT_BEGIN_NAMESPACE
-
+QT_REQUIRE_CONFIG(treewidget);
-#ifndef QT_NO_TREEWIDGET
+QT_BEGIN_NAMESPACE
class QTreeWidget;
class QTreeWidgetItem;
@@ -146,7 +145,5 @@ inline QTreeWidgetItem *QTreeWidgetItemIterator::operator*() const
Q_DECLARE_OPERATORS_FOR_FLAGS(QTreeWidgetItemIterator::IteratorFlags)
-
QT_END_NAMESPACE
-#endif // QT_NO_TREEWIDGET
#endif // QTREEWIDGETITEMITERATOR_H
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/qaction.cpp b/src/widgets/kernel/qaction.cpp
index 130c354132..57b1f31188 100644
--- a/src/widgets/kernel/qaction.cpp
+++ b/src/widgets/kernel/qaction.cpp
@@ -93,7 +93,7 @@ QActionPrivate::~QActionPrivate()
bool QActionPrivate::showStatusText(QWidget *widget, const QString &str)
{
-#ifdef QT_NO_STATUSTIP
+#if !QT_CONFIG(statustip)
Q_UNUSED(widget);
Q_UNUSED(str);
#else
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index dc75d5eee7..0286a11612 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -65,7 +65,9 @@
#include "qdebug.h"
#include "private/qstylesheetstyle_p.h"
#include "private/qstyle_p.h"
+#if QT_CONFIG(messagebox)
#include "qmessagebox.h"
+#endif
#include "qwidgetwindow_p.h"
#include <QtWidgets/qgraphicsproxywidget.h>
#include <QtGui/qstylehints.h>
@@ -73,7 +75,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
@@ -407,7 +409,7 @@ QWidget *QApplicationPrivate::main_widget = 0; // main application widget
QWidget *QApplicationPrivate::focus_widget = 0; // has keyboard input focus
QWidget *QApplicationPrivate::hidden_focus_widget = 0; // will get keyboard input focus after show()
QWidget *QApplicationPrivate::active_window = 0; // toplevel with keyboard focus
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
QPointer<QWidget> QApplicationPrivate::wheel_widget;
#endif
bool qt_in_tab_key_event = false;
@@ -1916,9 +1918,9 @@ void QApplication::closeAllWindows()
*/
void QApplication::aboutQt()
{
-#ifndef QT_NO_MESSAGEBOX
+#if QT_CONFIG(messagebox)
QMessageBox::aboutQt(activeWindow());
-#endif // QT_NO_MESSAGEBOX
+#endif // QT_CONFIG(messagebox)
}
/*!
@@ -1999,7 +2001,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;
@@ -2987,13 +2989,13 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
case QEvent::KeyPress:
case QEvent::KeyRelease:
case QEvent::MouseMove:
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
case QEvent::Wheel:
#endif
case QEvent::TouchBegin:
case QEvent::TouchUpdate:
case QEvent::TouchEnd:
-#ifndef QT_NO_TABLETEVENT
+#if QT_CONFIG(tabletevent)
case QEvent::TabletMove:
case QEvent::TabletPress:
case QEvent::TabletRelease:
@@ -3230,7 +3232,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
d->hoverGlobalPos = mouse->globalPos();
}
break;
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
case QEvent::Wheel:
{
QWidget* w = static_cast<QWidget *>(receiver);
@@ -3352,7 +3354,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
}
break;
#endif // QT_NO_CONTEXTMENU
-#ifndef QT_NO_TABLETEVENT
+#if QT_CONFIG(tabletevent)
case QEvent::TabletMove:
case QEvent::TabletPress:
case QEvent::TabletRelease:
@@ -3382,9 +3384,9 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
tablet->setAccepted(eventAccepted);
}
break;
-#endif // QT_NO_TABLETEVENT
+#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:
@@ -3409,7 +3411,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
}
break;
#endif
-#if !defined(QT_NO_STATUSTIP) || !defined(QT_NO_WHATSTHIS)
+#if QT_CONFIG(statustip) || QT_CONFIG(whatsthis)
case QEvent::StatusTip:
case QEvent::WhatsThisClicked:
{
@@ -4043,7 +4045,7 @@ int QApplication::keyboardInputInterval()
\sa QStyleHints::wheelScrollLines()
*/
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
int QApplication::wheelScrollLines()
{
return styleHints()->wheelScrollLines();
diff --git a/src/widgets/kernel/qapplication.h b/src/widgets/kernel/qapplication.h
index be5ec2ad05..396d0c9474 100644
--- a/src/widgets/kernel/qapplication.h
+++ b/src/widgets/kernel/qapplication.h
@@ -76,7 +76,7 @@ class Q_WIDGETS_EXPORT QApplication : public QGuiApplication
Q_PROPERTY(int cursorFlashTime READ cursorFlashTime WRITE setCursorFlashTime)
Q_PROPERTY(int doubleClickInterval READ doubleClickInterval WRITE setDoubleClickInterval)
Q_PROPERTY(int keyboardInputInterval READ keyboardInputInterval WRITE setKeyboardInputInterval)
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
Q_PROPERTY(int wheelScrollLines READ wheelScrollLines WRITE setWheelScrollLines)
#endif
Q_PROPERTY(QSize globalStrut READ globalStrut WRITE setGlobalStrut)
@@ -154,7 +154,7 @@ public:
static void setKeyboardInputInterval(int);
static int keyboardInputInterval();
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
static void setWheelScrollLines(int);
static int wheelScrollLines();
#endif
diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h
index f20d10fe6f..1bd114aad7 100644
--- a/src/widgets/kernel/qapplication_p.h
+++ b/src/widgets/kernel/qapplication_p.h
@@ -195,7 +195,7 @@ public:
static QWidget *focus_widget;
static QWidget *hidden_focus_widget;
static QWidget *active_window;
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
static int wheel_scroll_lines;
static QPointer<QWidget> wheel_widget;
#endif
diff --git a/src/widgets/kernel/qopenglwidget.cpp b/src/widgets/kernel/qopenglwidget.cpp
index 5ea306f463..5bc408a8cd 100644
--- a/src/widgets/kernel/qopenglwidget.cpp
+++ b/src/widgets/kernel/qopenglwidget.cpp
@@ -1427,6 +1427,8 @@ bool QOpenGLWidget::event(QEvent *e)
break;
if (d->initialized)
d->reset();
+ if (isHidden())
+ break;
// FALLTHROUGH
case QEvent::Show: // reparenting may not lead to a resize so reinitalize on Show too
if (d->initialized && window()->windowHandle()
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 95e1a247bb..b0e5900f36 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -70,7 +70,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"
@@ -5114,8 +5116,11 @@ void qt_qpa_set_cursor(QWidget *w, bool force)
\snippet code/src_gui_kernel_qwidget.cpp 8
- \note To obtain the contents of an OpenGL widget, use QGLWidget::grabFrameBuffer()
- or QGLWidget::renderPixmap() instead.
+ \note To obtain the contents of a QOpenGLWidget, use QOpenGLWidget::grabFramebuffer()
+ instead.
+
+ \note To obtain the contents of a QGLWidget (deprecated), use
+ QGLWidget::grabFrameBuffer() or QGLWidget::renderPixmap() instead.
*/
void QWidget::render(QPaintDevice *target, const QPoint &targetOffset,
const QRegion &sourceRegion, RenderFlags renderFlags)
@@ -5845,7 +5850,7 @@ QRectF QWidgetEffectSourcePrivate::boundingRect(Qt::CoordinateSystem system) con
void QWidgetEffectSourcePrivate::draw(QPainter *painter)
{
- if (!context || context->painter != painter || !context->sharedPainter) {
+ if (!context || context->painter != painter) {
m_widget->render(painter);
return;
}
@@ -8762,7 +8767,7 @@ bool QWidget::event(QEvent *event)
case QEvent::ContextMenu:
case QEvent::KeyPress:
case QEvent::KeyRelease:
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
case QEvent::Wheel:
#endif
return false;
@@ -8786,12 +8791,12 @@ bool QWidget::event(QEvent *event)
case QEvent::MouseButtonDblClick:
mouseDoubleClickEvent((QMouseEvent*)event);
break;
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
case QEvent::Wheel:
wheelEvent((QWheelEvent*)event);
break;
#endif
-#ifndef QT_NO_TABLETEVENT
+#if QT_CONFIG(tabletevent)
case QEvent::TabletMove:
if (static_cast<QTabletEvent *>(event)->buttons() == Qt::NoButton && !testAttribute(Qt::WA_TabletTracking))
break;
@@ -8838,7 +8843,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()) {
@@ -8906,7 +8911,7 @@ bool QWidget::event(QEvent *event)
break;
case QEvent::Enter:
-#ifndef QT_NO_STATUSTIP
+#if QT_CONFIG(statustip)
if (d->statusTip.size()) {
QStatusTipEvent tip(d->statusTip);
QApplication::sendEvent(const_cast<QWidget *>(this), &tip);
@@ -8916,7 +8921,7 @@ bool QWidget::event(QEvent *event)
break;
case QEvent::Leave:
-#ifndef QT_NO_STATUSTIP
+#if QT_CONFIG(statustip)
if (d->statusTip.size()) {
QString empty;
QStatusTipEvent tip(empty);
@@ -9137,7 +9142,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);
@@ -9403,7 +9408,7 @@ void QWidget::mouseDoubleClickEvent(QMouseEvent *event)
mousePressEvent(event);
}
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
/*!
This event handler, for event \a event, can be reimplemented in a
subclass to receive wheel events for the widget.
@@ -9422,9 +9427,9 @@ void QWidget::wheelEvent(QWheelEvent *event)
{
event->ignore();
}
-#endif // QT_NO_WHEELEVENT
+#endif // QT_CONFIG(wheelevent)
-#ifndef QT_NO_TABLETEVENT
+#if QT_CONFIG(tabletevent)
/*!
This event handler, for event \a event, can be reimplemented in a
subclass to receive tablet events for the widget.
@@ -9449,7 +9454,7 @@ void QWidget::tabletEvent(QTabletEvent *event)
{
event->ignore();
}
-#endif // QT_NO_TABLETEVENT
+#endif // QT_CONFIG(tabletevent)
/*!
This event handler, for event \a event, can be reimplemented in a
@@ -10494,7 +10499,7 @@ static void sendWindowChangeToTextureChildrenRecursively(QWidget *widget)
for (int i = 0; i < d->children.size(); ++i) {
QWidget *w = qobject_cast<QWidget *>(d->children.at(i));
- if (w && !w->isWindow() && !w->isHidden() && QWidgetPrivate::get(w)->textureChildSeen)
+ if (w && !w->isWindow() && QWidgetPrivate::get(w)->textureChildSeen)
sendWindowChangeToTextureChildrenRecursively(w);
}
}
@@ -11542,7 +11547,7 @@ int QWidget::toolTipDuration() const
#endif // QT_NO_TOOLTIP
-#ifndef QT_NO_STATUSTIP
+#if QT_CONFIG(statustip)
/*!
\property QWidget::statusTip
\brief the widget's status tip
@@ -11562,9 +11567,9 @@ QString QWidget::statusTip() const
Q_D(const QWidget);
return d->statusTip;
}
-#endif // QT_NO_STATUSTIP
+#endif // QT_CONFIG(statustip)
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
/*!
\property QWidget::whatsThis
@@ -11585,7 +11590,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 1c378924a0..87a841c729 100644
--- a/src/widgets/kernel/qwidget.h
+++ b/src/widgets/kernel/qwidget.h
@@ -183,10 +183,10 @@ class Q_WIDGETS_EXPORT QWidget : public QObject, public QPaintDevice
Q_PROPERTY(QString toolTip READ toolTip WRITE setToolTip)
Q_PROPERTY(int toolTipDuration READ toolTipDuration WRITE setToolTipDuration)
#endif
-#ifndef QT_NO_STATUSTIP
+#if QT_CONFIG(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
@@ -386,11 +386,11 @@ public:
void setToolTipDuration(int msec);
int toolTipDuration() const;
#endif
-#ifndef QT_NO_STATUSTIP
+#if QT_CONFIG(statustip)
void setStatusTip(const QString &);
QString statusTip() const;
#endif
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
void setWhatsThis(const QString &);
QString whatsThis() const;
#endif
@@ -613,7 +613,7 @@ protected:
virtual void mouseReleaseEvent(QMouseEvent *event);
virtual void mouseDoubleClickEvent(QMouseEvent *event);
virtual void mouseMoveEvent(QMouseEvent *event);
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
virtual void wheelEvent(QWheelEvent *event);
#endif
virtual void keyPressEvent(QKeyEvent *event);
@@ -629,7 +629,7 @@ protected:
#ifndef QT_NO_CONTEXTMENU
virtual void contextMenuEvent(QContextMenuEvent *event);
#endif
-#ifndef QT_NO_TABLETEVENT
+#if QT_CONFIG(tabletevent)
virtual void tabletEvent(QTabletEvent *event);
#endif
#ifndef QT_NO_ACTION
diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h
index b830895788..db054b9c58 100644
--- a/src/widgets/kernel/qwidget_p.h
+++ b/src/widgets/kernel/qwidget_p.h
@@ -702,10 +702,10 @@ public:
QString toolTip;
int toolTipDuration;
#endif
-#ifndef QT_NO_STATUSTIP
+#if QT_CONFIG(statustip)
QString statusTip;
#endif
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
QString whatsThis;
#endif
#ifndef QT_NO_ACCESSIBILITY
diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp
index 653714743c..d5d4ae844b 100644
--- a/src/widgets/kernel/qwidgetwindow.cpp
+++ b/src/widgets/kernel/qwidgetwindow.cpp
@@ -283,7 +283,7 @@ bool QWidgetWindow::event(QEvent *event)
handleResizeEvent(static_cast<QResizeEvent *>(event));
return true;
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
case QEvent::Wheel:
handleWheelEvent(static_cast<QWheelEvent *>(event));
return true;
@@ -317,7 +317,7 @@ bool QWidgetWindow::event(QEvent *event)
}
return true;
-#ifndef QT_NO_TABLETEVENT
+#if QT_CONFIG(tabletevent)
case QEvent::TabletPress:
case QEvent::TabletMove:
case QEvent::TabletRelease:
@@ -794,7 +794,7 @@ void QWidgetWindow::handleCloseEvent(QCloseEvent *event)
event->setAccepted(is_closing);
}
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void QWidgetWindow::handleWheelEvent(QWheelEvent *event)
{
@@ -824,7 +824,7 @@ void QWidgetWindow::handleWheelEvent(QWheelEvent *event)
QGuiApplication::forwardEvent(widget, &translated, event);
}
-#endif // QT_NO_WHEELEVENT
+#endif // QT_CONFIG(wheelevent)
#ifndef QT_NO_DRAGANDDROP
@@ -978,7 +978,7 @@ bool QWidgetWindow::nativeEvent(const QByteArray &eventType, void *message, long
return m_widget->nativeEvent(eventType, message, result);
}
-#ifndef QT_NO_TABLETEVENT
+#if QT_CONFIG(tabletevent)
void QWidgetWindow::handleTabletEvent(QTabletEvent *event)
{
static QPointer<QWidget> qt_tablet_target = 0;
@@ -1008,7 +1008,7 @@ void QWidgetWindow::handleTabletEvent(QTabletEvent *event)
if (event->type() == QEvent::TabletRelease && event->buttons() == Qt::NoButton)
qt_tablet_target = 0;
}
-#endif // QT_NO_TABLETEVENT
+#endif // QT_CONFIG(tabletevent)
#ifndef QT_NO_GESTURES
void QWidgetWindow::handleGestureEvent(QNativeGestureEvent *e)
diff --git a/src/widgets/kernel/qwidgetwindow_p.h b/src/widgets/kernel/qwidgetwindow_p.h
index 4c7e30da2f..be3f808a22 100644
--- a/src/widgets/kernel/qwidgetwindow_p.h
+++ b/src/widgets/kernel/qwidgetwindow_p.h
@@ -92,7 +92,7 @@ protected:
void handleTouchEvent(QTouchEvent *);
void handleMoveEvent(QMoveEvent *);
void handleResizeEvent(QResizeEvent *);
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void handleWheelEvent(QWheelEvent *);
#endif
#ifndef QT_NO_DRAGANDDROP
@@ -103,7 +103,7 @@ protected:
void handleExposeEvent(QExposeEvent *);
void handleWindowStateChangedEvent(QWindowStateChangeEvent *event);
bool nativeEvent(const QByteArray &eventType, void *message, long *result) Q_DECL_OVERRIDE;
-#ifndef QT_NO_TABLETEVENT
+#if QT_CONFIG(tabletevent)
void handleTabletEvent(QTabletEvent *);
#endif
#ifndef QT_NO_GESTURES
diff --git a/src/widgets/statemachine/qguistatemachine.cpp b/src/widgets/statemachine/qguistatemachine.cpp
index 8d722a4475..543011b754 100644
--- a/src/widgets/statemachine/qguistatemachine.cpp
+++ b/src/widgets/statemachine/qguistatemachine.cpp
@@ -100,10 +100,10 @@ static QEvent *cloneEvent(QEvent *e)
return new QEvent(*e);
case QEvent::HideToParent:
return new QEvent(*e);
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
case QEvent::Wheel:
return new QWheelEvent(*static_cast<QWheelEvent*>(e));
-#endif //QT_NO_WHEELEVENT
+#endif // QT_CONFIG(wheelevent)
case QEvent::WindowTitleChange:
return new QEvent(*e);
case QEvent::WindowIconChange:
@@ -183,12 +183,12 @@ static QEvent *cloneEvent(QEvent *e)
return new QEvent(*e);
case QEvent::Style:
return new QEvent(*e);
-#ifndef QT_NO_TABLETEVENT
+#if QT_CONFIG(tabletevent)
case QEvent::TabletMove:
case QEvent::TabletPress:
case QEvent::TabletRelease:
return new QTabletEvent(*static_cast<QTabletEvent*>(e));
-#endif //QT_NO_TABLETEVENT
+#endif // QT_CONFIG(tabletevent)
case QEvent::OkRequest:
return new QEvent(*e);
case QEvent::HelpRequest:
@@ -223,10 +223,10 @@ static QEvent *cloneEvent(QEvent *e)
return new QHelpEvent(*static_cast<QHelpEvent*>(e));
case QEvent::WhatsThis:
return new QHelpEvent(*static_cast<QHelpEvent*>(e));
-#ifndef QT_NO_STATUSTIP
+#if QT_CONFIG(statustip)
case QEvent::StatusTip:
return new QStatusTipEvent(*static_cast<QStatusTipEvent*>(e));
-#endif //QT_NO_STATUSTIP
+#endif // QT_CONFIG(statustip)
#ifndef QT_NO_ACTION
case QEvent::ActionChanged:
case QEvent::ActionAdded:
@@ -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:
@@ -372,11 +372,11 @@ static QEvent *cloneEvent(QEvent *e)
case QEvent::DynamicPropertyChange:
return new QDynamicPropertyChangeEvent(*static_cast<QDynamicPropertyChangeEvent*>(e));
-#ifndef QT_NO_TABLETEVENT
+#if QT_CONFIG(tabletevent)
case QEvent::TabletEnterProximity:
case QEvent::TabletLeaveProximity:
return new QTabletEvent(*static_cast<QTabletEvent*>(e));
-#endif //QT_NO_TABLETEVENT
+#endif // QT_CONFIG(tabletevent)
case QEvent::NonClientAreaMouseMove:
case QEvent::NonClientAreaMouseButtonPress:
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index 7c6466f5da..8bad65273e 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -74,7 +74,9 @@
#include <private/qmath_p.h>
#include <qdebug.h>
#include <qtextformat.h>
+#if QT_CONFIG(wizard)
#include <qwizard.h>
+#endif
#include <qfileinfo.h>
#include <qdir.h>
#include <qsettings.h>
@@ -5187,7 +5189,7 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget
vret->variant = fmt;
}
break;
-#ifndef QT_NO_WIZARD
+#if QT_CONFIG(wizard)
case SH_WizardStyle:
ret = QWizard::ClassicStyle;
break;
diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp
index 1120958b87..704a226866 100644
--- a/src/widgets/styles/qfusionstyle.cpp
+++ b/src/widgets/styles/qfusionstyle.cpp
@@ -65,7 +65,9 @@
#include <qslider.h>
#include <qsplitter.h>
#include <qprogressbar.h>
+#if QT_CONFIG(wizard)
#include <qwizard.h>
+#endif
#include <qdrawutil.h>
#include <private/qstylehelper_p.h>
#include <private/qdrawhelper_p.h>
@@ -3683,7 +3685,7 @@ int QFusionStyle::styleHint(StyleHint hint, const QStyleOption *option, const QW
case SH_MessageBox_TextInteractionFlags:
return Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse;
-#ifndef QT_NO_WIZARD
+#if QT_CONFIG(wizard)
case SH_WizardStyle:
return QWizard::ClassicStyle;
#endif
diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp
index b537931f49..efbb972a06 100644
--- a/src/widgets/styles/qwindowsstyle.cpp
+++ b/src/widgets/styles/qwindowsstyle.cpp
@@ -60,7 +60,9 @@
#include "qfile.h"
#include "qtextstream.h"
#include "qpixmapcache.h"
+#if QT_CONFIG(wizard)
#include "qwizard.h"
+#endif
#include "qlistview.h"
#include <private/qmath_p.h>
#include <qmath.h>
@@ -621,7 +623,7 @@ int QWindowsStyle::styleHint(StyleHint hint, const QStyleOption *opt, const QWid
}
break;
#endif // QT_NO_RUBBERBAND
-#ifndef QT_NO_WIZARD
+#if QT_CONFIG(wizard)
case SH_WizardStyle:
ret = QWizard::ModernStyle;
break;
diff --git a/src/widgets/util/qcompleter.cpp b/src/widgets/util/qcompleter.cpp
index e22f0e7f28..96f91188b8 100644
--- a/src/widgets/util/qcompleter.cpp
+++ b/src/widgets/util/qcompleter.cpp
@@ -148,7 +148,9 @@
#include "QtWidgets/qscrollbar.h"
#include "QtCore/qstringlistmodel.h"
#include "QtWidgets/qdirmodel.h"
+#if QT_CONFIG(filesystemmodel)
#include "QtWidgets/qfilesystemmodel.h"
+#endif
#include "QtWidgets/qheaderview.h"
#include "QtWidgets/qlistview.h"
#include "QtWidgets/qapplication.h"
@@ -467,7 +469,7 @@ QMatchData QCompletionEngine::filterHistory()
const bool isDirModel = false;
#endif
Q_UNUSED(isDirModel)
-#ifndef QT_NO_FILESYSTEMMODEL
+#if QT_CONFIG(filesystemmodel)
const bool isFsModel = (qobject_cast<QFileSystemModel *>(source) != 0);
#else
const bool isFsModel = false;
@@ -889,7 +891,7 @@ void QCompleterPrivate::_q_complete(QModelIndex index, bool highlighted)
completion += QDir::separator();
}
#endif
-#ifndef QT_NO_FILESYSTEMMODEL
+#if QT_CONFIG(filesystemmodel)
// add a trailing separator in inline
if (mode == QCompleter::InlineCompletion) {
if (qobject_cast<QFileSystemModel *>(proxy->sourceModel()) && QFileInfo(completion).isDir())
@@ -1061,7 +1063,7 @@ void QCompleter::setModel(QAbstractItemModel *model)
{
Q_D(QCompleter);
QAbstractItemModel *oldModel = d->proxy->sourceModel();
-#ifndef QT_NO_FILESYSTEMMODEL
+#if QT_CONFIG(filesystemmodel)
if (qobject_cast<const QFileSystemModel *>(oldModel))
setCompletionRole(Qt::EditRole); // QTBUG-54642, clear FileNameRole set by QFileSystemModel
#endif
@@ -1079,7 +1081,7 @@ void QCompleter::setModel(QAbstractItemModel *model)
#endif
}
#endif // QT_NO_DIRMODEL
-#ifndef QT_NO_FILESYSTEMMODEL
+#if QT_CONFIG(filesystemmodel)
QFileSystemModel *fsModel = qobject_cast<QFileSystemModel *>(model);
if (fsModel) {
#if defined(Q_OS_WIN)
@@ -1090,7 +1092,7 @@ void QCompleter::setModel(QAbstractItemModel *model)
setCompletionRole(QFileSystemModel::FileNameRole);
connect(fsModel, SIGNAL(directoryLoaded(QString)), this, SLOT(_q_fileSystemModelDirectoryLoaded(QString)));
}
-#endif // QT_NO_FILESYSTEMMODEL
+#endif // QT_CONFIG(filesystemmodel)
}
/*!
@@ -1787,7 +1789,7 @@ QString QCompleter::pathFromIndex(const QModelIndex& index) const
#ifndef QT_NO_DIRMODEL
isDirModel = qobject_cast<QDirModel *>(d->proxy->sourceModel()) != 0;
#endif
-#ifndef QT_NO_FILESYSTEMMODEL
+#if QT_CONFIG(filesystemmodel)
isFsModel = qobject_cast<QFileSystemModel *>(d->proxy->sourceModel()) != 0;
#endif
if (!isDirModel && !isFsModel)
@@ -1799,7 +1801,7 @@ QString QCompleter::pathFromIndex(const QModelIndex& index) const
QString t;
if (isDirModel)
t = sourceModel->data(idx, Qt::EditRole).toString();
-#ifndef QT_NO_FILESYSTEMMODEL
+#if QT_CONFIG(filesystemmodel)
else
t = sourceModel->data(idx, QFileSystemModel::FileNameRole).toString();
#endif
@@ -1837,7 +1839,7 @@ QStringList QCompleter::splitPath(const QString& path) const
Q_D(const QCompleter);
isDirModel = qobject_cast<QDirModel *>(d->proxy->sourceModel()) != 0;
#endif
-#ifndef QT_NO_FILESYSTEMMODEL
+#if QT_CONFIG(filesystemmodel)
#ifdef QT_NO_DIRMODEL
Q_D(const QCompleter);
#endif
diff --git a/src/widgets/util/qsystemtrayicon_x11.cpp b/src/widgets/util/qsystemtrayicon_x11.cpp
index cbd5d9eb80..fd9fdfb507 100644
--- a/src/widgets/util/qsystemtrayicon_x11.cpp
+++ b/src/widgets/util/qsystemtrayicon_x11.cpp
@@ -210,7 +210,7 @@ bool QSystemTrayIconSys::event(QEvent *e)
case QEvent::ToolTip:
QApplication::sendEvent(q, e);
break;
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
case QEvent::Wheel:
return QApplication::sendEvent(q, e);
#endif
diff --git a/src/widgets/util/qundogroup.cpp b/src/widgets/util/qundogroup.cpp
index ec4fc2788a..f9605c7a2f 100644
--- a/src/widgets/util/qundogroup.cpp
+++ b/src/widgets/util/qundogroup.cpp
@@ -41,8 +41,6 @@
#include "qundostack.h"
#include "qundostack_p.h"
-#ifndef QT_NO_UNDOGROUP
-
QT_BEGIN_NAMESPACE
class QUndoGroupPrivate : public QObjectPrivate
@@ -502,5 +500,3 @@ QAction *QUndoGroup::createRedoAction(QObject *parent, const QString &prefix) co
QT_END_NAMESPACE
#include "moc_qundogroup.cpp"
-
-#endif // QT_NO_UNDOGROUP
diff --git a/src/widgets/util/qundogroup.h b/src/widgets/util/qundogroup.h
index 4e2fdeed26..dba79ea706 100644
--- a/src/widgets/util/qundogroup.h
+++ b/src/widgets/util/qundogroup.h
@@ -44,15 +44,14 @@
#include <QtCore/qobject.h>
#include <QtCore/qstring.h>
+QT_REQUIRE_CONFIG(undogroup);
+
QT_BEGIN_NAMESPACE
class QUndoGroupPrivate;
class QUndoStack;
class QAction;
-
-#ifndef QT_NO_UNDOGROUP
-
class Q_WIDGETS_EXPORT QUndoGroup : public QObject
{
Q_OBJECT
@@ -97,8 +96,6 @@ private:
Q_DISABLE_COPY(QUndoGroup)
};
-#endif // QT_NO_UNDOGROUP
-
QT_END_NAMESPACE
#endif // QUNDOGROUP_H
diff --git a/src/widgets/util/qundostack.cpp b/src/widgets/util/qundostack.cpp
index dc0b6855ac..b371e903a6 100644
--- a/src/widgets/util/qundostack.cpp
+++ b/src/widgets/util/qundostack.cpp
@@ -39,11 +39,11 @@
#include <QtCore/qdebug.h>
#include "qundostack.h"
+#if QT_CONFIG(undogroup)
#include "qundogroup.h"
+#endif
#include "qundostack_p.h"
-#ifndef QT_NO_UNDOCOMMAND
-
QT_BEGIN_NAMESPACE
/*!
@@ -340,9 +340,7 @@ const QUndoCommand *QUndoCommand::child(int index) const
return d->child_list.at(index);
}
-#endif // QT_NO_UNDOCOMMAND
-
-#ifndef QT_NO_UNDOSTACK
+#if QT_CONFIG(undostack)
/*!
\class QUndoStack
@@ -544,7 +542,7 @@ bool QUndoStackPrivate::checkUndoLimit()
QUndoStack::QUndoStack(QObject *parent)
: QObject(*(new QUndoStackPrivate), parent)
{
-#ifndef QT_NO_UNDOGROUP
+#if QT_CONFIG(undogroup)
if (QUndoGroup *group = qobject_cast<QUndoGroup*>(parent))
group->addStack(this);
#endif
@@ -559,7 +557,7 @@ QUndoStack::QUndoStack(QObject *parent)
QUndoStack::~QUndoStack()
{
-#ifndef QT_NO_UNDOGROUP
+#if QT_CONFIG(undogroup)
Q_D(QUndoStack);
if (d->group != 0)
d->group->removeStack(this);
@@ -1247,7 +1245,7 @@ int QUndoStack::undoLimit() const
void QUndoStack::setActive(bool active)
{
-#ifdef QT_NO_UNDOGROUP
+#if !QT_CONFIG(undogroup)
Q_UNUSED(active);
#else
Q_D(QUndoStack);
@@ -1263,7 +1261,7 @@ void QUndoStack::setActive(bool active)
bool QUndoStack::isActive() const
{
-#ifdef QT_NO_UNDOGROUP
+#if !QT_CONFIG(undogroup)
return true;
#else
Q_D(const QUndoStack);
@@ -1332,4 +1330,4 @@ QT_END_NAMESPACE
#include "moc_qundostack.cpp"
#include "moc_qundostack_p.cpp"
-#endif // QT_NO_UNDOSTACK
+#endif // QT_CONFIG(undostack)
diff --git a/src/widgets/util/qundostack.h b/src/widgets/util/qundostack.h
index 2a8f4decb6..7ab90b507a 100644
--- a/src/widgets/util/qundostack.h
+++ b/src/widgets/util/qundostack.h
@@ -44,15 +44,14 @@
#include <QtCore/qobject.h>
#include <QtCore/qstring.h>
-QT_BEGIN_NAMESPACE
+QT_REQUIRE_CONFIG(undocommand);
+QT_BEGIN_NAMESPACE
class QAction;
class QUndoCommandPrivate;
class QUndoStackPrivate;
-#ifndef QT_NO_UNDOCOMMAND
-
class Q_WIDGETS_EXPORT QUndoCommand
{
QUndoCommandPrivate *d;
@@ -83,9 +82,7 @@ private:
friend class QUndoStack;
};
-#endif // QT_NO_UNDOCOMMAND
-
-#ifndef QT_NO_UNDOSTACK
+#if QT_CONFIG(undostack)
class Q_WIDGETS_EXPORT QUndoStack : public QObject
{
@@ -150,7 +147,7 @@ private:
friend class QUndoGroup;
};
-#endif // QT_NO_UNDOSTACK
+#endif // QT_CONFIG(undostack)
QT_END_NAMESPACE
diff --git a/src/widgets/util/qundostack_p.h b/src/widgets/util/qundostack_p.h
index e92a1fe620..04bc381114 100644
--- a/src/widgets/util/qundostack_p.h
+++ b/src/widgets/util/qundostack_p.h
@@ -74,7 +74,7 @@ public:
bool obsolete;
};
-#ifndef QT_NO_UNDOSTACK
+#if QT_CONFIG(undostack)
class QUndoStackPrivate : public QObjectPrivate
{
@@ -108,7 +108,6 @@ private:
};
#endif // QT_NO_ACTION
-
QT_END_NAMESPACE
-#endif // QT_NO_UNDOSTACK
+#endif // QT_CONFIG(undostack)
#endif // QUNDOSTACK_P_H
diff --git a/src/widgets/util/qundoview.cpp b/src/widgets/util/qundoview.cpp
index 93c1778ea2..b56aa42aed 100644
--- a/src/widgets/util/qundoview.cpp
+++ b/src/widgets/util/qundoview.cpp
@@ -40,9 +40,9 @@
#include "qundostack.h"
#include "qundoview.h"
-#ifndef QT_NO_UNDOVIEW
-
+#if QT_CONFIG(undogroup)
#include "qundogroup.h"
+#endif
#include <QtCore/qabstractitemmodel.h>
#include <QtCore/qpointer.h>
#include <QtGui/qicon.h>
@@ -273,12 +273,12 @@ class QUndoViewPrivate : public QListViewPrivate
Q_DECLARE_PUBLIC(QUndoView)
public:
QUndoViewPrivate() :
-#ifndef QT_NO_UNDOGROUP
+#if QT_CONFIG(undogroup)
group(0),
#endif
model(0) {}
-#ifndef QT_NO_UNDOGROUP
+#if QT_CONFIG(undogroup)
QPointer<QUndoGroup> group;
#endif
QUndoModel *model;
@@ -318,7 +318,7 @@ QUndoView::QUndoView(QUndoStack *stack, QWidget *parent)
setStack(stack);
}
-#ifndef QT_NO_UNDOGROUP
+#if QT_CONFIG(undogroup)
/*!
Constructs a new view with parent \a parent and sets the observed group to \a group.
@@ -334,7 +334,7 @@ QUndoView::QUndoView(QUndoGroup *group, QWidget *parent)
setGroup(group);
}
-#endif // QT_NO_UNDOGROUP
+#endif // QT_CONFIG(undogroup)
/*!
Destroys this view.
@@ -369,13 +369,13 @@ QUndoStack *QUndoView::stack() const
void QUndoView::setStack(QUndoStack *stack)
{
Q_D(QUndoView);
-#ifndef QT_NO_UNDOGROUP
+#if QT_CONFIG(undogroup)
setGroup(0);
#endif
d->model->setStack(stack);
}
-#ifndef QT_NO_UNDOGROUP
+#if QT_CONFIG(undogroup)
/*!
Sets the group displayed by this view to \a group. If \a group is 0, the view will
@@ -423,7 +423,7 @@ QUndoGroup *QUndoView::group() const
return d->group;
}
-#endif // QT_NO_UNDOGROUP
+#endif // QT_CONFIG(undogroup)
/*!
\property QUndoView::emptyLabel
@@ -473,5 +473,3 @@ QT_END_NAMESPACE
#include "qundoview.moc"
#include "moc_qundoview.cpp"
-
-#endif // QT_NO_UNDOVIEW
diff --git a/src/widgets/util/qundoview.h b/src/widgets/util/qundoview.h
index 3ed9ea5989..0bfcdd0c18 100644
--- a/src/widgets/util/qundoview.h
+++ b/src/widgets/util/qundoview.h
@@ -44,7 +44,7 @@
#include <QtWidgets/qlistview.h>
#include <QtCore/qstring.h>
-#ifndef QT_NO_UNDOVIEW
+QT_REQUIRE_CONFIG(undoview);
QT_BEGIN_NAMESPACE
@@ -64,13 +64,13 @@ class Q_WIDGETS_EXPORT QUndoView : public QListView
public:
explicit QUndoView(QWidget *parent = Q_NULLPTR);
explicit QUndoView(QUndoStack *stack, QWidget *parent = Q_NULLPTR);
-#ifndef QT_NO_UNDOGROUP
+#if QT_CONFIG(undogroup)
explicit QUndoView(QUndoGroup *group, QWidget *parent = Q_NULLPTR);
#endif
~QUndoView();
QUndoStack *stack() const;
-#ifndef QT_NO_UNDOGROUP
+#if QT_CONFIG(undogroup)
QUndoGroup *group() const;
#endif
@@ -82,7 +82,7 @@ public:
public Q_SLOTS:
void setStack(QUndoStack *stack);
-#ifndef QT_NO_UNDOGROUP
+#if QT_CONFIG(undogroup)
void setGroup(QUndoGroup *group);
#endif
@@ -92,5 +92,4 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_UNDOVIEW
#endif // QUNDOVIEW_H
diff --git a/src/widgets/util/util.pri b/src/widgets/util/util.pri
index 6abf6c8809..701758a406 100644
--- a/src/widgets/util/util.pri
+++ b/src/widgets/util/util.pri
@@ -5,19 +5,12 @@ HEADERS += \
util/qcolormap.h \
util/qcompleter.h \
util/qcompleter_p.h \
- util/qsystemtrayicon_p.h \
- util/qundogroup.h \
- util/qundostack.h \
- util/qundostack_p.h \
- util/qundoview.h
+ util/qsystemtrayicon_p.h
SOURCES += \
util/qsystemtrayicon.cpp \
util/qcolormap.cpp \
- util/qcompleter.cpp \
- util/qundogroup.cpp \
- util/qundostack.cpp \
- util/qundoview.cpp
+ util/qcompleter.cpp
qtConfig(scroller) {
HEADERS += \
@@ -33,6 +26,24 @@ qtConfig(scroller) {
util/qflickgesture.cpp \
}
+qtConfig(undocommand) {
+ HEADERS += \
+ util/qundostack.h \
+ util/qundostack_p.h
+
+ SOURCES += util/qundostack.cpp
+}
+
+qtConfig(undogroup) {
+ HEADERS += util/qundogroup.h
+ SOURCES += util/qundogroup.cpp
+}
+
+qtConfig(undoview) {
+ HEADERS += util/qundoview.h
+ SOURCES += util/qundoview.cpp
+}
+
qtConfig(xcb) {
SOURCES += util/qsystemtrayicon_x11.cpp
} else {
diff --git a/src/widgets/widgets/qabstractbutton.cpp b/src/widgets/widgets/qabstractbutton.cpp
index 77fb203b82..e65613d5cd 100644
--- a/src/widgets/widgets/qabstractbutton.cpp
+++ b/src/widgets/widgets/qabstractbutton.cpp
@@ -935,7 +935,7 @@ bool QAbstractButton::event(QEvent *e)
case QEvent::HoverEnter:
case QEvent::HoverLeave:
case QEvent::ContextMenu:
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
case QEvent::Wheel:
#endif
return true;
diff --git a/src/widgets/widgets/qabstractscrollarea.cpp b/src/widgets/widgets/qabstractscrollarea.cpp
index abdd946c49..673983d575 100644
--- a/src/widgets/widgets/qabstractscrollarea.cpp
+++ b/src/widgets/widgets/qabstractscrollarea.cpp
@@ -1188,7 +1188,7 @@ bool QAbstractScrollArea::viewportEvent(QEvent *e)
case QEvent::TouchEnd:
case QEvent::MouseMove:
case QEvent::ContextMenu:
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
case QEvent::Wheel:
#endif
#ifndef QT_NO_DRAGANDDROP
@@ -1305,7 +1305,7 @@ void QAbstractScrollArea::mouseMoveEvent(QMouseEvent *e)
\sa QWidget::wheelEvent()
*/
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void QAbstractScrollArea::wheelEvent(QWheelEvent *e)
{
Q_D(QAbstractScrollArea);
diff --git a/src/widgets/widgets/qabstractscrollarea.h b/src/widgets/widgets/qabstractscrollarea.h
index 476914b781..193fabce56 100644
--- a/src/widgets/widgets/qabstractscrollarea.h
+++ b/src/widgets/widgets/qabstractscrollarea.h
@@ -116,7 +116,7 @@ protected:
void mouseReleaseEvent(QMouseEvent *) Q_DECL_OVERRIDE;
void mouseDoubleClickEvent(QMouseEvent *) Q_DECL_OVERRIDE;
void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE;
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *) Q_DECL_OVERRIDE;
#endif
#ifndef QT_NO_CONTEXTMENU
diff --git a/src/widgets/widgets/qabstractslider.cpp b/src/widgets/widgets/qabstractslider.cpp
index 0ea9250695..99ee1eccb7 100644
--- a/src/widgets/widgets/qabstractslider.cpp
+++ b/src/widgets/widgets/qabstractslider.cpp
@@ -710,7 +710,7 @@ bool QAbstractSliderPrivate::scrollByDelta(Qt::Orientation orientation, Qt::Keyb
// offset), we might end up with a fraction (e.g. scroll 1.3 lines). We can
// only scroll whole lines, so we keep the reminder until next event.
qreal stepsToScrollF =
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
QApplication::wheelScrollLines() *
#endif
offset * effectiveSingleStep();
@@ -759,7 +759,7 @@ bool QAbstractSliderPrivate::scrollByDelta(Qt::Orientation orientation, Qt::Keyb
/*!
\reimp
*/
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void QAbstractSlider::wheelEvent(QWheelEvent * e)
{
Q_D(QAbstractSlider);
diff --git a/src/widgets/widgets/qabstractslider.h b/src/widgets/widgets/qabstractslider.h
index 8979685724..d26d6a879c 100644
--- a/src/widgets/widgets/qabstractslider.h
+++ b/src/widgets/widgets/qabstractslider.h
@@ -146,7 +146,7 @@ protected:
void keyPressEvent(QKeyEvent *ev) Q_DECL_OVERRIDE;
void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE;
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *e) Q_DECL_OVERRIDE;
#endif
void changeEvent(QEvent *e) Q_DECL_OVERRIDE;
diff --git a/src/widgets/widgets/qabstractspinbox.cpp b/src/widgets/widgets/qabstractspinbox.cpp
index 501d9560d9..4a3abe0c32 100644
--- a/src/widgets/widgets/qabstractspinbox.cpp
+++ b/src/widgets/widgets/qabstractspinbox.cpp
@@ -1119,7 +1119,7 @@ void QAbstractSpinBox::keyReleaseEvent(QKeyEvent *event)
\reimp
*/
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void QAbstractSpinBox::wheelEvent(QWheelEvent *event)
{
Q_D(QAbstractSpinBox);
diff --git a/src/widgets/widgets/qabstractspinbox.h b/src/widgets/widgets/qabstractspinbox.h
index b60178b94c..d81cbfdc34 100644
--- a/src/widgets/widgets/qabstractspinbox.h
+++ b/src/widgets/widgets/qabstractspinbox.h
@@ -137,7 +137,7 @@ protected:
void resizeEvent(QResizeEvent *event) override;
void keyPressEvent(QKeyEvent *event) override;
void keyReleaseEvent(QKeyEvent *event) override;
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *event) override;
#endif
void focusInEvent(QFocusEvent *event) override;
diff --git a/src/widgets/widgets/qcalendarwidget.cpp b/src/widgets/widgets/qcalendarwidget.cpp
index f81377a85c..c5db3a7c9a 100644
--- a/src/widgets/widgets/qcalendarwidget.cpp
+++ b/src/widgets/widgets/qcalendarwidget.cpp
@@ -957,7 +957,7 @@ protected:
void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
#endif
void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
@@ -1412,7 +1412,7 @@ void QCalendarView::keyPressEvent(QKeyEvent *event)
QTableView::keyPressEvent(event);
}
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void QCalendarView::wheelEvent(QWheelEvent *event)
{
const int numDegrees = event->delta() / 8;
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp
index 29c51a2de1..21b3eab0ad 100644
--- a/src/widgets/widgets/qcombobox.cpp
+++ b/src/widgets/widgets/qcombobox.cpp
@@ -3294,7 +3294,7 @@ void QComboBox::keyReleaseEvent(QKeyEvent *e)
/*!
\reimp
*/
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void QComboBox::wheelEvent(QWheelEvent *e)
{
#ifdef Q_OS_DARWIN
diff --git a/src/widgets/widgets/qcombobox.h b/src/widgets/widgets/qcombobox.h
index 2da1ceb047..8f99594a76 100644
--- a/src/widgets/widgets/qcombobox.h
+++ b/src/widgets/widgets/qcombobox.h
@@ -234,7 +234,7 @@ protected:
void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
void keyPressEvent(QKeyEvent *e) Q_DECL_OVERRIDE;
void keyReleaseEvent(QKeyEvent *e) Q_DECL_OVERRIDE;
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *e) Q_DECL_OVERRIDE;
#endif
#ifndef QT_NO_CONTEXTMENU
diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp
index c9db198d21..46e6369e3c 100644
--- a/src/widgets/widgets/qdatetimeedit.cpp
+++ b/src/widgets/widgets/qdatetimeedit.cpp
@@ -1194,7 +1194,7 @@ void QDateTimeEdit::keyPressEvent(QKeyEvent *event)
\reimp
*/
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void QDateTimeEdit::wheelEvent(QWheelEvent *event)
{
QAbstractSpinBox::wheelEvent(event);
diff --git a/src/widgets/widgets/qdatetimeedit.h b/src/widgets/widgets/qdatetimeedit.h
index b54b0e7cf0..30e4a58bb3 100644
--- a/src/widgets/widgets/qdatetimeedit.h
+++ b/src/widgets/widgets/qdatetimeedit.h
@@ -177,7 +177,7 @@ public Q_SLOTS:
protected:
void keyPressEvent(QKeyEvent *event) override;
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *event) override;
#endif
void focusInEvent(QFocusEvent *event) override;
diff --git a/src/widgets/widgets/qfontcombobox.cpp b/src/widgets/widgets/qfontcombobox.cpp
index 9bd33409ae..f206d01999 100644
--- a/src/widgets/widgets/qfontcombobox.cpp
+++ b/src/widgets/widgets/qfontcombobox.cpp
@@ -39,8 +39,6 @@
#include "qfontcombobox.h"
-#ifndef QT_NO_FONTCOMBOBOX
-
#include <qstringlistmodel.h>
#include <qitemdelegate.h>
#include <qlistview.h>
@@ -563,5 +561,3 @@ QT_END_NAMESPACE
#include "qfontcombobox.moc"
#include "moc_qfontcombobox.cpp"
-
-#endif // QT_NO_FONTCOMBOBOX
diff --git a/src/widgets/widgets/qfontcombobox.h b/src/widgets/widgets/qfontcombobox.h
index 983d5224dd..1e4555ce2d 100644
--- a/src/widgets/widgets/qfontcombobox.h
+++ b/src/widgets/widgets/qfontcombobox.h
@@ -44,11 +44,10 @@
#include <QtWidgets/qcombobox.h>
#include <QtGui/qfontdatabase.h>
-#ifndef QT_NO_FONTCOMBOBOX
+QT_REQUIRE_CONFIG(fontcombobox);
QT_BEGIN_NAMESPACE
-
class QFontComboBoxPrivate;
class Q_WIDGETS_EXPORT QFontComboBox : public QComboBox
@@ -101,5 +100,4 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QFontComboBox::FontFilters)
QT_END_NAMESPACE
-#endif // QT_NO_FONTCOMBOBOX
#endif
diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp
index 75e3524ab2..1a4e9ae87b 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/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp
index e47efb50b3..889082cb2a 100644
--- a/src/widgets/widgets/qmainwindow.cpp
+++ b/src/widgets/widgets/qmainwindow.cpp
@@ -1311,7 +1311,7 @@ bool QMainWindow::event(QEvent *event)
}
#endif
-#ifndef QT_NO_STATUSTIP
+#if QT_CONFIG(statustip)
case QEvent::StatusTip:
#ifndef QT_NO_STATUSBAR
if (QStatusBar *sb = d->layout->statusBar())
@@ -1320,7 +1320,7 @@ bool QMainWindow::event(QEvent *event)
#endif
static_cast<QStatusTipEvent*>(event)->ignore();
return true;
-#endif // QT_NO_STATUSTIP
+#endif // QT_CONFIG(statustip)
case QEvent::StyleChange:
#ifndef QT_NO_DOCKWIDGET
diff --git a/src/widgets/widgets/qmdisubwindow.cpp b/src/widgets/widgets/qmdisubwindow.cpp
index c2dcacc6ba..664dd8d710 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>
@@ -1487,7 +1489,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 bdcc4afff3..1b8409dba2 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);
@@ -663,7 +663,7 @@ void QMenuPrivate::setCurrentAction(QAction *action, int popup, SelectionReason
}
}
}
-#ifndef QT_NO_STATUSTIP
+#if QT_CONFIG(statustip)
} else if (previousAction) {
previousAction->d_func()->showStatusText(topCausedWidget(), QString());
#endif
@@ -1333,12 +1333,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())))
@@ -1349,7 +1349,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
@@ -1368,7 +1368,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())
@@ -2805,7 +2805,7 @@ void QMenu::paintEvent(QPaintEvent *e)
style()->drawControl(QStyle::CE_MenuEmptyArea, &menuOpt, &p, this);
}
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
/*!
\reimp
*/
@@ -2979,7 +2979,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())) {
@@ -3241,7 +3241,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/qmenu.h b/src/widgets/widgets/qmenu.h
index dbfd12124c..61849790cf 100644
--- a/src/widgets/widgets/qmenu.h
+++ b/src/widgets/widgets/qmenu.h
@@ -237,7 +237,7 @@ protected:
void mouseReleaseEvent(QMouseEvent *) Q_DECL_OVERRIDE;
void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE;
void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE;
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *) Q_DECL_OVERRIDE;
#endif
void enterEvent(QEvent *) Q_DECL_OVERRIDE;
diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp
index c16b2a5ac1..552409a4ed 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"
@@ -376,7 +378,7 @@ void QMenuBarPrivate::setCurrentAction(QAction *action, bool popup, bool activat
q->update(actionRect(currentAction));
popupState = popup;
-#ifndef QT_NO_STATUSTIP
+#if QT_CONFIG(statustip)
QAction *previousAction = currentAction;
#endif
currentAction = action;
@@ -385,7 +387,7 @@ void QMenuBarPrivate::setCurrentAction(QAction *action, bool popup, bool activat
if(popup)
popupAction(action, activateFirst);
q->update(actionRect(action));
-#ifndef QT_NO_STATUSTIP
+#if QT_CONFIG(statustip)
} else if (previousAction) {
QString empty;
QStatusTipEvent tip(empty);
@@ -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/qplaintextedit.cpp b/src/widgets/widgets/qplaintextedit.cpp
index 746dc20122..173be7aa88 100644
--- a/src/widgets/widgets/qplaintextedit.cpp
+++ b/src/widgets/widgets/qplaintextedit.cpp
@@ -2296,7 +2296,7 @@ void QPlainTextEdit::changeEvent(QEvent *e)
/*! \reimp
*/
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void QPlainTextEdit::wheelEvent(QWheelEvent *e)
{
Q_D(QPlainTextEdit);
diff --git a/src/widgets/widgets/qplaintextedit.h b/src/widgets/widgets/qplaintextedit.h
index 432ec85a57..d773c4791c 100644
--- a/src/widgets/widgets/qplaintextedit.h
+++ b/src/widgets/widgets/qplaintextedit.h
@@ -250,7 +250,7 @@ protected:
virtual void focusOutEvent(QFocusEvent *e) Q_DECL_OVERRIDE;
virtual void showEvent(QShowEvent *) Q_DECL_OVERRIDE;
virtual void changeEvent(QEvent *e) Q_DECL_OVERRIDE;
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
virtual void wheelEvent(QWheelEvent *e) Q_DECL_OVERRIDE;
#endif
diff --git a/src/widgets/widgets/qscrollbar.cpp b/src/widgets/widgets/qscrollbar.cpp
index 66f1a4c689..a98f3fe085 100644
--- a/src/widgets/widgets/qscrollbar.cpp
+++ b/src/widgets/widgets/qscrollbar.cpp
@@ -493,7 +493,7 @@ bool QScrollBar::event(QEvent *event)
/*!
\reimp
*/
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void QScrollBar::wheelEvent(QWheelEvent *event)
{
event->ignore();
diff --git a/src/widgets/widgets/qscrollbar.h b/src/widgets/widgets/qscrollbar.h
index b99ad219eb..963ae4263b 100644
--- a/src/widgets/widgets/qscrollbar.h
+++ b/src/widgets/widgets/qscrollbar.h
@@ -64,7 +64,7 @@ public:
bool event(QEvent *event) Q_DECL_OVERRIDE;
protected:
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *) Q_DECL_OVERRIDE;
#endif
void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp
index 060d1f9a03..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"
@@ -176,10 +178,6 @@ void QTabBarPrivate::initBasicStyleOption(QStyleOptionTab *option, int tabIndex)
if (tab.textColor.isValid())
option->palette.setColor(q->foregroundRole(), tab.textColor);
- else if (q->style()->inherits("QMacStyle")
- && isCurrent && !documentMode && q->isActiveWindow()) {
- option->palette.setColor(QPalette::WindowText, Qt::white);
- }
option->icon = tab.icon;
option->iconSize = q->iconSize(); // Will get the default value then.
@@ -451,9 +449,10 @@ void QTabBarPrivate::layoutTabs()
QVector<QLayoutStruct> tabChain(tabList.count() + 2);
// We put an empty item at the front and back and set its expansive attribute
- // depending on tabAlignment.
+ // depending on tabAlignment and expanding.
tabChain[tabChainIndex].init();
- tabChain[tabChainIndex].expansive = (tabAlignment != Qt::AlignLeft)
+ tabChain[tabChainIndex].expansive = (!expanding)
+ && (tabAlignment != Qt::AlignLeft)
&& (tabAlignment != Qt::AlignJustify);
tabChain[tabChainIndex].empty = true;
++tabChainIndex;
@@ -518,13 +517,12 @@ void QTabBarPrivate::layoutTabs()
maxExtent = maxWidth;
}
- if (!expanding) {
- // Mirror our front item.
- tabChain[tabChainIndex].init();
- tabChain[tabChainIndex].expansive = (tabAlignment != Qt::AlignRight)
- && (tabAlignment != Qt::AlignJustify);
- tabChain[tabChainIndex].empty = true;
- }
+ // Mirror our front item.
+ tabChain[tabChainIndex].init();
+ tabChain[tabChainIndex].expansive = (!expanding)
+ && (tabAlignment != Qt::AlignRight)
+ && (tabAlignment != Qt::AlignJustify);
+ tabChain[tabChainIndex].empty = true;
Q_ASSERT(tabChainIndex == tabChain.count() - 1); // add an assert just to make sure.
// Do the calculation
@@ -1224,7 +1222,7 @@ QString QTabBar::tabToolTip(int index) const
}
#endif // QT_NO_TOOLTIP
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
/*!
\since 4.1
@@ -1252,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.
@@ -1632,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())
@@ -1646,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);
@@ -2185,7 +2183,7 @@ void QTabBar::keyPressEvent(QKeyEvent *event)
/*!\reimp
*/
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void QTabBar::wheelEvent(QWheelEvent *event)
{
#ifndef Q_OS_MAC
@@ -2197,7 +2195,7 @@ void QTabBar::wheelEvent(QWheelEvent *event)
Q_UNUSED(event)
#endif
}
-#endif //QT_NO_WHEELEVENT
+#endif // QT_CONFIG(wheelevent)
void QTabBarPrivate::setCurrentNextEnabledIndex(int offset)
{
diff --git a/src/widgets/widgets/qtabbar.h b/src/widgets/widgets/qtabbar.h
index 71ca58c993..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
@@ -203,7 +203,7 @@ protected:
void mousePressEvent (QMouseEvent *) Q_DECL_OVERRIDE;
void mouseMoveEvent (QMouseEvent *) Q_DECL_OVERRIDE;
void mouseReleaseEvent (QMouseEvent *) Q_DECL_OVERRIDE;
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
#endif
void keyPressEvent(QKeyEvent *) Q_DECL_OVERRIDE;
diff --git a/src/widgets/widgets/qtabbar_p.h b/src/widgets/widgets/qtabbar_p.h
index 6c5db02764..7141ffc8d5 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/qtextedit.cpp b/src/widgets/widgets/qtextedit.cpp
index 1abc9bef8e..6973cec429 100644
--- a/src/widgets/widgets/qtextedit.cpp
+++ b/src/widgets/widgets/qtextedit.cpp
@@ -1831,7 +1831,7 @@ void QTextEdit::changeEvent(QEvent *e)
/*! \reimp
*/
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void QTextEdit::wheelEvent(QWheelEvent *e)
{
Q_D(QTextEdit);
diff --git a/src/widgets/widgets/qtextedit.h b/src/widgets/widgets/qtextedit.h
index b0e19193a9..745b644511 100644
--- a/src/widgets/widgets/qtextedit.h
+++ b/src/widgets/widgets/qtextedit.h
@@ -288,7 +288,7 @@ protected:
virtual void focusOutEvent(QFocusEvent *e) Q_DECL_OVERRIDE;
virtual void showEvent(QShowEvent *) Q_DECL_OVERRIDE;
virtual void changeEvent(QEvent *e) Q_DECL_OVERRIDE;
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
virtual void wheelEvent(QWheelEvent *e) Q_DECL_OVERRIDE;
#endif
diff --git a/src/widgets/widgets/qtoolbutton.cpp b/src/widgets/widgets/qtoolbutton.cpp
index 80a061e6d5..13595575e6 100644
--- a/src/widgets/widgets/qtoolbutton.cpp
+++ b/src/widgets/widgets/qtoolbutton.cpp
@@ -919,10 +919,10 @@ void QToolButton::setDefaultAction(QAction *action)
#ifndef QT_NO_TOOLTIP
setToolTip(action->toolTip());
#endif
-#ifndef QT_NO_STATUSTIP
+#if QT_CONFIG(statustip)
setStatusTip(action->statusTip());
#endif
-#ifndef QT_NO_WHATSTHIS
+#if QT_CONFIG(whatsthis)
setWhatsThis(action->whatsThis());
#endif
#ifndef QT_NO_MENU
diff --git a/src/widgets/widgets/widgets.pri b/src/widgets/widgets/widgets.pri
index 1779c8d183..726235ef4e 100644
--- a/src/widgets/widgets/widgets.pri
+++ b/src/widgets/widgets/widgets.pri
@@ -14,7 +14,6 @@ HEADERS += \
widgets/qdockwidget.h \
widgets/qdockwidget_p.h \
widgets/qdockarealayout_p.h \
- widgets/qfontcombobox.h \
widgets/qframe.h \
widgets/qframe_p.h \
widgets/qgroupbox.h \
@@ -78,7 +77,6 @@ SOURCES += \
widgets/qdockwidget.cpp \
widgets/qdockarealayout.cpp \
widgets/qeffects.cpp \
- widgets/qfontcombobox.cpp \
widgets/qframe.cpp \
widgets/qgroupbox.cpp \
widgets/qkeysequenceedit.cpp \
@@ -152,6 +150,11 @@ qtConfig(commandlinkbutton) {
widgets/qcommandlinkbutton.cpp
}
+qtConfig(fontcombobox) {
+ HEADERS += widgets/qfontcombobox.h
+ SOURCES += widgets/qfontcombobox.cpp
+}
+
qtConfig(label) {
HEADERS += \
widgets/qlabel.h \