Convert features.colordialog to QT_[REQUIRE_]CONFIG

Change-Id: If2ac57a10f38002db5a49be3882dfc507a84a3df
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
Stephan Binner 2017-05-31 21:00:22 +02:00
parent 7a1b7c7420
commit 3ab0ba7bf2
8 changed files with 22 additions and 21 deletions

View File

@ -20,7 +20,6 @@ OBJECTIVE_SOURCES += main.mm \
qmultitouch_mac.mm \ qmultitouch_mac.mm \
qcocoaaccessibilityelement.mm \ qcocoaaccessibilityelement.mm \
qcocoaaccessibility.mm \ qcocoaaccessibility.mm \
qcocoacolordialoghelper.mm \
qcocoafontdialoghelper.mm \ qcocoafontdialoghelper.mm \
qcocoacursor.mm \ qcocoacursor.mm \
qcocoaclipboard.mm \ qcocoaclipboard.mm \
@ -54,7 +53,6 @@ HEADERS += qcocoaintegration.h \
qmultitouch_mac_p.h \ qmultitouch_mac_p.h \
qcocoaaccessibilityelement.h \ qcocoaaccessibilityelement.h \
qcocoaaccessibility.h \ qcocoaaccessibility.h \
qcocoacolordialoghelper.h \
qcocoafontdialoghelper.h \ qcocoafontdialoghelper.h \
qcocoacursor.h \ qcocoacursor.h \
qcocoaclipboard.h \ qcocoaclipboard.h \
@ -101,6 +99,11 @@ qtHaveModule(widgets) {
qcocoaprintersupport.h \ qcocoaprintersupport.h \
qcocoaprintdevice.h \ qcocoaprintdevice.h \
qtConfig(colordialog) {
SOURCES += qcocoacolordialoghelper.mm
HEADERS += qcocoacolordialoghelper.h
}
qtConfig(filedialog) { qtConfig(filedialog) {
SOURCES += qcocoafiledialoghelper.mm SOURCES += qcocoafiledialoghelper.mm
HEADERS += qcocoafiledialoghelper.h HEADERS += qcocoafiledialoghelper.h

View File

@ -40,9 +40,13 @@
#ifndef QCOCOACOLORDIALOGHELPER_H #ifndef QCOCOACOLORDIALOGHELPER_H
#define QCOCOACOLORDIALOGHELPER_H #define QCOCOACOLORDIALOGHELPER_H
#include <QtWidgets/qtwidgetsglobal.h>
#include <QObject> #include <QObject>
#include <qpa/qplatformdialoghelper.h> #include <qpa/qplatformdialoghelper.h>
QT_REQUIRE_CONFIG(colordialog);
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QCocoaColorDialogHelper : public QPlatformColorDialogHelper class QCocoaColorDialogHelper : public QPlatformColorDialogHelper

View File

@ -37,8 +37,6 @@
** **
****************************************************************************/ ****************************************************************************/
#ifndef QT_NO_COLORDIALOG
#include <QtCore/qdebug.h> #include <QtCore/qdebug.h>
#include <QtCore/qtimer.h> #include <QtCore/qtimer.h>
#include <qpa/qplatformtheme.h> #include <qpa/qplatformtheme.h>
@ -424,5 +422,3 @@ QColor QCocoaColorDialogHelper::currentColor() const
} }
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QT_NO_COLORDIALOG

View File

@ -130,7 +130,7 @@ bool QCocoaTheme::usePlatformNativeDialog(DialogType dialogType) const
{ {
if (dialogType == QPlatformTheme::FileDialog) if (dialogType == QPlatformTheme::FileDialog)
return true; return true;
#ifndef QT_NO_COLORDIALOG #if QT_CONFIG(colordialog)
if (dialogType == QPlatformTheme::ColorDialog) if (dialogType == QPlatformTheme::ColorDialog)
return true; return true;
#endif #endif
@ -148,7 +148,7 @@ QPlatformDialogHelper * QCocoaTheme::createPlatformDialogHelper(DialogType dialo
case QPlatformTheme::FileDialog: case QPlatformTheme::FileDialog:
return new QCocoaFileDialogHelper(); return new QCocoaFileDialogHelper();
#endif #endif
#ifndef QT_NO_COLORDIALOG #if QT_CONFIG(colordialog)
case QPlatformTheme::ColorDialog: case QPlatformTheme::ColorDialog:
return new QCocoaColorDialogHelper(); return new QCocoaColorDialogHelper();
#endif #endif

View File

@ -1,7 +1,6 @@
# Qt dialogs module # Qt dialogs module
HEADERS += \ HEADERS += \
dialogs/qcolordialog.h \
dialogs/qfscompleter_p.h \ dialogs/qfscompleter_p.h \
dialogs/qerrormessage.h \ dialogs/qerrormessage.h \
dialogs/qfontdialog.h \ dialogs/qfontdialog.h \
@ -18,13 +17,17 @@ win32 {
INCLUDEPATH += $$PWD INCLUDEPATH += $$PWD
SOURCES += \ SOURCES += \
dialogs/qcolordialog.cpp \
dialogs/qerrormessage.cpp \ dialogs/qerrormessage.cpp \
dialogs/qfontdialog.cpp \ dialogs/qfontdialog.cpp \
dialogs/qfilesystemmodel.cpp \ dialogs/qfilesystemmodel.cpp \
dialogs/qfileinfogatherer.cpp \ dialogs/qfileinfogatherer.cpp \
dialogs/qwizard.cpp \ dialogs/qwizard.cpp \
qtConfig(colordialog) {
HEADERS += dialogs/qcolordialog.h
SOURCES += dialogs/qcolordialog.cpp
}
qtConfig(dialog) { qtConfig(dialog) {
HEADERS += \ HEADERS += \
dialogs/qdialog.h \ dialogs/qdialog.h \

View File

@ -39,8 +39,6 @@
#include "qcolordialog.h" #include "qcolordialog.h"
#ifndef QT_NO_COLORDIALOG
#include "qapplication.h" #include "qapplication.h"
#include "qdesktopwidget.h" #include "qdesktopwidget.h"
#include "qdrawutil.h" #include "qdrawutil.h"
@ -2289,6 +2287,3 @@ QT_END_NAMESPACE
#include "qcolordialog.moc" #include "qcolordialog.moc"
#include "moc_qcolordialog.cpp" #include "moc_qcolordialog.cpp"
#endif // QT_NO_COLORDIALOG

View File

@ -42,12 +42,11 @@
#include <QtWidgets/qtwidgetsglobal.h> #include <QtWidgets/qtwidgetsglobal.h>
#ifndef QT_NO_COLORDIALOG
#include <QtWidgets/qdialog.h> #include <QtWidgets/qdialog.h>
QT_BEGIN_NAMESPACE QT_REQUIRE_CONFIG(colordialog);
QT_BEGIN_NAMESPACE
class QColorDialogPrivate; class QColorDialogPrivate;
@ -127,6 +126,4 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QColorDialog::ColorDialogOptions)
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QT_NO_COLORDIALOG
#endif // QCOLORDIALOG_H #endif // QCOLORDIALOG_H

View File

@ -37,7 +37,10 @@
** **
****************************************************************************/ ****************************************************************************/
#include <QtWidgets/qtwidgetsglobal.h>
#if QT_CONFIG(colordialog)
#include "qcolordialog.h" #include "qcolordialog.h"
#endif
#include "qfontdialog.h" #include "qfontdialog.h"
#if QT_CONFIG(filedialog) #if QT_CONFIG(filedialog)
#include "qfiledialog.h" #include "qfiledialog.h"
@ -72,7 +75,7 @@ static inline int themeDialogType(const QDialog *dialog)
if (qobject_cast<const QFileDialog *>(dialog)) if (qobject_cast<const QFileDialog *>(dialog))
return QPlatformTheme::FileDialog; return QPlatformTheme::FileDialog;
#endif #endif
#ifndef QT_NO_COLORDIALOG #if QT_CONFIG(colordialog)
if (qobject_cast<const QColorDialog *>(dialog)) if (qobject_cast<const QColorDialog *>(dialog))
return QPlatformTheme::ColorDialog; return QPlatformTheme::ColorDialog;
#endif #endif