Convert features.fontdialog to QT_[REQUIRE_]CONFIG

Change-Id: Iebc091ffd023595278fa177b7f205b6e0cd7ec52
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
Stephan Binner 2017-07-09 10:29:12 +02:00
parent 93dc459f48
commit 3906043f05
9 changed files with 27 additions and 28 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 \
qcocoafontdialoghelper.mm \
qcocoacursor.mm \ qcocoacursor.mm \
qcocoaclipboard.mm \ qcocoaclipboard.mm \
qcocoadrag.mm \ qcocoadrag.mm \
@ -53,7 +52,6 @@ HEADERS += qcocoaintegration.h \
qmultitouch_mac_p.h \ qmultitouch_mac_p.h \
qcocoaaccessibilityelement.h \ qcocoaaccessibilityelement.h \
qcocoaaccessibility.h \ qcocoaaccessibility.h \
qcocoafontdialoghelper.h \
qcocoacursor.h \ qcocoacursor.h \
qcocoaclipboard.h \ qcocoaclipboard.h \
qcocoadrag.h \ qcocoadrag.h \
@ -109,6 +107,11 @@ qtHaveModule(widgets) {
HEADERS += qcocoafiledialoghelper.h HEADERS += qcocoafiledialoghelper.h
} }
qtConfig(fontdialog) {
SOURCES += qcocoafontdialoghelper.mm
HEADERS += qcocoafontdialoghelper.h
}
QT += widgets-private printsupport-private QT += widgets-private printsupport-private
} }

View File

@ -41,8 +41,11 @@
#define QCOCOAFONTDIALOGHELPER_H #define QCOCOAFONTDIALOGHELPER_H
#include <QObject> #include <QObject>
#include <QtWidgets/qtwidgetsglobal.h>
#include <qpa/qplatformdialoghelper.h> #include <qpa/qplatformdialoghelper.h>
QT_REQUIRE_CONFIG(fontdialog);
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QCocoaFontDialogHelper : public QPlatformFontDialogHelper class QCocoaFontDialogHelper : public QPlatformFontDialogHelper

View File

@ -37,8 +37,6 @@
** **
****************************************************************************/ ****************************************************************************/
#ifndef QT_NO_FONTDIALOG
#include <QtCore/qtimer.h> #include <QtCore/qtimer.h>
#include <QtGui/qfontdatabase.h> #include <QtGui/qfontdatabase.h>
#include <qpa/qplatformtheme.h> #include <qpa/qplatformtheme.h>
@ -402,5 +400,3 @@ QFont QCocoaFontDialogHelper::currentFont() const
} }
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QT_NO_FONTDIALOG

View File

@ -44,7 +44,6 @@
#include <QtCore/QVariant> #include <QtCore/QVariant>
#include "qcocoafontdialoghelper.h"
#include "qcocoasystemsettings.h" #include "qcocoasystemsettings.h"
#include "qcocoasystemtrayicon.h" #include "qcocoasystemtrayicon.h"
#include "qcocoamenuitem.h" #include "qcocoamenuitem.h"
@ -69,6 +68,9 @@
#if QT_CONFIG(filedialog) #if QT_CONFIG(filedialog)
#include "qcocoafiledialoghelper.h" #include "qcocoafiledialoghelper.h"
#endif #endif
#if QT_CONFIG(fontdialog)
#include "qcocoafontdialoghelper.h"
#endif
#endif #endif
#include <Carbon/Carbon.h> #include <Carbon/Carbon.h>
@ -136,7 +138,7 @@ bool QCocoaTheme::usePlatformNativeDialog(DialogType dialogType) const
if (dialogType == QPlatformTheme::ColorDialog) if (dialogType == QPlatformTheme::ColorDialog)
return true; return true;
#endif #endif
#ifndef QT_NO_FONTDIALOG #if defined(QT_WIDGETS_LIB) && QT_CONFIG(fontdialog)
if (dialogType == QPlatformTheme::FontDialog) if (dialogType == QPlatformTheme::FontDialog)
return true; return true;
#endif #endif
@ -154,7 +156,7 @@ QPlatformDialogHelper * QCocoaTheme::createPlatformDialogHelper(DialogType dialo
case QPlatformTheme::ColorDialog: case QPlatformTheme::ColorDialog:
return new QCocoaColorDialogHelper(); return new QCocoaColorDialogHelper();
#endif #endif
#ifndef QT_NO_FONTDIALOG #if defined(QT_WIDGETS_LIB) && QT_CONFIG(fontdialog)
case QPlatformTheme::FontDialog: case QPlatformTheme::FontDialog:
return new QCocoaFontDialogHelper(); return new QCocoaFontDialogHelper();
#endif #endif

View File

@ -1,12 +1,6 @@
# Qt dialogs module # Qt dialogs module
HEADERS += \
dialogs/qfontdialog.h \
dialogs/qfontdialog_p.h
INCLUDEPATH += $$PWD INCLUDEPATH += $$PWD
SOURCES += \
dialogs/qfontdialog.cpp
qtConfig(colordialog) { qtConfig(colordialog) {
HEADERS += dialogs/qcolordialog.h HEADERS += dialogs/qcolordialog.h
@ -51,6 +45,14 @@ qtConfig(filesystemmodel) {
dialogs/qfileinfogatherer.cpp dialogs/qfileinfogatherer.cpp
} }
qtConfig(fontdialog) {
HEADERS += \
dialogs/qfontdialog.h \
dialogs/qfontdialog_p.h
SOURCES += dialogs/qfontdialog.cpp
}
qtConfig(fscompleter) { qtConfig(fscompleter) {
HEADERS += dialogs/qfscompleter_p.h HEADERS += dialogs/qfscompleter_p.h
} }

View File

@ -41,7 +41,9 @@
#if QT_CONFIG(colordialog) #if QT_CONFIG(colordialog)
#include "qcolordialog.h" #include "qcolordialog.h"
#endif #endif
#if QT_CONFIG(fontdialog)
#include "qfontdialog.h" #include "qfontdialog.h"
#endif
#if QT_CONFIG(filedialog) #if QT_CONFIG(filedialog)
#include "qfiledialog.h" #include "qfiledialog.h"
#endif #endif
@ -81,7 +83,7 @@ static inline int themeDialogType(const QDialog *dialog)
if (qobject_cast<const QColorDialog *>(dialog)) if (qobject_cast<const QColorDialog *>(dialog))
return QPlatformTheme::ColorDialog; return QPlatformTheme::ColorDialog;
#endif #endif
#ifndef QT_NO_FONTDIALOG #if QT_CONFIG(fontdialog)
if (qobject_cast<const QFontDialog *>(dialog)) if (qobject_cast<const QFontDialog *>(dialog))
return QPlatformTheme::FontDialog; return QPlatformTheme::FontDialog;
#endif #endif

View File

@ -40,8 +40,6 @@
#include "qwindowdefs.h" #include "qwindowdefs.h"
#include "qfontdialog.h" #include "qfontdialog.h"
#if QT_CONFIG(fontdialog)
#include "qfontdialog_p.h" #include "qfontdialog_p.h"
#include <qapplication.h> #include <qapplication.h>
@ -1049,5 +1047,3 @@ QT_END_NAMESPACE
#include "qfontdialog.moc" #include "qfontdialog.moc"
#include "moc_qfontdialog.cpp" #include "moc_qfontdialog.cpp"
#endif // QT_CONFIG(fontdialog)

View File

@ -44,12 +44,11 @@
#include <QtGui/qwindowdefs.h> #include <QtGui/qwindowdefs.h>
#include <QtGui/qfont.h> #include <QtGui/qfont.h>
#ifndef QT_NO_FONTDIALOG
#include <QtWidgets/qdialog.h> #include <QtWidgets/qdialog.h>
QT_BEGIN_NAMESPACE QT_REQUIRE_CONFIG(fontdialog);
QT_BEGIN_NAMESPACE
class QFontDialogPrivate; class QFontDialogPrivate;
@ -120,6 +119,4 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QFontDialog::FontDialogOptions)
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QT_NO_FONTDIALOG
#endif // QFONTDIALOG_H #endif // QFONTDIALOG_H

View File

@ -59,7 +59,7 @@
#include <qpa/qplatformdialoghelper.h> #include <qpa/qplatformdialoghelper.h>
#include "qsharedpointer.h" #include "qsharedpointer.h"
#ifndef QT_NO_FONTDIALOG QT_REQUIRE_CONFIG(fontdialog);
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
@ -149,8 +149,6 @@ private:
virtual void helperPrepareShow(QPlatformDialogHelper *) Q_DECL_OVERRIDE; virtual void helperPrepareShow(QPlatformDialogHelper *) Q_DECL_OVERRIDE;
}; };
#endif // QT_NO_FONTDIALOG
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QFONTDIALOG_P_H #endif // QFONTDIALOG_P_H