summaryrefslogtreecommitdiffstats
path: root/src/widgets/dialogs
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/dialogs
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/dialogs')
-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
27 files changed, 143 insertions, 175 deletions
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