summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
Commit message (Collapse)AuthorAgeFilesLines
* QObject::disconnect: remove dead codeFabian Kosmale2021-06-231-8/+0
| | | | | Change-Id: Id82ee3d0fb04d89e498cf05d0c0be33c4fe03e86 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Rename PermisionType to spell permission correctlyEdward Welbourne2021-06-236-13/+16
| | | | | | | | | Thanks to Giuseppe for pointing it out in API change review. Task-number: QTBUG-94407 Pick-to: 6.2 Change-Id: I3b8fb653b5efa7ded51f81aadb35d361e7dbf19c Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Coding style: remove redundant braces, break long lineEdward Welbourne2021-06-231-4/+6
| | | | | | | Task-number: QTBUG-94407 Pick-to: 6.2 Change-Id: Id9bbc3871bc3350fa5cc656f4248de8e6511ff05 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* wasm: remove QEventLoop workaroundsMorten Sørvig2021-06-231-24/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | In general, QEventLoop::exec() _can_ be used as-is on WebAssembly, provided that the event dispatcher supports the use case. Use cases that can work include calling exec() on a secondary thread, or calling exec() on the main thread if asyncify is used. Some use cases will still require special casing for Wasm, such as the non-asyncified QApplication::exec(), but that can be handles closer to where the workarounds needed, for example in QApplication. This removes the partial support for nested event loops on the main thread, which did not really work. Also, we no longer call emscripten_force_exit() on QEvetLoop::exit(), which makes it possible to exit a top-level event loop without exiting the process. Task-number: QTBUG-70185 Change-Id: I3a28f41b8547ed3ba1bdf6a835e6662483e34449 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* QEventDispatcherWin32: suppress old {FD_CLOSE|FD_CONNECT} notificationsAlex Trotsenko2021-06-191-3/+10
| | | | | | | | | | As with other network events, we must also ignore these notifications until WM_QT_ACTIVATENOTIFIERS message is received. Fixes: QTBUG-82835 Pick-to: 6.2 6.1 Change-Id: I0740bf22e8d1cb0e8b4eba7fc1a27ffe669973ff Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QBindable: Use setter in setValue for QObjectCompatPropertyFabian Kosmale2021-06-171-0/+31
| | | | | | | | | | | | Directly writing to the underlying property storage has the potential of breaking all kinds of internal invariants. As we return QBindable in the public interface, we should not grant callers access to the internals of the object. Pick-to: 6.2 6.1 Change-Id: I737ff293b9d921b7de861da5ae23356c17690b78 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
* Silence a few warnings from excess semicolonsAllan Sandfeld Jensen2021-06-171-4/+4
| | | | | | | We dont really need those after functions definitions. Change-Id: I41f010a223977c55d4b7271ac3ebdc1bb9047b09 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Universally pass QMetaType by valueUlf Hermann2021-06-174-1/+6
| | | | | | | ... and add Qt7 TODOs where we can't because of BC. Change-Id: Idce8b677ae95231e1690ac4265dc6f06818052e7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QObject: cleanup the orphaned connection lists on destructionGiuseppe D'Angelo2021-06-171-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a signal/slot connection is broken, it gets added to the sender's list of "orphaned connections", to clean up later. This cleanup happens when the sender gets destroyed or as soon as it emits any signal. This may cause soft memory leaks in case receivers get destroyed, and the sender is a long living object and doesn't emit signals for a while (e.g. QThread). For some reason, an explicit disconnection cleans up the list (either by using the QMetaObject::Connection object, or in case of string-based connect, using a string-based disconnect). This raises lots of doubts about why having this list in the first place. Fix the soft-leak by cleaning up the orphaned connection list when destroying a receiver. Note: I still believe that we shouldn't have any "orphaned" connection list, and rather cleanup on disconnect/deletion (otherwise, emitting a signal may cause a CPU spike because it triggers a cleanup). If we allow for any "impredictability" during signal activation we're just admitting that signals/slots aren't suitable for e.g. low-latency codepaths. That's why I'm not marking the problem as fixed. Original-patch-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Task-number: QTBUG-88248 Task-number: QTBUG-87774 Pick-to: 6.2 6.1 5.15 Change-Id: Id25f67a45dff49f740132a44d36e88740eb12070 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix crash in concurrent disconnectLars Knoll2021-06-172-21/+42
| | | | | | | | | | | | | | This does not fix all data races that we have in the system yet. One major issue is the virtual disconnectNotify(), that can be called from any thread and thus is inherently problematic, as it can collide with the object getting destroyed at the same time in another thread. Pick-to: 6.2 6.1 5.15 Task-number: QTBUG-88248 Change-Id: I9d841eb363b7e4f0de1657aeb8f5340d0fd55190 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* cleanOrphanedConnectionsImpl: Allow to skip lockingFabian Kosmale2021-06-172-6/+26
| | | | | | | | | | | This function is/will be used in a few places where we already have a lock. Temporarily unlocking and relocking invites all kinds of troubles. By adding a flag we can instead tell the function that we already hold the lock. Pick-to: 6.2 6.1 5.15 Change-Id: Ibca089de61133661d5cd75290f2a55c22c5d013c Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Apple: Use POSIX IPC instead of System V in sandboxed applicationsTor Arne Vestbø2021-06-167-10/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* macOS: Detect sandboxed state for command line appsTor Arne Vestbø2021-06-161-2/+2
| | | | | | | | | | | | The documentation says that if we "pass a URL to the main executable of a bundle, the bundle as a whole is generally recognized.". By passing the executable instead of the bundle we include command line applications that don't have a app bundle folder (but have an embedded Info.plist). Pick-to: 6.2 6.1 5.15 Change-Id: I3a2f145c1ec6e16607e9c04baf08678d5dea0b81 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Revert "Remove old Android code that have now has alternative public APIs"Jani Heikkinen2021-06-164-3/+2900
| | | | | | | | | | | | | This reverts commit 03eb44394e4cdf3d2a9aa7be632b487313519fbb. Reason for revert: This breaks the dependecy update round in dev now. The revert can be reverted again after 1) Full dependency round is succeed in 'dev' 2) Android extras submodule has been removed from qt5.git#dev (7aa41d22fa485f212aebbef500ea91921c7bc38b) 3)qtmultimedia has been ported to use new api instead of this old one 4) Full dependency round with all above is succeed in 'dev' Change-Id: I23241d2a90307074ecfc9573d2b58baba1874cfc Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Bindable property docs: mention virtual setters and gettersIvan Solovev2021-06-151-0/+25
| | | | | | | | | | Update the bindable property docs to explain how to deal with virtual getters and setters. Task-number: QTBUG-92994 Pick-to: 6.2 Change-Id: I6c29011817e83623414b39afee0f39ad4cc5c1c9 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Add common internal macros to request jni objectsAssam Boudjelthia2021-06-151-0/+39
| | | | | | | | | | | | | | | | | | There are multiple macros used to get/check and return with error in case the requested object is not valid. These macros are defined in multiple places and duplicated. This patch defines them in one place and then they can be reused. This macro expects a "char m_qtTag[]" variable to be defined in the scope where the macro is used. That variable is used as a tag for the error message printed when an error occur. Another consecutive patch use the new macros over qtbase code. Pick-to: 6.2 Change-Id: Ibb8558d1229cec6dad9ec9da6e2635ea54fd18d6 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Stop using mixed enum arithmeticGiuseppe D'Angelo2021-06-131-13/+13
| | | | | | | | | | | It's deprecated. Port some unnamed enumerations (used only to declare constants) to constexpr integers instead. Apply qToUnderlying as needed. Task-number: QTBUG-94059 Change-Id: Ifaa64ece966ce08df40dc71ffcfa7ac038110e0b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QObject: Fix memory leak in queued_activateFabian Kosmale2021-06-111-12/+34
| | | | | | | | | | | | | | | | | | | | | | | | queued_activate adds a reference to the slot object. It also attempts to deref it again, but that did not work correctly so far. We could end up with T1 | T2 queued_activate | checks isSlotObject | adds ref | locker.unlock() | | QObject::~QObject | //In disconnect all senders loop | sets isSlotObject to false | derefs slotObj, but not deleted checks isSlotObject | (no deref because it's null) | To solve this issue and others caused by early returns, we now use a RAII helper, which always takes care of calling destroyIfLastRef if the ref count has been incremented. Change-Id: I9c011cdb8faa5f344d7e70f024fc13f407e39ccf Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove old Android code that have now has alternative public APIsAssam Boudjelthia2021-06-114-2900/+3
| | | | | | | | | | * Remove the old qjni private APIs. * Remove the Android permission private APIs. * Remove runOnAndroidThread(). Pick-to: 6.2 Change-Id: I37ba8b4cb87a099f067e2e0b6744b8d01a0f9bbc Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* JNI: check if clazz is null before doing a jni callAssam Boudjelthia2021-06-101-8/+16
| | | | | | | | | | Also add missing \since keyword. Task-number: QTBUG-92952 Pick-to: 6.2 Change-Id: Ia1472f04955809fb5132a4b6239dbcbdf63cca93 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* JNI: state that findClass() returns a global refAssam Boudjelthia2021-06-101-11/+13
| | | | | | | | | Fix docs to state that findClass() returns a global ref from the cached classes list. Pick-to: 6.2 Change-Id: I7c45cc4c9e1c6e109db7cf7d926a250592798972 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Doc: Fix QVariant documentationKai Köhne2021-06-091-52/+51
| | | | | | | | | | Update documentation to not reference API that is obsolete in Qt 6. Also fix documentation for changed behavior (isNull()), and fix snippets. Pick-to: 6.1 6.2 Change-Id: I526efeff63d907bbadd5e8a539ccf237cb992125 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Revert "QMetaType: Don't normalize name which should already be normalized"Fabian Kosmale2021-06-091-2/+3
| | | | | | | | | | | This reverts commit f6fa4b39ee32ba4a5c6a3db5581dd50b3afc7a47. Reason for revert: c76a2d7c9cfc5e2edd45a30681df51b37125bc01 was not enough to catch all cases. Pick-to: 6.2 Change-Id: I5830ab20b1f4d26a0a201c3dd5aaee6b10aa12ac Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QMetaType: Don't normalize name which should already be normalizedFabian Kosmale2021-06-081-3/+2
| | | | | | | | | | | | | | | The name stored in a QMetaTypeInterface should already be normalized, as a static metatype uses typenameHelper, which takes care of normalization via QTypeNormalizer. For dynamic metatypes, we don't have that guarantee, but those can only be created by Qt, as there is no public API for it. We can thus ensure that we only create normalized typenames (which we currently do anyway), and skip the normalization in registerCustomType. Change-Id: I18728031825cd39fdbe17cad0fbc6e3b5fd03c93 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* normalizeTypeFromSignature: Beware of anonymous struct/unionFabian Kosmale2021-06-081-2/+11
| | | | | | | | | | | | | | | | | | Do a quick check whether the type name contains an anonymous type. If so, do not try to use optimized version. The simple check should still be faster than calling normalizeType unconditionally. Also only apply the faster version for clang and gcc, instead of all non-MSVC compilers. Applying it to other compilers would require further testing to handle anonymous structs. Moreover, remove space before '(', which is necessary for function pointers. Fixes: QTBUG-94213 Change-Id: I795d1964f7a68daa6f9a5f262816d51ee7728788 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Android: Use the new runOnAndroidMainThread() callAssam Boudjelthia2021-06-072-3/+3
| | | | | | | | | | | | Remove the [&] capture in runOnAndroidMainThread() for void type. Replace the old private QtAndroidPrivate::runOnAndroidThread() with QAndroidApplication::runOnAndroidMainThread(). Task-number: QTBUG-90501 Change-Id: I41eaf1ea9ee68b22861bf498f12a97a02515cc47 Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Doc: QtCore: Fix more documentation warningsTopi Reinio2021-06-072-5/+7
| | | | | | | | | | | | | | * Omit 'Bluetooth' enum value in QPermission::PermisionType (sic) as that seems to be unimplemented. * Comment out \sa links to internal/undocumented functions. * Fix incomplete template parameters in \fn commands for QProperty methods. Task-number: QTBUG-93995 Change-Id: Ic8e63fca22c9c72325c76f90f537b221f56ebace Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QProperty: Fix source_location feature testingFabian Kosmale2021-06-071-2/+10
| | | | | | | | | | | | | | | | | The presence of the source_location header does not guarantee the availablility of std::source_location. For instance, if using clang 11 with a modern libstdc++, the source_location header is available, but std::source_location is not available as it would require __builtin_source_location, which clang does not implement. Consequently, we need to explicitly check the feature test macro instead, and only use std::(experimental::)source_location when it is defined. Task-number: QTBUG-94194 Pick-to: 6.1 Change-Id: If6fda9a1b98244b1f2944fff6fe1991def30fc0f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QMetaType: Avoid instantiating QMetaType in Q_DECLARE_METATYPEFabian Kosmale2021-06-071-12/+8
| | | | | | | | | | | | | | | | Having a call to QMetaType::fromType in struct QMetaTypeId causes issues if Q_DECLARE_TYPEINFO is used later, as it will already cause an instantiation of QTypeInfo. Instead, use QtPrivate::typenameHelper to obtain the name. We cannot use QMetaTypeForType::getName, as that would cause similarissues with QMetaTypeId2. However, QMetaTypeId2 is only used for builtin metatypes, which do not use Q_DECLARE_METATYPE. And even if a user would use Q_DECLARE_METATYPE with them, the worst that happens is a superfluous type normalization. Fixes: QTBUG-94124 Change-Id: Ie4a993411214fd009a604de44306131c647095eb Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QProperty: Do not involve semi-destroyed QObjects in bindingsFabian Kosmale2021-06-074-0/+19
| | | | | | | | | | | | | Once we're in ~QObject, only methods of QObject are still valid. Notably, no setter of any derived class is still valid. Thus, to be safe we must no longer react to binding changes of those properties. To ensure that this happens for QObjectCompatProperty properties, we explicitly clear the binding storage. Fixes a particles3d example crash. Change-Id: I10d2bfa5e96621ce039d751cffaf3ac41893623e Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Avoid unnecessary work when linking observersUlf Hermann2021-06-051-1/+1
| | | | | | | | We already do most of the work of setFirstObserver() in the method body before. Change-Id: Ia31f19ca656675dddb692609d8875c5d48e967f1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QProperty: Refresh the observers after evaluating bindingsUlf Hermann2021-06-041-8/+13
| | | | | | | | | Evaluating bindings may actually break bindings, and remove observers. Therefore, we need to re-fetch for notifying afterwards. Fixes: QTBUG-94220 Change-Id: I96a78a825f983f58f1a574bf886e643f54453fdc Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* JNI: Add calls to get field IDsAssam Boudjelthia2021-06-042-0/+47
| | | | | | | Task-number: QTBUG-92952 Change-Id: Ie68ede4b00a411064a29925b28b1f60a84d2d678 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Fix system locale for IntegrityJanne Koskinen2021-06-021-1/+7
| | | | | | | | | Integrity doesn't have langinfo, default locale is C, set to UTF-8 Change-Id: I6a6374195344641f64da895cd5f2745b61af060a Reviewed-by: Kimmo Ollila <kimmo.ollila@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Tuukka Turunen <tuukka.turunen@qt.io>
* Add a const JNINativeMethod[] overload for registerNativeMethods()Assam Boudjelthia2021-06-022-6/+46
| | | | | | | | | | | The JNI interface expects a const JNINativeMethod[] and our wrapper takes a non-const. Also, this was causing refactoring of exisisting code with a const JNINativeMethod[] to fail because the call expects a non-const. Change-Id: If790c401650cb33fe31f93bafe41aab7714488e9 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Simplify storing of notification objectsLars Knoll2021-06-013-7/+159
| | | | | | | | | | | | | | | | | | | | QPropertyChangeHandler is a templated class and it's argument is a functor. That makes it inherently cumbersome to use the class in any context where the change handler needs to be stored. Introduce a QPropertyNotifier class that stores the functor in a std::function<void()>, and add a QProperty::addNotifier() method that can be used instead of onValueChanged(). Also make QPropertyNotifier default constructible. This significantly simplifies the code that needs to be written and makes it possible to store notifications as class members without major hassle. Fixes: QTBUG-92980 Change-Id: Id5b7baec093b9ac0467946cded943d92ad21030b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Doc: QtCore: Fix documentation issuesTopi Reinio2021-06-012-33/+8
| | | | | | | | | | | | | | | | | | * Add module header wrapper that loads the real QtCore header and qandroidextras_p.h to generate docs for those types * Add missing dummy typedefs to doc/include/jni.h * Use the correct \namespace name (QtAndroidPrivate) and mark it as \preliminary * Add missing 'const' specifier for Q[Untyped]Bindable methods * Drop documentation for removed method QProperty::markDirty() * qmath.h: Fix \fn commands for qFloor(), qCeil() * QHashSeed: Drop incorrect usage of \relates Fixes: QTBUG-93942 Task-number: QTBUG-93995 Change-Id: If76b5aa4b79a64add3cb6275eac82ec44ef10319 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Q_DECLARE_METATYPE: Do not re-register typesFabian Kosmale2021-05-311-7/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | When Q_DECLARE_METATYPE is used, we often end up re-registering types as typedefs of themselves. This is because with Q_DECLARE_METATYPE, we set a legacy register operation which calls (after some indirection) QMetaType::registerNormalizedType. We still need to support this to preserve compatibility in the presence of typedefs and namespaced types. However, there is no reason to do the wasteful work of normalizing the typename at runtime and adding memory overhead to have a type registered as a typedef of itself. We can skip the type normalization work by checking whether the name in the metatype interface equals that of the typename. We still need to make sure that the converter and view functions are registered, though. Moreover, we can fix the check in qRegisterNormalizedMetaType to only call registerNormalizedTypedef if the new name doesn't match the name stored in the metatype. Fixes: QTBUG-93841 Change-Id: Icfe42c349b23add630fe3c761362b60e9e9aaa2b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix qdoc warningsVolker Hilsheimer2021-05-271-1/+1
| | | | | Change-Id: Ie51ccff3272f078e062380033678828a01f03eb8 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Android: Add runOnMainAndroidThread() under QNativeInterfaceAssam Boudjelthia2021-05-263-0/+26
| | | | | | | | | | | | This replaces QtAndroidPrivate::runOnAndroidThread{Sync} calls. This also now allows passing std::function<> that can return values, and not only an std::function<void()>. This adds some tests for this calls as well. Fixes: QTBUG-90501 Change-Id: I138d2aae64be17347f7ff712d8a86edb49ea8350 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Android: fix missing includeMårten Nordheim2021-05-261-0/+1
| | | | | | | | qtbase/include/QtCore/../../../../src/qtbase/src/corelib/kernel/qcoreapplication_platform.h:58:57: error: unknown type name 'QCoreApplication' QT_DECLARE_NATIVE_INTERFACE(QAndroidApplication, 1, QCoreApplication) Change-Id: I0a14a2f2ab80f9cc0e7fd3b3060719a1c772bf57 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Doc: Use \deprecated instead of \obsoletePaul Wicking2021-05-264-16/+16
| | | | | | Task-number: QTBUG-93990 Change-Id: I4e512354a49dde6678ca89cabc56bc76ba666bb3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* gcc 11: Adjust pragma warning placementFabian Kosmale2021-05-252-0/+16
| | | | | | | | | | | Apparently, gcc's pragma warning logic has changed from 10 -> 11. For gcc 11, we need to place the macro directly next to the the line which triggers the warning. Task-number: QTBUG-93360 Pick-to: 6.1 Change-Id: Ifaa6136050fe5b887660a8a0acf6938388f4f77d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use __has_* instead QT_HAS_*JiDe Zhang2021-05-211-1/+1
| | | | | | | | Use __has_include instead QT_HAS_INCLUDE Use __has_feature instead QT_HAS_FEATURE Change-Id: If9b0af1f4386f7bcae6ca2fb911ffaba422750dd Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Document that QProperty::subscribe might get executed deferredAndreas Buhr2021-05-201-6/+13
| | | | | | | | | | | With the introduction of grouped property changes, notification calls in bindable properties might be immediate or deferred, depending on the context. This patch documents that one must not rely on immediate execution of functions given to subscribe() and onValueChanged(). Change-Id: I26ec4dbbff17a44ab62037ba1da9ce34c77da972 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Type erase native interfaces via string instead of typeidTor Arne Vestbø2021-05-201-2/+2
| | | | | | | | | | The latter forces users to build with RTTI enabled, as the typeid use is in our public headers. Surprisingly this is also the case even without instantiating the relevant template. Change-Id: Icd18a2b85b250e0b77960797e5c43b7eaf9bd891 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Don't throw an exception on platforms with no permission APIAssam Boudjelthia2021-05-201-8/+21
| | | | | | | | | | | | | | Using the permission API without guards for Android cause exception on all other platforms, instead we can print a warning with the same message if QT_DEBUG is defined to also make it less confusing for other platforms. Also, return QPermission::Authorized by default for platforms with no implementation to this API. Change-Id: Ie01a6a7f8b6a066685d32c861a56e9ded2c06410 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QEventDispatcherCF: avoid QFlags->int implicit castsGiuseppe D'Angelo2021-05-182-2/+2
| | | | | | | | 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>
* Make the exit() methods in QEventLoop and QThread be slotsThiago Macieira2021-05-171-1/+1
| | | | | | | | | | | | | | | The documentation for QCoreApplication::exit() even refers to it as such. Instead of refactoring the documentation to explain that it isn't, just make it a slot and do the same for the other classes. Complements 2e6c37fe51b5f6073db0c7335c4a4272269d482f. [ChangeLog][QtCore][QEventLoop] exit() is now a slot, like quit(). [ChangeLog][QtCore][QThread] exit() is now a slot, like quit(). Change-Id: Ic42004c9bf71440eb433fffd167f4a1b89bcac80 Reviewed-by: David Faure <david.faure@kdab.com>
* Add isValid() call to QJniEnvironmentAssam Boudjelthia2021-05-172-0/+11
| | | | | | Task-number: QTBUG-92952 Change-Id: I3bce2881c10a8bfcc8771002a3349644c6f05cb3 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>