summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-01-07 01:00:08 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-01-07 01:00:08 +0100
commitc497f79ad460afeb76eb1ade0de86d46bbb11a91 (patch)
tree10ebe88ea0c3566c2bd33968bbd4401122c9b689 /src/corelib/kernel
parent8cf812231405e011b422a1505d9a219618fe5cee (diff)
parentecdccce8e468784e050b65052da193bb40e2d9b9 (diff)
Merge remote-tracking branch 'origin/5.12' into dev
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qcore_mac_objc.mm7
-rw-r--r--src/corelib/kernel/qmetatype.cpp6
2 files changed, 11 insertions, 2 deletions
diff --git a/src/corelib/kernel/qcore_mac_objc.mm b/src/corelib/kernel/qcore_mac_objc.mm
index 7b78ef11be..bc23e821fd 100644
--- a/src/corelib/kernel/qcore_mac_objc.mm
+++ b/src/corelib/kernel/qcore_mac_objc.mm
@@ -170,8 +170,11 @@ QDebug operator<<(QDebug debug, const QMacAutoReleasePool *pool)
bool qt_mac_applicationIsInDarkMode()
{
#if QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_14)
- if (__builtin_available(macOS 10.14, *))
- return [NSApp.effectiveAppearance.name hasSuffix:@"DarkAqua"];
+ if (__builtin_available(macOS 10.14, *)) {
+ auto appearance = [NSApp.effectiveAppearance bestMatchFromAppearancesWithNames:
+ @[ NSAppearanceNameAqua, NSAppearanceNameDarkAqua ]];
+ return [appearance isEqualToString:NSAppearanceNameDarkAqua];
+ }
#endif
return false;
}
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index 1ba5f3979c..b9e35e28e4 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -2323,6 +2323,8 @@ void *QMetaType::createExtended(const void *copy) const
*/
void QMetaType::destroyExtended(void *data) const
{
+ if (m_typeId == QMetaType::UnknownType)
+ return;
if (Q_UNLIKELY(m_typedDestructor && !m_destructor))
m_typedDestructor(m_typeId, data);
else
@@ -2339,6 +2341,8 @@ void QMetaType::destroyExtended(void *data) const
*/
void *QMetaType::constructExtended(void *where, const void *copy) const
{
+ if (m_typeId == QMetaType::UnknownType)
+ return nullptr;
if (m_typedConstructor && !m_constructor)
return m_typedConstructor(m_typeId, where, copy);
return nullptr;
@@ -2353,6 +2357,8 @@ void *QMetaType::constructExtended(void *where, const void *copy) const
*/
void QMetaType::destructExtended(void *data) const
{
+ if (m_typeId == QMetaType::UnknownType)
+ return;
if (m_typedDestructor && !m_destructor)
m_typedDestructor(m_typeId, data);
}