diff options
Diffstat (limited to 'src/imports')
-rw-r--r-- | src/imports/nativestyle/qstyle/mac/qquickmacstyle_mac.mm | 22 | ||||
-rw-r--r-- | src/imports/nativestyle/qstyle/mac/qquickmacstyle_mac_p.h | 6 |
2 files changed, 24 insertions, 4 deletions
diff --git a/src/imports/nativestyle/qstyle/mac/qquickmacstyle_mac.mm b/src/imports/nativestyle/qstyle/mac/qquickmacstyle_mac.mm index 257bde31..47fac5b3 100644 --- a/src/imports/nativestyle/qstyle/mac/qquickmacstyle_mac.mm +++ b/src/imports/nativestyle/qstyle/mac/qquickmacstyle_mac.mm @@ -67,6 +67,24 @@ QT_USE_NAMESPACE +// OBS! Changing QT_MANGLE_NAMESPACE and QT_NAMESPACE_ALIAS_OBJC_CLASS to take +// both QT_NAMESPACE and QQC2_NAMESPACE into account (and not only QT_NAMESPACE, which +// would otherwise be the case). This will make it possible to link in both widgets and +// controls in the same application when building statically. +#undef QT_MANGLE_NAMESPACE +#undef QT_NAMESPACE_ALIAS_OBJC_CLASS + +#define QQC2_MANGLE1(a, b) a##_##b +#define QQC2_MANGLE2(a, b) QQC2_MANGLE1(a, b) + +#if defined(QT_NAMESPACE) + #define QT_MANGLE_NAMESPACE(name) QQC2_MANGLE2(QQC2_MANGLE1(name, QQC2_NAMESPACE), QT_NAMESPACE) + #define QT_NAMESPACE_ALIAS_OBJC_CLASS(name) @compatibility_alias name QT_MANGLE_NAMESPACE(name) +#else + #define QT_MANGLE_NAMESPACE(name) QQC2_MANGLE2(name, QQC2_NAMESPACE) + #define QT_NAMESPACE_ALIAS_OBJC_CLASS(name) @compatibility_alias name QT_MANGLE_NAMESPACE(name) +#endif + @interface QT_MANGLE_NAMESPACE(QIndeterminateProgressIndicator) : NSProgressIndicator @property (readonly, nonatomic) NSInteger animators; @@ -171,7 +189,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QDarkNSBox); QT_BEGIN_NAMESPACE -namespace QQC2 { +namespace QQC2_NAMESPACE { // The following constants are used for adjusting the size // of push buttons so that they are drawn inside their bounds. @@ -6046,6 +6064,6 @@ QIcon QMacStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption *o } } -} // namespace QQC2 +} // QQC2_NAMESPACE QT_END_NAMESPACE diff --git a/src/imports/nativestyle/qstyle/mac/qquickmacstyle_mac_p.h b/src/imports/nativestyle/qstyle/mac/qquickmacstyle_mac_p.h index 2604cfc6..b9e1c5f3 100644 --- a/src/imports/nativestyle/qstyle/mac/qquickmacstyle_mac_p.h +++ b/src/imports/nativestyle/qstyle/mac/qquickmacstyle_mac_p.h @@ -50,11 +50,13 @@ #include "qquickcommonstyle.h" +#define QQC2_NAMESPACE QQC2 + QT_BEGIN_NAMESPACE class QPalette; -namespace QQC2 { +namespace QQC2_NAMESPACE { class QStyleOptionButton; class QMacStylePrivate; @@ -95,7 +97,7 @@ private: Q_DECLARE_PRIVATE(QMacStyle) }; -} // namespace QQC2 +} // QQC2_NAMESPACE QT_END_NAMESPACE |