summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qcore_mac_p.h
Commit message (Collapse)AuthorAgeFilesLines
* QtCore platform code: s/QPair/std::pair/Marc Mutz2023-12-131-1/+1
| | | | | | | | | Also port qMakePair() to just braced initialization and CTAD. Pick-to: 6.7 Task-number: QTBUG-115841 Change-Id: I46ee214ab47513375a6e28e3b439c7b060581235 Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
* Apple: Use namespaced category name sandbox helperTor Arne Vestbø2023-11-271-1/+1
| | | | | | | Pick-to: 6.6 6.5 Fixes: QTBUG-119338 Change-Id: I8a62b3fff0c1f3de2b6ae3332f6a1ecc7b1561e5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QLogging: simplify qDefaultMessageHandler() with a global constantThiago Macieira2023-10-241-2/+5
| | | | | | | | | | | Namely, a function pointer to the actual sink function. This doesn't remove the future ability to iterate over multiple sinks, but I removed the comment anyway because it doesn't look like we'll ever implement that. Change-Id: Ifa1111900d6945ea8e05fffd177de7fa46230259 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* iOS: Add support for foreign windowsTor Arne Vestbø2023-08-181-0/+14
| | | | | | | Task-number: QTBUG-116183 Pick-to: 6.6 Change-Id: Ia92ee2d15f2e91a326ad342237fb0a83305c019f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QCFString: unexportMarc Mutz2023-06-291-3/+3
| | | | | | | | | | | This class doesn't exist on MSVC, so the inline functions didn't become part of the ABI, so it suffices to only export the two out-of-line functions. Pick-to: 6.6 Task-number: QTBUG-104164 Change-Id: Iedf8b0b1882802db53406942d7ac2a27e7ddfa23 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QAppleRefCounted hierarchy: mark ctors [[nodiscard]]Marc Mutz2023-06-211-9/+12
| | | | | | | | | | They're RAII/smart pointer-like classes. QUIP-0019 says such classes' ctors should be marked [[nodiscard]]. Pick-to: 6.6 Task-number: QTBUG-104164 Change-Id: I830badfa56fbdfb5819866f67b84cd4fa93acbde Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QMac{,RootLevel}AutoReleasePool: mark ctors [[nodiscard]]Marc Mutz2023-06-201-2/+2
| | | | | | | | | | They're RAII classes, and QUIP-0019 says RAII class' constructors should be marked [[nodiscard]]. Pick-to: 6.6 Task-number: QTBUG-104164 Change-Id: I0080f5b6a3cea346c0860e00958a8c204849040e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QMacAutoReleasePool: unexportMarc Mutz2023-06-201-3/+3
| | | | | | | | | | | | | We should not export non-polymorphic classes wholesale. Only export the non-inline functions instead. There are no implicitly-declared special member functions in this class that could cause problems, so we don't need to delay until Qt 7. Pick-to: 6.6 Task-number: QTBUG-104164 Change-Id: I2e98782160cccb9c0f59a68e67ffd29fec42b728 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Detect when Xcode is presenting os_log as structured log messagesTor Arne Vestbø2023-06-071-1/+1
| | | | | | | | | In that case, just like when os_log mirrors to stderr by itself, we want to disable Qt's fallback stderr handler. Pick-to: 6.6 6.5 Change-Id: Ia373b19788edbce616d4f0d3d9f0b217ddc1e5c0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* macOS: Move application sandbox checking to secondary threadTor Arne Vestbø2023-03-311-1/+4
| | | | | | | | | | | | | | | | | | | | | | We use the macOS Security framework to check whether the application is sandboxed or not, in which case we might have to limit or change some of the functionality of Qt, such as which shared memory backend to use. Calls to SecStaticCodeCheckValidityWithErrors should ideally not be done on the main thread, as the function may not return immediately, and we get runtime analysis warnings about this in Xcode: This method should not be called on the main thread as it may lead to UI unresponsiveness. To improve the situation we spin up a short lived thread at library load that resolves the sandboxing state, ready to be queried when needed from Qt. Pick-to: 6.5 Change-Id: I52cdc1bf6aef05c3b93b43f67b3fb46035996b3a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Make qt_mac_ensureResponsible QT_BUILD_INTERNAL and Q_AUTOTEST_EXPORTTor Arne Vestbø2022-10-191-1/+3
| | | | | | | | | | Its primary purpose was to be used by permission auto tests, so to avoid App Store compatibility issues we disable it in non-dev builds. Task-number: QTBUG-107167 Change-Id: Iaacec807808cfe52df0cf850b287e50da1bd59e5 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Replace qExchange with std::exchangeMarc Mutz2022-10-071-3/+3
| | | | | | | | | | | | | None of these users require C++20 constexpr or C++23 noexcept, the only remaining difference between std::exchange and qExchange. This leaves a single qExchange() user, in QScopedValueRollback, that requires the constexpr version, only available from C++20, and thus remains unported. Task-number: QTBUG-99313 Change-Id: Iea46f6ed61d6bd8a5b2fd9d9ec4d70c980b443a2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qcore_mac_p.h: compile-optimize inline swap functionsMarc Mutz2022-10-071-6/+6
| | | | | | | | | | | | | | | | | Instead of using the overly-generic qSwap() monster, use - qt_ptr_swap() for swapping raw pointers - member-swap for swapping smart pointers - std::swap() for swapping scalars In QtCore, this has proven to give a nice reduction in compile time for Qt users, cf. b1b0c2970e480ef460a61f37fa430dc443390358. Pick-to: 6.4 6.3 6.2 Task-number: QTBUG-97601 Change-Id: Iad8e6c11ebcc3ff822479c36f5faff88992b1165 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Move QMacAutoReleasePool from qglobal.h to qcore_mac_p.hSona Kurazyan2022-09-011-0/+9
| | | | | | | | And include qcore_mac_p.h where needed. Task-number: QTBUG-99313 Change-Id: Idb1b005f1b5938e8cf329ae06ffaf0d249874db2 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Add private API to ensure that a process is responsible/disclaimedTor Arne Vestbø2022-05-251-0/+1
| | | | | | | | | Useful for tests that request permissions and need to ensure these are requested on behalf of the app itself, and not its parent process, regardless of how it's invoked. Change-Id: Iac493e95440a3a04df4fa466c1d700ba1233e393 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Namespace a few missing Objective-C categories and their methodsMichael Spork2022-05-031-0/+3
| | | | | | | Fixes: QTBUG-100059 Pick-to: 6.2 6.3 Change-Id: I7579c9ee027de6a133a8b5d95d8e56829e089dab Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Don't print stack trace via lldb on test failure if SIP prevents itTor Arne Vestbø2022-02-091-0/+1
| | | | | | | | | | | | | | | If the CSR_ALLOW_UNRESTRICTED_FS bit of System Integrity Protection (SIP) is enabled lldb will fail to print a valid stack trace when launched from the crashed process, and might also resulting in hanging or crashing the parent process (Terminal e.g.): https://github.com/llvm/llvm-project/issues/53254 We detect this situation and avoid printing a stack trace if so. Pick-to: 6.3 6.2 Change-Id: Iad8cab5fcdc545d810ca4d4e985aefc0988d0234 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Fix mach_port_t not being foundAlexandru Croitor2022-02-031-0/+1
| | | | | | | | | | | | | | | | Fixes errors like In file included from qtbase/include/QtCore/6.4.0/QtCore/private/qcore_mac_p.h:1: qtbase/src/corelib/kernel/qcore_mac_p.h:61:9: error: unknown type name 'mach_port_t' Amends e05300163ea865f8233e61f8f6a2b341197203e4 Pick-to: 6.2 6.3 Change-Id: I8f4c579e9b8ef187859497361c4e126a486a543c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Move QIOType wrapper for io_object_t to QtCoreTor Arne Vestbø2022-02-011-1/+18
| | | | | | | | | | Since we require C++17 now we can use auto for the retain and release template arguments, which allows us to get rid of the wrapper functions for IOObjectRetain and IOObjectRelease. Pick-to: 6.2 6.3 Change-Id: Ifc4bf0fe50dfd0eaf6bb2e143acce6df7df17bdc Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* corelib: Fix typos in source code commentsJonas Kvinge2021-10-121-1/+1
| | | | | | Pick-to: 6.2 Change-Id: Ic78afb67143112468c6f84677ac88f27a74b53aa Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* macOS: Add helper function to check whether we're running under RosettaTor Arne Vestbø2021-07-271-0/+1
| | | | | | | | As described in https://developer.apple.com/documentation/apple-silicon/about-the-rosetta-translation-environment?language=objc#Determine-Whether-Your-App-Is-Running-as-a-Translated-Binary Pick-to: 6.2 Change-Id: I16fa4be20e4a55c87c2eb760d671d27ee4de1703 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Apple: Use POSIX IPC instead of System V in sandboxed applicationsTor Arne Vestbø2021-06-161-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | System V semaphores are not supported in sandboxed applications, so when Qt is configured with App Store compliance, or the user requests POSIX IPC explicitly, we use that instead. https://developer.apple.com/library/archive/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW24 As the shared memory name limit on Apple platforms is very low, we have to skip the existing logic for naming, and instead use a truncated hash of the key. This should still be fine for avoiding any collisions in practice. An explicit check for the ENAMETOOLONG error has been added to catch any cases where they key goes beyond the allowed length. Sandboxed applications also have an extra requirement that the key must include an application group identifier. This requirement has been pushed up to the user and documented, as we don't have enough information in Qt to know which identifier to use. Both tst_QSystemSemaphore and tst_QSharedMemory work as before with both sandboxed and non-sandboxed applications, after removing some assumptions in tst_QSharedMemory about System V behavior. Fixes: QTBUG-91130 Change-Id: Iaf1edb36a5d84d69e42ec31471a48d112faa8c6a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Tweak naming of QT_OVERLOADED_MACRO variantsTor Arne Vestbø2021-05-041-4/+4
| | | | | | | | Add a _ suffix before the number of arguments, to improve readability of the argument-specific functions. Change-Id: I1dfc4f381450825dd143ece524bb10e117c09971 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Whitespace cleanup in corelib/kernelAllan Sandfeld Jensen2020-10-241-8/+15
| | | | | Change-Id: If061ef0af5ced4384e20a82afcea3712fa7e45d7 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Centralize the implementation of move assignment operatorsGiuseppe D'Angelo2020-10-031-27/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment we have two main strategies for dealing with move assignment in Qt: 1) move-and-swap, used by "containers" (in the broad sense): containers, but also smart pointers and similar classes that can hold user-defined types; 2) pure swap, used by containers that hold only memory (e.g. QString, QByteArray, ...) as well as most implicitly shared datatypes. Given the fact that a move assignment operator's code is just boilerplate (whether it's move-and-swap or pure swap), provide two _strictly internal_ macros to help write them, and apply the macros across corelib and gui, porting away from the hand-rolled implementations. The rule of thumb when porting to the new macros is: * Try to stick to the existing code behavior, unless broken * if changing, then follow this checklist: * if the class does not have a move constructor => pure swap (but consider ADDING a move constructor, if possible!) * if the class does have a move constructor, try to follow the criteria above, namely: * if the class holds only memory, pure swap; * if the class may hold anything else but memory (file handles, etc.), then move and swap. Noteworthy details: * some operators planned to be removed in Qt 6 were not ported; * as drive-by, some move constructors were simplified to be using qExchange(); others were outright broken and got fixed; * some contained some more interesting code and were not touched. Change-Id: Idaab3489247dcbabb6df3fa1e5286b69e1d372e9 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QAppleLogActivity: add a swap() methodGiuseppe D'Angelo2020-10-031-0/+6
| | | | | Change-Id: Id698d71fbadf5bd0301a346b3216847d0b2f0b54 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QMacKeyValueObserver: code tidiesGiuseppe D'Angelo2020-10-031-8/+9
| | | | | | | Fix the constructors and the signature of swap(). Change-Id: Ib294bb2c054510170b166b5c8bd3180d22177efc Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Teach QMacVersion to deal with 32-bit Mach-O headersTor Arne Vestbø2020-08-051-4/+0
| | | | | | | Pick-to: 5.15 Pick-to: 5.12 Change-Id: I7946aa35722bc76326e2d6cf0820353c4ba13fad Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Fix no-PCH build on Apple platformsTor Arne Vestbø2020-07-291-0/+1
| | | | | Change-Id: I5257af8079e6b2f26893d1bc44adb48ad4a1684b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add QOperatingSystemVersion support for macOS Big SurTor Arne Vestbø2020-07-291-0/+29
| | | | | | | | | Pick-to: 5.15 Pick-to: 5.12 Change-Id: Ide57f675b20b08210f301da5177df45d008423c4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Move key mapping from QtCore to platform pluginTor Arne Vestbø2020-07-021-2/+0
| | | | | | | | | | | There's a bunch of similar and overlapping logic in QCocoaKeyMapper already. Moving it to the same place allows us to easier find ways to reduce the overlap. None of the exported functions were used outside of the plugin. Change-Id: I6953690cdfda5ee8265b33ccbf919184c3a1700f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Introduce platform API abstraction for QOpenGLContextTor Arne Vestbø2020-07-021-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The API is available by including qopenglcontext.h as usual, but scoped in the QPlatformInterface namespace. The namespace exposes platform specific type-safe interfaces that provide: a) Factory functions for adopting native contexts, e.g. QCocoaGLContext::fromNative(nsContext, shareContext); b) Access to underlying native handles, e.g. openGLContext->platformInterface<QCocoaGLContext>->nativeContext() c) Platform specific functionality, e.g. static QWGLContext::openGLModuleHandle() openGLContext->platformInterface<QEGLContext>->doSomething(); The platform interfaces live close to the classes they extend, removing the need for complex indirection and plumbing, and avoids kitchen-sink modules and APIs such as the extras modules, QPlatformFunctions, or QPlatformNativeInterface. In the case of QOpenGLContext these platform APIs are backed by the platform plugin, so dynamic_cast is used to ensure the platform plugin supports the requested interface, but this is and implementation detail. The interface APIs are agnostic to where the implementation lives, while still being available to the user as part of the APIs they extend/augment. The documentation will be restored when the dust settles. Task-number: QTBUG-80233 Change-Id: Iac612403383991c4b24064332542a6e4bcbb3293 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* macOS: Clean up headersTor Arne Vestbø2020-06-051-19/+34
| | | | | | | | | | | | | | The headers are now C++ clean and can be used outside of Objective-C code. All includes of Objective-C frameworks have been moved to the implementation files. Header guards have been added in the few places they were missing. All includes are now done via #include, instead of sometimes using the #import variant. Change-Id: Ibb0a9c0bcfefbda4347737212e40e300a3184982 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Simplify creating QCFTypes from CFTypeRefsTor Arne Vestbø2019-10-041-1/+4
| | | | | | | | | | | | | | Instead of forcing the user to cast: QCFType<CFFooRef> foo = (CFFooRef)CFFunctionReturningCFTypeRef()); We can do it for them, since we already know the expected type: auto foo = QCFType<CFFooRef>(CFFunctionReturningCFTypeRef)); Change-Id: I994d5d6530f220288b4bfd6ab16eae9f159ce3ef Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add explicit QDebug stream operator for QCFStringTor Arne Vestbø2019-10-041-0/+1
| | | | | | | Disambiguates between the QString and CFStringRef overloads. Change-Id: I55a7121cd7449b4adc081f6bb7e29736e7af4442 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* macOS: Add missing export of QDebug stream operator for QMacAutoReleasePoolTor Arne Vestbø2019-10-041-1/+1
| | | | | | Change-Id: Id3e140bd91dcbf2683a41cd9ac36ff79b8f365b4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Give some TLC to QAppleRefCountedMarc Mutz2019-08-091-2/+10
| | | | | | | | | | - add conditional noexcept to move special member functions - use qExchange() in the move ctor implementation (turns a copy into a move) - separate the default ctor from the ctor that acquires a resource, then - overload the latter for rvalue payloads Change-Id: I6816143a94fe6a74cf0d02569b83a752a8da3089 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-07-221-3/+7
|\ | | | | | | | | | | | | Conflicts: qmake/generators/makefile.cpp Change-Id: Ib3715e626f2fd32804c75c16ea9aa06a1216e76d
| * macOS: Allow overriding NSKeyValueObservingOptions for QMacKeyValueObserverTor Arne Vestbø2019-07-181-3/+7
| | | | | | | | | | Change-Id: I6dc0f7c542ccfb768c1cd8688168c415e2c8a087 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-06-141-8/+63
|\| | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/makefile.cpp qmake/generators/unix/unixmake2.cpp src/corelib/thread/qthread_unix.cpp tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp Change-Id: I1df0d4ba20685de7f9300bf07458c13376493408
| * macOS: Introduce QMacKeyValueObserver and use in theme and styleTor Arne Vestbø2019-06-071-0/+55
| | | | | | | | | | | | Change-Id: I2d21c883628933543ae5a66b694ff7503119bc4a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| * Rename QMacScopedObserver to the more fittingly QMacNotificationObserverTor Arne Vestbø2019-05-291-8/+8
| | | | | | | | | | | | Change-Id: I1d8280fe88871572a3a27e612de49717b3b9ef77 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Remove remaining Q_DECL_NOEXCEPT/Q_DECL_NOTHROW usageAllan Sandfeld Jensen2019-04-041-1/+1
|/ | | | | Change-Id: I91ac9e714a465cab226b211812aa46e8fe5ff2ab Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* testlib: Prevent Apple test logger from stomping on other loggersTor Arne Vestbø2019-03-051-0/+1
| | | | | | | | | | | | | | We were potentially adding the Apple test logger multiple times, and we didn't consider whether the existing loggers were logging to file or not when circumventing them. We now don't use the Apple logger if it would touch stderr and some other logger is using stdout. In the case of no explicit logger being specified on the command line, we allow the Apple logger to take priority over the default plain test logger. Change-Id: I31bbec4f4b3ab84ba9a2be35e8e5db08fee071a7 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* CoreText: Use QCFType to track CoreFoundation member variablesTor Arne Vestbø2018-11-281-1/+1
| | | | | | | | | The operator T() function of QAppleRefCounted should be const so that the underlying type can be accessed from const member functions just like the naked underlying type could. Change-Id: I0819c5795d28442a6ff4db2732e211b183574f9f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Remove codepaths and checks for unsupported Apple platformsTor Arne Vestbø2018-08-311-65/+14
| | | | | | | We no longer support macOS 10.11, iOS/tvOS 10, or watchOS 3. Change-Id: Ide03d8fac06185ef4162ba75ee54a0adf6916905 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Weak-import global objects used for logging on Apple platformsTor Arne Vestbø2018-08-251-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Otherwise the dynamic loader will complain about missing symbols when the binary is run on platforms below our supported deployment target: dyld: Symbol not found: __os_activity_current Referenced from: QtCore.framework/Versions/5/QtCore (which was built for Mac OS X 10.12) Expected in: /usr/lib/libSystem.B.dylib in /Users/torarne/build/qt/5.12/qtbase/lib/QtCore.framework/Versions/5/QtCore Trace/BPT trap: 5 We want this to trigger our own logic in qt_apple_check_os_version(), where we tell the user in more friendly terms what's going on. An alternative to the targeted weak imports would be do import the whole library as weak, using -weak-lSystem.B. This doesn't seem to cause any performance issues at startup, but since we only need the two global symbols we stick to the more targeted solution just to be on the safe side. Change-Id: I87c1f185f6dcf9df26c700d31bb5071ddf7685be Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Improve detection and handling of unsupported Apple platformsTor Arne Vestbø2018-08-251-1/+0
| | | | | | | | | | | | | | | The application name wasn't always printed, so we try try a few more possibilities before falling back to the process name. We also run the check as early as possible, instead of relying on a QCoreApplication. We do not have to provide a dialog to the user, as macOS will do this for us if the application is launched from Finder. Change-Id: Ifbec86946d60294806364e08964852fd4b74ff56 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Take application appearance into account when drawing glyphsTor Arne Vestbø2018-08-241-1/+2
| | | | | | | | | | | | | | | | | | | macOS 10.14 uses a new font smoothing algorithm that takes the fill color into account. This means our default approach of drawing white on black to produce the alpha map will result in non-native looking text when then drawn as black on white during the final blit. As a workaround we use the application's current appearance to decide whether to draw with white or black fill, and then invert the glyph image in the latter case, producing an alpha map. This covers the most common use-cases, but longer term we should propagate the fill color all the way from the paint engine, and include it in the key for the glyph cache. At the moment we do not react to changes in the application appearance, as that seems to be buggy in general in Qt (palette/style, e.g.), and those bugs need to be weeded before we can react to the theme change with confidence. Task-number: QTBUG-68824 Change-Id: Ibbfd49fcf3a091e454009c08159f46b3499e2bd0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>