summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/cocoa/cocoa.pro7
-rw-r--r--src/plugins/platforms/cocoa/qcocoacolordialoghelper.h4
-rw-r--r--src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm4
-rw-r--r--src/plugins/platforms/cocoa/qcocoatheme.mm4
-rw-r--r--src/widgets/dialogs/dialogs.pri7
-rw-r--r--src/widgets/dialogs/qcolordialog.cpp5
-rw-r--r--src/widgets/dialogs/qcolordialog.h7
-rw-r--r--src/widgets/dialogs/qdialog.cpp5
8 files changed, 22 insertions, 21 deletions
diff --git a/src/plugins/platforms/cocoa/cocoa.pro b/src/plugins/platforms/cocoa/cocoa.pro
index 0f478a79f3..23a049bebc 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 \
- 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
diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.h b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.h
index 55017668d1..133efd6db8 100644
--- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.h
+++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.h
@@ -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
diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
index a8974c4de5..5d331c0e96 100644
--- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
@@ -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
diff --git a/src/plugins/platforms/cocoa/qcocoatheme.mm b/src/plugins/platforms/cocoa/qcocoatheme.mm
index 53ccf68c0c..faa3df39a0 100644
--- a/src/plugins/platforms/cocoa/qcocoatheme.mm
+++ b/src/plugins/platforms/cocoa/qcocoatheme.mm
@@ -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
diff --git a/src/widgets/dialogs/dialogs.pri b/src/widgets/dialogs/dialogs.pri
index 1ea5403b79..0ebb912ffc 100644
--- a/src/widgets/dialogs/dialogs.pri
+++ b/src/widgets/dialogs/dialogs.pri
@@ -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 \
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 e1a38438d1..851f195633 100644
--- a/src/widgets/dialogs/qdialog.cpp
+++ b/src/widgets/dialogs/qdialog.cpp
@@ -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