diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2020-03-31 19:23:18 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2020-06-04 10:39:53 +0200 |
commit | 1cee9cc5870b475b141dfa6ad84de2038a28d5b8 (patch) | |
tree | 999dfe9b3cb2743271d5475a808cd1c59fd095c1 /src/plugins | |
parent | 9dd8e655cdd26eeaae30645b7fe013d9a696547f (diff) |
macOS: Remove QtWidget dependency from platform plugin
The dialog helpers don't depend on widgets themselves, and should be
built regardless of whether the widget dialogs are enabled, as these
helpers can (and should) be used by other layers, such as Qt Quick.
Change-Id: I1c66b474ab2f29748f1256aea90229c51c12a16f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/cocoa/CMakeLists.txt | 19 | ||||
-rw-r--r-- | src/plugins/platforms/cocoa/cocoa.pro | 31 | ||||
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoacolordialoghelper.h | 4 | ||||
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoafiledialoghelper.h | 3 | ||||
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoafontdialoghelper.h | 3 | ||||
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoahelpers.mm | 4 | ||||
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoaintegration.mm | 7 | ||||
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoatheme.mm | 19 |
8 files changed, 11 insertions, 79 deletions
diff --git a/src/plugins/platforms/cocoa/CMakeLists.txt b/src/plugins/platforms/cocoa/CMakeLists.txt index 11f3f99d8d..7a61231509 100644 --- a/src/plugins/platforms/cocoa/CMakeLists.txt +++ b/src/plugins/platforms/cocoa/CMakeLists.txt @@ -43,6 +43,9 @@ qt_internal_add_plugin(QCocoaIntegrationPlugin qnsview.h qnsview.mm qnswindow.h qnswindow.mm qnswindowdelegate.h qnswindowdelegate.mm + qcocoacolordialoghelper.h qcocoacolordialoghelper.mm + qcocoafiledialoghelper.h qcocoafiledialoghelper.mm + qcocoafontdialoghelper.h qcocoafontdialoghelper.mm DEFINES QT_NO_FOREACH PUBLIC_LIBRARIES @@ -110,21 +113,5 @@ qt_extend_target(QCocoaIntegrationPlugin CONDITION QT_FEATURE_sessionmanager #### Keys ignored in scope 7:.:.:cocoa.pro:TARGET Qt::Widgets: # QT_FOR_CONFIG = "widgets" - -qt_extend_target(QCocoaIntegrationPlugin CONDITION QT_FEATURE_colordialog AND TARGET Qt::Widgets - SOURCES - qcocoacolordialoghelper.h qcocoacolordialoghelper.mm -) - -qt_extend_target(QCocoaIntegrationPlugin CONDITION QT_FEATURE_filedialog AND TARGET Qt::Widgets - SOURCES - qcocoafiledialoghelper.h qcocoafiledialoghelper.mm -) - -qt_extend_target(QCocoaIntegrationPlugin CONDITION QT_FEATURE_fontdialog AND TARGET Qt::Widgets - SOURCES - qcocoafontdialoghelper.h qcocoafontdialoghelper.mm -) - #### Keys ignored in scope 12:.:.:cocoa.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: # PLUGIN_EXTENDS = "-" diff --git a/src/plugins/platforms/cocoa/cocoa.pro b/src/plugins/platforms/cocoa/cocoa.pro index a33b99e898..742038d5cd 100644 --- a/src/plugins/platforms/cocoa/cocoa.pro +++ b/src/plugins/platforms/cocoa/cocoa.pro @@ -31,7 +31,10 @@ SOURCES += main.mm \ qcocoaintrospection.mm \ qcocoakeymapper.mm \ qcocoamimetypes.mm \ - qiosurfacegraphicsbuffer.mm + qiosurfacegraphicsbuffer.mm \ + qcocoacolordialoghelper.mm \ + qcocoafiledialoghelper.mm \ + qcocoafontdialoghelper.mm HEADERS += qcocoaintegration.h \ qcocoascreen.h \ @@ -63,7 +66,10 @@ HEADERS += qcocoaintegration.h \ qcocoaintrospection.h \ qcocoakeymapper.h \ qiosurfacegraphicsbuffer.h \ - qcocoamimetypes.h + qcocoamimetypes.h \ + qcocoacolordialoghelper.h \ + qcocoafiledialoghelper.h \ + qcocoafontdialoghelper.h qtConfig(opengl.*) { SOURCES += qcocoaglcontext.mm @@ -97,27 +103,6 @@ QT += core-private gui-private CONFIG += no_app_extension_api_only -qtHaveModule(widgets) { - QT_FOR_CONFIG += widgets - - qtConfig(colordialog) { - SOURCES += qcocoacolordialoghelper.mm - HEADERS += qcocoacolordialoghelper.h - } - - qtConfig(filedialog) { - SOURCES += qcocoafiledialoghelper.mm - HEADERS += qcocoafiledialoghelper.h - } - - qtConfig(fontdialog) { - SOURCES += qcocoafontdialoghelper.mm - HEADERS += qcocoafontdialoghelper.h - } - - QT += widgets-private -} - OTHER_FILES += cocoa.json PLUGIN_TYPE = platforms diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.h b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.h index 01ac7e181d..c3e4e8da04 100644 --- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.h +++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.h @@ -40,13 +40,9 @@ #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/qcocoafiledialoghelper.h b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h index dd0afbefe6..add02d342b 100644 --- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h +++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h @@ -41,14 +41,11 @@ #define QCOCOAFILEDIALOGHELPER_H #include <QObject> -#include <QtWidgets/qtwidgetsglobal.h> #include <qpa/qplatformdialoghelper.h> #include <QtCore/private/qcore_mac_p.h> #import <AppKit/NSSavePanel.h> -QT_REQUIRE_CONFIG(filedialog); - @interface QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) : NSObject<NSOpenSavePanelDelegate> @end diff --git a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.h b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.h index 14f12f2d76..81ba3d6c41 100644 --- a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.h +++ b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.h @@ -41,11 +41,8 @@ #define QCOCOAFONTDIALOGHELPER_H #include <QObject> -#include <QtWidgets/qtwidgetsglobal.h> #include <qpa/qplatformdialoghelper.h> -QT_REQUIRE_CONFIG(fontdialog); - QT_BEGIN_NAMESPACE class QCocoaFontDialogHelper : public QPlatformFontDialogHelper diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.mm b/src/plugins/platforms/cocoa/qcocoahelpers.mm index dab67268e3..f8c1242259 100644 --- a/src/plugins/platforms/cocoa/qcocoahelpers.mm +++ b/src/plugins/platforms/cocoa/qcocoahelpers.mm @@ -49,10 +49,6 @@ #include <private/qwindow_p.h> #include <QtGui/private/qcoregraphics_p.h> -#ifndef QT_NO_WIDGETS -#include <QtWidgets/QWidget> -#endif - #include <algorithm> #include <mach-o/dyld.h> diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm index 13a4b0301b..712d933c04 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.mm +++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm @@ -68,13 +68,6 @@ #include <QtGui/private/qfontengine_coretext_p.h> -#ifdef QT_WIDGETS_LIB -#include <QtWidgets/qtwidgetsglobal.h> -#if QT_CONFIG(filedialog) -#include "qcocoafiledialoghelper.h" -#endif -#endif - #include <IOKit/graphics/IOGraphicsLib.h> static void initResources() diff --git a/src/plugins/platforms/cocoa/qcocoatheme.mm b/src/plugins/platforms/cocoa/qcocoatheme.mm index 1b82b35795..838a7cbbf1 100644 --- a/src/plugins/platforms/cocoa/qcocoatheme.mm +++ b/src/plugins/platforms/cocoa/qcocoatheme.mm @@ -63,18 +63,9 @@ #include <qpa/qplatformintegration.h> #include <qpa/qplatformnativeinterface.h> -#ifdef QT_WIDGETS_LIB -#include <QtWidgets/qtwidgetsglobal.h> -#if QT_CONFIG(colordialog) #include "qcocoacolordialoghelper.h" -#endif -#if QT_CONFIG(filedialog) #include "qcocoafiledialoghelper.h" -#endif -#if QT_CONFIG(fontdialog) #include "qcocoafontdialoghelper.h" -#endif -#endif #include <CoreServices/CoreServices.h> @@ -329,32 +320,22 @@ bool QCocoaTheme::usePlatformNativeDialog(DialogType dialogType) const { if (dialogType == QPlatformTheme::FileDialog) return true; -#if defined(QT_WIDGETS_LIB) && QT_CONFIG(colordialog) if (dialogType == QPlatformTheme::ColorDialog) return true; -#endif -#if defined(QT_WIDGETS_LIB) && QT_CONFIG(fontdialog) if (dialogType == QPlatformTheme::FontDialog) return true; -#endif return false; } QPlatformDialogHelper *QCocoaTheme::createPlatformDialogHelper(DialogType dialogType) const { switch (dialogType) { -#if defined(QT_WIDGETS_LIB) && QT_CONFIG(filedialog) case QPlatformTheme::FileDialog: return new QCocoaFileDialogHelper(); -#endif -#if defined(QT_WIDGETS_LIB) && QT_CONFIG(colordialog) case QPlatformTheme::ColorDialog: return new QCocoaColorDialogHelper(); -#endif -#if defined(QT_WIDGETS_LIB) && QT_CONFIG(fontdialog) case QPlatformTheme::FontDialog: return new QCocoaFontDialogHelper(); -#endif default: return nullptr; } |