summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qeventdispatcher_cf.mm
Commit message (Collapse)AuthorAgeFilesLines
* QEventDispatcher*: port the Unix dispatchers to V2Thiago Macieira2024-03-131-11/+15
| | | | | | | | | | | They're all ported in one go because all the changes are the same and they all rely on QTimerInfoList. The changes are: - use Qt::TimerId to uniquely identify timer IDs - use Duration (nanoseconds) to specify the timer interval - rename registeredTimers() to timersForObject(), which is const Change-Id: I83dda2d36c904517b3c0fffd17b52958767d8a68 Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
* QTimerInfoList: change timerWait() to return std::optional<ms>Ahmad Samir2023-08-111-12/+14
| | | | | | | | | | | | | QEventDispatcherGlib: it used the out-parameter timespec to set a timeout in milliseconds, making timerWait() return milliseconds is more straightforward. Also timerWait() returns the time rounded to milliseconds, so the code in QEventDispatcherGlib that rounded up the timespec::tv_nsec part was no-op, tv_nsec was always 0 IIUC. In QEventDispatcherGlib, guard against overflow with qt_saturate. Change-Id: Ie6f78374d00cbe8a6adf7b50ed67c8c86ab4d29d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTimerInfoList: don't inherit from a container in an exported classAhmad Samir2023-07-191-1/+1
| | | | | | | | | | | | | | | | | | | Instead use composition by using a container member; inheriting from containers has a couple of issues: - containers (STL and Qt) don't have virtual destructors, which means that deleting via a pointer to the base-class would be troublesome - as it turns out, inheriting from containers, QList in this case, in an exported derived-class could lead to binary-incompatibility issues (see linked bug report) Drive-by change: - group all private members in one place - make timerInsert() private, nothing should use it from outside the class anyway Change-Id: I69843835d8c854fa4b13e8b4ba3fb69f1484f6a6 Fixes: QTBUG-111959 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QEventDispatcherCoreFoundation: fix #include moc location in the fileThiago Macieira2022-07-201-2/+2
| | | | | | | | They must be outside the Qt namespace. Pick-to: 6.4 Change-Id: I3859764fed084846bcb0fffd17030ebc62812e09 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@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>
* 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>
* QEventDispatcherCF: avoid QFlags->int implicit castsGiuseppe D'Angelo2021-05-181-1/+1
| | | | | | | | Use toInt(), or an explicit cast. (I don't quite know why an atomic int is involved here, but anyways, it makes these casts necessary.) Change-Id: I8816ef96bd69a6f3e3f8e025e567e3451069462c Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* macOS: Add missing QT_MANGLE_NAMESPACEMorten Johan Sørvig2020-12-081-1/+1
| | | | | | | | | | | KeyValueObserver and RunLoopModeTracker were causing “Class is implemented in both...” messages when loading multiple namespaced Qt versions into the same process. Change-Id: Idbd2229c61cde6fba2c12b35d045390a371dee68 Fixes: QTBUG-89059 Pick-to: 6.0 5.15 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QAbstractEventDispatcher: change event dispatcher timer interval to qint64Liu Yang2020-09-211-1/+1
| | | | | | | | | Resolve remaining Qt6 TODO [ChangeLog][QtCore][QAbstractEventDispatcher] The signature of the abstract virtual registerTime function now takes a qint64 value for the interval parameter. Change-Id: I10166ad5cfb455edc404d465a3731ff094a8977e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Get rid of hasPendingEvents() and flush()Lars Knoll2020-09-061-22/+1
| | | | | | | They are unused. Change-Id: I77383f2be45551401ed9c2f88285511134cc8b0d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Remove all use of deprecated Q_OS_OSX defineTor Arne Vestbø2020-04-031-1/+1
| | | | | Change-Id: I49c285604694c93d37c9d1c7cd6d3b1509858319 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Export lcEventDispatcher in private namespaceTor Arne Vestbø2019-10-031-3/+8
| | | | | | | | | The category is used outside of QtCore, and needs to be exported for shared library builds. Change-Id: I9bba477d37b823146eaec4e1e53197651f09c013 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Replace use of deprecated API in macOS event dispatchersTor Arne Vestbø2019-09-281-1/+1
| | | | | | Change-Id: I077ba12b406f662ba22b2f2cddf0171963335739 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Prefix textstream operators with Qt::Lars Knoll2019-05-021-1/+1
| | | | | | | As the non prefixed variants are deprecated Change-Id: I2ba09d71b9cea5203b54297a3f2332e6d44fedcf Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Doc: Fix various documentation warningsTopi Reinio2018-11-061-1/+1
| | | | | | | | | | | | These include typos, marking functions as \internal, documenting trivial things, and fixing the function signatures passed to the \fn command. Task-number: QTBUG-71502 Change-Id: I24a9e1f7e1cdb39e5c31b99202bdd593c6b789ff Reviewed-by: Martin Smith <martin.smith@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Make QEventDispatcherCoreFoundaton work on secondary threadsMorten Johan Sørvig2018-08-091-6/+17
| | | | | | | | | | | | | | | | | | | We were using CFRunLoopGetMain() everywhere. Get the correct run loop using CFRunLoopGetCurrent() during initialization, and store it. Event dispatcher initialization must now be delayed until after the constructor has run, since event dispatchers may be created on the main thread and then moved to the target thread. Initialize on first call to processEvents() where the current thread will be the correct thread. Use the stored m_runLoop instead of CFRunLoopGetMain(). This is required for wakeUp() and interrupt() which may be called from another thread. Change-Id: I6fffcfd4394899c4a12f241c42781979aaf99d5e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-06-071-11/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/corelib/kernel/qeventdispatcher_cf.mm src/gui/kernel/qguiapplication_p.h src/gui/kernel/qwindowsysteminterface.cpp src/gui/kernel/qwindowsysteminterface.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/cocoa/qnswindowdelegate.mm src/plugins/platforms/ios/qioseventdispatcher.mm src/plugins/platforms/windows/qwindowsdrag.h src/plugins/platforms/windows/qwindowsinternalmimedata.h src/plugins/platforms/windows/qwindowsmime.cpp src/plugins/platforms/winrt/qwinrtscreen.cpp Change-Id: Ic817f265c2386e83839d2bb9ef7419cb29705246
| * Add function to safely access the shared application on Apple platformsTor Arne Vestbø2018-05-301-11/+6
| | | | | | | | | | Change-Id: I52910309ba94d84d69f049b5c1990f1f866e1698 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | iOS: Document why we're using a runloop mode tracker in our event dispatcherTor Arne Vestbø2018-04-231-0/+18
| | | | | | | | | | Change-Id: I71093ca05988c3e1ad6d51be7363952dd3f0518e Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Allow log messages to be grouped by activity on Apple OSesTor Arne Vestbø2018-03-151-0/+5
| | | | | | | | | | | | | | | | Useful for making sense of the event dispatcher, especially when running tests. Change-Id: Iea84bcfb40d4954439c2e31ffc0197c64907e800 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | Clean up our Objective-C usageJake Petroules2018-02-201-15/+15
|/ | | | | | | | | | | | | | | | - Move ivars into @implementation - Use instancetype where applicable - Use dot notation for property access - Use subscript operator for dictionaries and arrays - Format selectors consistently - Use proper style for init methods - Use generics instead of void pointers where possible - Use "range for" loops instead of indexing - Replace or replace IBAction/IBOutlet with void Change-Id: I1667812a51d4dfe44ae80fe337cb1f4bc9699d92 Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Modernize logging in CoreFoundation and iOS event dispatchersTor Arne Vestbø2018-02-051-48/+39
| | | | | | | | Instead of manually handling logging enablement, we use Qt's categorized logging system. Change-Id: I8d942601f76876030084c9fb130b7215ff6cc404 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-02-241-2/+3
|\ | | | | | | | | | | | | Conflicts: mkspecs/features/moc.prf Change-Id: Ia71c8e3b3185f7c999bf226d0675051b10b8740b
| * Wrap RunLoopModeTracker into Objective-C namespacePavol Markovic2017-02-221-2/+3
| | | | | | | | | | | | | | | | RunLoopModeTracker as one of Qt Cocoa classes was not wrapped in namespace which limited its use in Objective-C single symbol space. Change-Id: Ida2c62c6f543a3bf5107f28c78d27435bcb3470d Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | Build Qt libraries with -fapplication-extensionJake Petroules2017-01-271-1/+2
|/ | | | | | | | | | | | | | | This ensures at compile-time that Qt libraries do not use any APIs that are not safe for use in application extensions, and fixes warning messages that appear when linking to Qt libraries that are not built with this flag, when used in an application extension. This is especially important on watchOS where *all* "applications" are actually application extensions, and on other Apple platforms if application extensions are developed using Qt. Task-number: QTBUG-40101 Change-Id: I022046f2584e0222253d33052b0abc221d7c93d6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Replace QCFString::to(CF/NS/Q)String usage with QString methodsTor Arne Vestbø2016-10-061-2/+2
| | | | | | | | Slims down QCFString and leaves only one implementation of converting back and forth between CF/NS strings and QStrings. Change-Id: I068568ffa25e6f4f6d6c99dcf47078b7a8e70e10 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Add support for Apple watchOSJake Petroules2016-08-191-0/+4
| | | | | Change-Id: I3f9e00569458a463af2eaa5a3a16a6afd1e9c1ea Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* Factor out usage of a private symbol by the iOS platform plugin.Jake Petroules2016-02-191-4/+8
| | | | | | | | This fixes a link error due to symbol visibility when the iOS platform plugin is built as a shared library. Change-Id: I0b454c5c5033c6b598cede11ce5e3a85e5704c4a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* OSX: fix build.Erik Verbruggen2015-11-211-1/+2
| | | | | | | | | | Move the QT_USE_NAMESPACE up, so any use of Q* classes won't result in compilation errors when Qt is configured to be in a namespace. Change-Id: Id559c86798529f6cad43a75fce303c108ce820bc Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* Make CoreFoundation event dispatcher available on OS X alsoTimur Pocheptsov2015-11-131-1/+9
| | | | | | | | | | CoreFoundation event dispatcher on OS X can help users working with QtBluetooth from either non-GUI threads or non-GUI applications. Change-Id: Ie0793e7f49074a8ea9059251cd7c9bdf7953c206 Task-number: QTBUG-48758 Task-number: QTBUG-46625 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* Move QEventDispatcherCoreFoundation to QtCoreMorten Johan Sørvig2015-10-161-0/+624
Export it for use by the iOS platform plugin. Also move QCFSocketNotifier, and export for use by the Cocoa platform plugin. This is a pure code move with no intended behavior changes, in anticipation of using the Core Foundation event dispatcher as the default Qt Core event dispatcher on OS X. Change-Id: I43677d2f6f3c1d0ed0415c964225aa97d2f13078 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>