From 3906043f05d2ffccede47f845561cca95548ac5a Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Sun, 9 Jul 2017 10:29:12 +0200 Subject: [PATCH] Convert features.fontdialog to QT_[REQUIRE_]CONFIG Change-Id: Iebc091ffd023595278fa177b7f205b6e0cd7ec52 Reviewed-by: Oswald Buddenhagen --- src/plugins/platforms/cocoa/cocoa.pro | 7 +++++-- .../platforms/cocoa/qcocoafontdialoghelper.h | 3 +++ .../platforms/cocoa/qcocoafontdialoghelper.mm | 4 ---- src/plugins/platforms/cocoa/qcocoatheme.mm | 8 +++++--- src/widgets/dialogs/dialogs.pri | 14 ++++++++------ src/widgets/dialogs/qdialog.cpp | 4 +++- src/widgets/dialogs/qfontdialog.cpp | 4 ---- src/widgets/dialogs/qfontdialog.h | 7 ++----- src/widgets/dialogs/qfontdialog_p.h | 4 +--- 9 files changed, 27 insertions(+), 28 deletions(-) diff --git a/src/plugins/platforms/cocoa/cocoa.pro b/src/plugins/platforms/cocoa/cocoa.pro index 23a049bebc..13e59906ca 100644 --- a/src/plugins/platforms/cocoa/cocoa.pro +++ b/src/plugins/platforms/cocoa/cocoa.pro @@ -20,7 +20,6 @@ OBJECTIVE_SOURCES += main.mm \ qmultitouch_mac.mm \ qcocoaaccessibilityelement.mm \ qcocoaaccessibility.mm \ - qcocoafontdialoghelper.mm \ qcocoacursor.mm \ qcocoaclipboard.mm \ qcocoadrag.mm \ @@ -53,7 +52,6 @@ HEADERS += qcocoaintegration.h \ qmultitouch_mac_p.h \ qcocoaaccessibilityelement.h \ qcocoaaccessibility.h \ - qcocoafontdialoghelper.h \ qcocoacursor.h \ qcocoaclipboard.h \ qcocoadrag.h \ @@ -109,6 +107,11 @@ qtHaveModule(widgets) { HEADERS += qcocoafiledialoghelper.h } + qtConfig(fontdialog) { + SOURCES += qcocoafontdialoghelper.mm + HEADERS += qcocoafontdialoghelper.h + } + QT += widgets-private printsupport-private } diff --git a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.h b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.h index 8b05cb7933..c3fad7cfd6 100644 --- a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.h +++ b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.h @@ -41,8 +41,11 @@ #define QCOCOAFONTDIALOGHELPER_H #include +#include #include +QT_REQUIRE_CONFIG(fontdialog); + QT_BEGIN_NAMESPACE class QCocoaFontDialogHelper : public QPlatformFontDialogHelper diff --git a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm index e4b796dcde..dbd7e90dba 100644 --- a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm @@ -37,8 +37,6 @@ ** ****************************************************************************/ -#ifndef QT_NO_FONTDIALOG - #include #include #include @@ -402,5 +400,3 @@ QFont QCocoaFontDialogHelper::currentFont() const } QT_END_NAMESPACE - -#endif // QT_NO_FONTDIALOG diff --git a/src/plugins/platforms/cocoa/qcocoatheme.mm b/src/plugins/platforms/cocoa/qcocoatheme.mm index 08f41cddc2..2f4a1e3e4c 100644 --- a/src/plugins/platforms/cocoa/qcocoatheme.mm +++ b/src/plugins/platforms/cocoa/qcocoatheme.mm @@ -44,7 +44,6 @@ #include -#include "qcocoafontdialoghelper.h" #include "qcocoasystemsettings.h" #include "qcocoasystemtrayicon.h" #include "qcocoamenuitem.h" @@ -69,6 +68,9 @@ #if QT_CONFIG(filedialog) #include "qcocoafiledialoghelper.h" #endif +#if QT_CONFIG(fontdialog) +#include "qcocoafontdialoghelper.h" +#endif #endif #include @@ -136,7 +138,7 @@ bool QCocoaTheme::usePlatformNativeDialog(DialogType dialogType) const if (dialogType == QPlatformTheme::ColorDialog) return true; #endif -#ifndef QT_NO_FONTDIALOG +#if defined(QT_WIDGETS_LIB) && QT_CONFIG(fontdialog) if (dialogType == QPlatformTheme::FontDialog) return true; #endif @@ -154,7 +156,7 @@ QPlatformDialogHelper * QCocoaTheme::createPlatformDialogHelper(DialogType dialo case QPlatformTheme::ColorDialog: return new QCocoaColorDialogHelper(); #endif -#ifndef QT_NO_FONTDIALOG +#if defined(QT_WIDGETS_LIB) && QT_CONFIG(fontdialog) case QPlatformTheme::FontDialog: return new QCocoaFontDialogHelper(); #endif diff --git a/src/widgets/dialogs/dialogs.pri b/src/widgets/dialogs/dialogs.pri index c2625ec1f4..a6a6b2d352 100644 --- a/src/widgets/dialogs/dialogs.pri +++ b/src/widgets/dialogs/dialogs.pri @@ -1,12 +1,6 @@ # Qt dialogs module -HEADERS += \ - dialogs/qfontdialog.h \ - dialogs/qfontdialog_p.h - INCLUDEPATH += $$PWD -SOURCES += \ - dialogs/qfontdialog.cpp qtConfig(colordialog) { HEADERS += dialogs/qcolordialog.h @@ -51,6 +45,14 @@ qtConfig(filesystemmodel) { dialogs/qfileinfogatherer.cpp } +qtConfig(fontdialog) { + HEADERS += \ + dialogs/qfontdialog.h \ + dialogs/qfontdialog_p.h + + SOURCES += dialogs/qfontdialog.cpp +} + qtConfig(fscompleter) { HEADERS += dialogs/qfscompleter_p.h } diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp index 7cb24d65fc..1cd587b78d 100644 --- a/src/widgets/dialogs/qdialog.cpp +++ b/src/widgets/dialogs/qdialog.cpp @@ -41,7 +41,9 @@ #if QT_CONFIG(colordialog) #include "qcolordialog.h" #endif +#if QT_CONFIG(fontdialog) #include "qfontdialog.h" +#endif #if QT_CONFIG(filedialog) #include "qfiledialog.h" #endif @@ -81,7 +83,7 @@ static inline int themeDialogType(const QDialog *dialog) if (qobject_cast(dialog)) return QPlatformTheme::ColorDialog; #endif -#ifndef QT_NO_FONTDIALOG +#if QT_CONFIG(fontdialog) if (qobject_cast(dialog)) return QPlatformTheme::FontDialog; #endif diff --git a/src/widgets/dialogs/qfontdialog.cpp b/src/widgets/dialogs/qfontdialog.cpp index b20a1449eb..587e31d8c5 100644 --- a/src/widgets/dialogs/qfontdialog.cpp +++ b/src/widgets/dialogs/qfontdialog.cpp @@ -40,8 +40,6 @@ #include "qwindowdefs.h" #include "qfontdialog.h" -#if QT_CONFIG(fontdialog) - #include "qfontdialog_p.h" #include @@ -1049,5 +1047,3 @@ QT_END_NAMESPACE #include "qfontdialog.moc" #include "moc_qfontdialog.cpp" - -#endif // QT_CONFIG(fontdialog) diff --git a/src/widgets/dialogs/qfontdialog.h b/src/widgets/dialogs/qfontdialog.h index da13a5ab99..3fb3997b85 100644 --- a/src/widgets/dialogs/qfontdialog.h +++ b/src/widgets/dialogs/qfontdialog.h @@ -44,12 +44,11 @@ #include #include -#ifndef QT_NO_FONTDIALOG - #include -QT_BEGIN_NAMESPACE +QT_REQUIRE_CONFIG(fontdialog); +QT_BEGIN_NAMESPACE class QFontDialogPrivate; @@ -120,6 +119,4 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QFontDialog::FontDialogOptions) QT_END_NAMESPACE -#endif // QT_NO_FONTDIALOG - #endif // QFONTDIALOG_H diff --git a/src/widgets/dialogs/qfontdialog_p.h b/src/widgets/dialogs/qfontdialog_p.h index 033f5a2be8..ae923d94ed 100644 --- a/src/widgets/dialogs/qfontdialog_p.h +++ b/src/widgets/dialogs/qfontdialog_p.h @@ -59,7 +59,7 @@ #include #include "qsharedpointer.h" -#ifndef QT_NO_FONTDIALOG +QT_REQUIRE_CONFIG(fontdialog); QT_BEGIN_NAMESPACE @@ -149,8 +149,6 @@ private: virtual void helperPrepareShow(QPlatformDialogHelper *) Q_DECL_OVERRIDE; }; -#endif // QT_NO_FONTDIALOG - QT_END_NAMESPACE #endif // QFONTDIALOG_P_H