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 \
qcocoaaccessibilityelement.mm \
qcocoaaccessibility.mm \
qcocoacolordialoghelper.mm \
qcocoafontdialoghelper.mm \
qcocoacursor.mm \
qcocoaclipboard.mm \
@ -54,7 +53,6 @@ HEADERS += qcocoaintegration.h \
qmultitouch_mac_p.h \
qcocoaaccessibilityelement.h \
qcocoaaccessibility.h \
qcocoacolordialoghelper.h \
qcocoafontdialoghelper.h \
qcocoacursor.h \
qcocoaclipboard.h \
@ -101,6 +99,11 @@ qtHaveModule(widgets) {
qcocoaprintersupport.h \
qcocoaprintdevice.h \
qtConfig(colordialog) {
SOURCES += qcocoacolordialoghelper.mm
HEADERS += qcocoacolordialoghelper.h
}
qtConfig(filedialog) {
SOURCES += qcocoafiledialoghelper.mm
HEADERS += qcocoafiledialoghelper.h

View File

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

View File

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

View File

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

View File

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

View File

@ -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

View File

@ -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

View File

@ -37,7 +37,10 @@
**
****************************************************************************/
#include <QtWidgets/qtwidgetsglobal.h>
#if QT_CONFIG(colordialog)
#include "qcolordialog.h"
#endif
#include "qfontdialog.h"
#if QT_CONFIG(filedialog)
#include "qfiledialog.h"
@ -72,7 +75,7 @@ static inline int themeDialogType(const QDialog *dialog)
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