summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
Commit message (Collapse)AuthorAgeFilesLines
* doc: Prevent overwrite of qbytearray.htmlMartin Smith2017-04-051-0/+2
| | | | | | | | | | | | | A use of Q_GLOBAL_STATIC() tricked clangqdoc into thinking it created something called QByteArray that should be documented, so the html generator tried to overwrite qbytearray.html which had already been created for the real QByteArray. This probably means there is a bug in the clang visitor class, but I can't see it, and this change eliminates 4 qdoc errors. Change-Id: Iee333217212ce60727cd9424a19b8e96a20547b4 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-04-043-26/+42
|\ | | | | | | | | | | | | | | Conflicts: src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h src/plugins/platforms/xcb/qxcbwindow.cpp Change-Id: Ic747c3c50e68c005b425e7a1ec2a90965527c8bd
| * Core: Replace LGPL21 with LGPL license headerKai Koehne2017-03-282-26/+38
| | | | | | | | | | | | | | | | Also use canonical contact url. Change-Id: I43f8c6a2c4949ee0e054045bccc17d82575b072c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
| * Fix crash when QUrl::from{NS/CF}URL() was passed a nullptrTor Arne Vestbø2017-03-271-0/+4
| | | | | | | | | | | | | | Change-Id: Ib193447c4a91dd3d08746e97727f7d4764f33d80 Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Add QMetaObject::invokeMethod() overloads for function pointersBenjamin Terrier2017-04-024-80/+264
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new overloads do not accept parameters for the invoked function, this use case is handled by using lambda. Overloads for non member function pointers and functors are separated as the return type is not retrieved in the same way. Move QSlotObjectBase, QSlotObject and QFunctorSlotObject from qobject_impl.h to qobjectdefs_impl.h in order to make them available in qobjectdefs.h. Update autotests of previous overloads because of a soft break in source compatibility: passing null literals (0, NULL, nullptr, etc.) for the second parameter of invokeMethod() is not supported anymore. [ChangeLog][QtCore] Added QMetaObject::invokeMethod() overloads for function pointers. Task-number: QTBUG-37253 Change-Id: I6fb67e086d315ae393ce32743c4eb1abd6cc9139 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Fix up QAppleRefCounted APIJake Petroules2017-04-012-22/+19
| | | | | | | | | | | | | | | | - Add proper move semantics. - Use better variable names. Change-Id: I9d13e4474414593a451d3ccf34c034cb7ab7f60d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Add QAppleRefCounted template as the base of QCFTypeJake Petroules2017-04-011-19/+25
| | | | | | | | | | | | | | | | This helps to reduce code duplication as it will be used as the basis of other reference-counted RAII template classes in the future. Change-Id: I6e7e32373ec738f68d960afc759213610232b9bf Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Document M_PI and friends in <QtMath>Edward Welbourne2017-03-292-1/+20
| | | | | | | | | | | | | | | | | | These symbols should at least be mentioned in the documentation. Also comment on the option of using template variables for them once we haev support for C++14 Change-Id: Ia40f9b89d9d8a38536a2e51ae3f174b8f16ca7d6 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-03-284-7/+18
|\| | | | | | | | | | | | | | | | | Conflicts: examples/examples.pro tests/auto/corelib/tools/qchar/tst_qchar.cpp tests/auto/other/qaccessibility/accessiblewidgets.h Change-Id: I426696c40ab57d14dc295b8103152cede79f244c
| * Add documentation for TabletTrackingChange enum valueShawn Rutledge2017-03-271-0/+1
| | | | | | | | | | | | | | | | Amends 6aaf8532222759226a9b406bfe6c57787236cbf1 Change-Id: I2c264db235ea552ce6b4eb003d7daeeb2cecde6f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
| * Increase the maximum recursive template depth on INTEGRITYKimmo Ollila2017-03-251-0/+3
| | | | | | | | | | | | | | | | | | | | Set the limit to 128 instead of the default 64 by adding QMAKE_CXXFLAGS += --pending_instantiations=128. This is needed by QMetaType::typeName array implementation. Change-Id: I3fd13967f862f492210572cfe7ee9ffc5e7c9745 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-03-212-7/+14
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/eglfs/eglfs-plugin.pro Change-Id: Id76cdbb41b7758572a3b8ea4dcb40d49bac968db
| | * QMetaType & QVariant: "load" and "save" std::nullptr_tThiago Macieira2017-03-201-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We don't load and save pointers usually because the pointer value cannot be guaranteed to remain across program invocations. However, nullptr is an exception: a null pointer is always a null pointer. We don't actually have to read or write anything: there's only one value possible for a std::nullptr_t and it is nullptr. [ChangeLog][Important Behavior Changes] A QVariant containing a std::nullptr_t is now streamable to/from QDataStream. Task-number: QTBUG-59391 Change-Id: Iae839f6a131a4f0784bffffd14aa374f6475d283 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | * Protect better against timer ID replacementThiago Macieira2017-03-171-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Timer IDs have been reused since Qt 4.5 or thereabouts, so just checking if the timer ID is in the timer dictionary is an incorrect check: our timer may have been deleted and replaced by another with the same ID. Instead of deleting the WinTimerInfo object, let's just mark it as unregistered by setting timerId to -1 and cooperate in deleting at the appropriate places. Since unregisterTimer skips deleting if inTimerEvent is true, the appropriate places are everywhere that set inTimerEvent to true. Change-Id: I057e93314e41372ae7a5ff93c467767c8a6d92ea Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | | Remove unused QPodList classMarc Mutz2017-03-221-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | It's private API, the last in-tree user was removed in acbd7999, but failed to remove the class. Do it now. Change-Id: I26294b535d80b419a2f545a4783014b493a5dc93 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-03-206-18/+16
|\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qfilesystemengine_win.cpp src/gui/text/qdistancefield.cpp src/plugins/platforms/xcb/qxcbconnection.h Change-Id: I1be4a6f440ccb7599991159e3cb9de60990e4b1e
| * | Merge "Merge remote-tracking branch 'origin/5.8' into 5.9" into refs/staging/5.9Liang Qi2017-03-134-11/+11
| |\ \
| | * | Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-03-134-11/+11
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/network/network.pro mkspecs/features/mac/default_post.prf src/corelib/io/qfilesystemengine_win.cpp src/corelib/io/qprocess.cpp src/corelib/io/qprocess.h src/corelib/io/qprocess_p.h src/corelib/io/qprocess_unix.cpp src/corelib/io/qprocess_win.cpp src/corelib/thread/qmutex.cpp src/platformsupport/fontdatabases/windows/windows.pri src/plugins/platforms/eglfs/eglfsdeviceintegration.pro tests/auto/corelib/io/io.pro Change-Id: I8a27e0e141454818bba9c433200a4e84a88d147e
| | | * Use QT_CONFIG(library) instead of QT_NO_LIBRARYUlf Hermann2017-03-062-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the windows file system engine, we add an extra macro to use library loading if configured to do so, but avoid it on WinRT, as none of the symbols would be found. We also QT_REQUIRE_CONFIG(library) in the library headers and exclude the sources from the build if library loading is disabled. This, in turn, makes it necessary to clean up some header inclusions. Change-Id: I2b152cb5b47a2658996b6f4702b038536a5704ec Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| | | * QTimer: Avoid implicit conversion warningsStig Bjørlykke2017-02-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes compiling an application using QTimer and -Wshorten-64-to-32 on a 64-bit system without getting this warning: ... 5.8/clang_64/lib/QtCore.framework/Headers/qtimer.h:171:21: warning: implicit conversion loses integer precision: 'rep' (aka 'long long') to 'int' [-Wshorten-64-to-32] setInterval(value.count()); ~~~~~~~~~~~ ^~~~~~~~~~~~~ Change-Id: I3e0407a7193c841308f7271c41a8dd5a2eb2a534 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | | * Properly use the "process" featureUlf Hermann2017-02-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace all QT_NO_PROCESS with QT_CONFIG(process), define it in qconfig-bootstrapped.h, add QT_REQUIRE_CONFIG(process) to the qprocess headers, exclude the sources from compilation when switched off, guard header inclusions in places where compilation without QProcess seems supported, drop some unused includes, and fix some tests that were apparently designed to work with QT_NO_PROCESS but failed to. Change-Id: Ieceea2504dea6fdf43b81c7c6b65c547b01b9714 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * | | moc: Support signals that return movable-only typeOlivier Goffart2017-03-131-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By adding std::move where it makes sense. This is not only good for move-only types, but for any type which can be moved as it saves copies of the return value in any case. [ChangeLog][moc] Move-only types are now supported as return types of signals and slots. Change-Id: Idc9453af993e7574a6bddd4a87210eddd3da48a9 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * | | Doc: Add links to the signal-slot syntaxes pageSze Howe Koh2017-03-131-1/+4
| |/ / | | | | | | | | | | | | Change-Id: I5443a09d18ada6de16a5cec503523b7cc284b0dc Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | Deprecate QSignalMapperOlivier Goffart2017-03-143-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Does not make much sense now that we can connect to lambda functions [ChangeLog][QtCore][QSignalMapper] QSignalMapper is now marked as deprecated. Change-Id: I89135f23fdf16b42142a125eb7c9a86084c90bfc Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
* | | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-03-143-23/+100
|\| | | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/widgets/qpushbutton.cpp Change-Id: I615de00e6e64540c50f658d4d8ab3e002d701a81
| * | Reintroduce a directed QMetaType::typeName arrayThiago Macieira2017-03-091-10/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit fb376e0fcc8d2d0a1731a588bfc6497d05e090e6 removed an array that facilitated returning the names of built-in types, to avoid the jump tables from the switch statement. This commit brings it back but makes the array a compile-time constant string offset table. The array is created by way of a set of C++11 constexpr functions, so we require that compiler feature. I've tested that MSVC 2015 does support it as well as the ICC 17 when masquerading as MSVC 2015, so I've enabled for that too. The only compiler left out is MSVC 2013. If we didn't need to support MSVC 2015, this could have been written more simply with C++14 relaxed constexpr. This also adds unit tests to confirm that QMetaType::typeName() does return null when we said it would. We're testing QMetaType::User-1 (which we'll likely never use) and QMetaType::LastWidgetsType-1 to select something inside the range of the built-in types. Task-number: QTBUG-58851 Change-Id: I4139d5f93dcb4b429ae9fffd14a33982891e2ac1 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * | Add feature.pushbuttonStephan Binner2017-03-061-0/+2
| | | | | | | | | | | | | | | Change-Id: I654d91635e60b177df16f6dfe00acc940132f66a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | Doc: Remove references to pre-C++11 recommendationsOlivier Goffart2017-03-011-13/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Compiler support for lambda functions and variadic templates is required since Qt 5.7, so no need to mention in the documentation what happens if the compiler doesn't support it. Change-Id: I5caeaa0bd7f0edce81e22e22964e0b7dd042c719 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Remove remaining Carbon includes from QtCore, QtGui and QtWidgetsJake Petroules2017-03-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Carbon is deprecated and we should not rely on it at runtime or compile time. These headers were only included for a small collection of keyboard key constants which have now been hardcoded instead. Change-Id: Ia2eaa267584b63be8019be3bbf64cba897a985a8 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-03-023-8/+8
|\| | | | | | | | | | | Change-Id: I84097f8e7b3b2128028bd7693c913d6968b82bfe
| * | Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-02-242-8/+6
| |\| | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/moc.prf Change-Id: Ia71c8e3b3185f7c999bf226d0675051b10b8740b
| | * Wrap RunLoopModeTracker into Objective-C namespacePavol Markovic2017-02-222-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | make TabletMove hover events conditional on QWidget::tabletTrackingShawn Rutledge2017-02-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the tabletTracking property in the same way that mouseTracking already existed: there is a WA_TabletTracking attribute, and a TabletTrackingChange event to notify when it changes. So for widget applications it's an opt-in feature. QtQuick applications don't yet make use of tablet events, but when they do in the future, we don't yet have a mechanism to turn the move events off; it remains to be seen whether that will be necessary. [ChangeLog][QtWidget] QWidget now has a tabletTracking property, analogous to mouseTracking, which will enable TabletMove events while the stylus is hovering, even if no button is pressed. This allows applications to show feedback based on the other tablet event properties such as rotation and tilt. Task-number: QTBUG-26116 Change-Id: Ie96e8acad882b167e967796cdd17f1ad747a2771 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | | Android: Allow timeout to fade out splash screenMathias Hasselmann2017-03-012-4/+4
| | | | | | | | | | | | | | | | | | Change-Id: I7b24f4d402da7f74b4c983467008ff4c19fc3b1b Task-number: QTBUG-59200 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* | | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-02-281-8/+4
|\| | | | | | | | | | | Change-Id: I7d84cfed0b2a122d334b8a920e6e4f18472d2f11
| * | Fix a race condition between QObject::connect and qRegisterMetaTypeOlivier Goffart2017-02-221-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QObject::connect will extract the QArgumentType for first the signal, then the slot. The QArgumentType with a string constructor will query the metatype system to get the meta type id. But it might happen that between the extraction of the signal's argument and the slot's argument, qRegisterMetaType was called in another thread. For this reason, it's possible that one QArgumentType has a type id while the other does not. For this reason, we should fall back to compare the string if any of the argument's type is 0. Task-number: QTBUG-50901 Change-Id: I260ca662ff00a773ae519f78bb633e05fde0ea81 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Sprinkle Q_DECLARE_TYPEINFO on types used in containersGiuseppe D'Angelo2017-02-233-0/+5
| | | | | | | | | | | | | | | Change-Id: I6c71ed8c20cd5e785037ad25c2d3da8994e8e3a0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Introduce QMetaType::PointerToGadget flag for pointers to gadgetsDaniel Vrátil2017-02-231-1/+46
|/ / | | | | | | | | | | | | | | | | | | | | | | | | A Q_GADGET class can be used both as a value class and a pointer, but right now QMetaType::IsGadget is only set for value types. This change introduces PointerToGadget metatype flag which is set for pointers. This allow for better handling of gadgets in code as well as disambiguating between value types and pointers to value types. Change-Id: Id3bd9e18a8eec7ca1cc6b1c25ed03cdc8c0a75a1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-02-163-50/+40
|\| | | | | | | | | | | | | | | | | Conflicts: src/corelib/plugin/qlibrary_unix.cpp src/plugins/platforms/xcb/qxcbconnection.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp Change-Id: I632c400d909f8c204f55743aadc7886af2f15dfb
| * QJNIHelpers: unbreak runnables counterMarc Mutz2017-02-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding 0 each time will obviously not produce a new identifier each time... Also use static initialization for QBasicAtomicInt. A default-constructed static QBasicAtomicInt at function scope will be dynamically initialized. It will still be zero-initialized, but at least GCC adds guard variables for such objects. When using aggregate initialization, the guard disappears. Amends 265db5ad9bda9c984393c1e95fd27dcc4633ed1c. Change-Id: Ia71290cf26c486dcbcc74381f12cd0c4712d6019 Reviewed-by: David Faure <david.faure@kdab.com>
| * Remove the name cache from QMetaType::typeNameThiago Macieira2017-02-151-25/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was unnecessary, since we only cached the static types, which are all generated by the macro anyway. The way it was implemented, this produced data races that are strictly-speaking UB, even if all the threads were writing the same values to the same data locations. This commit changes a little the code to simplify, since we're changing those lines anyway. Task-number: QTBUG-58851 Change-Id: Idc5061f7145940f987dffffd14a30047846e3113 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * QJNIHelpers: make mutexes staticMarc Mutz2017-02-151-2/+2
| | | | | | | | | | | | | | Amends 265db5ad9bda9c984393c1e95fd27dcc4633ed1c. Change-Id: I707bb88285531ee9f82efec46901871d53413eb3 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
| * Fix UB (data race) in QtAndroidPrivate::requestPermissionsSync()Marc Mutz2017-02-151-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the QSemaphore::tryAcquire() call times out, we mustn't touch *res, because there was no happens-before relation established between *res = result in the lambda and our returning *res; Fix by returning a default-constructed hash in that case. Add a strategic std::move(). The same problem exists in runOnAndroidThreadSync(), but I have no idea how to solve it, because there the shared object is the runnable itself. Change-Id: I9a2c431144c169fbd545763555d96153143a11bf Reviewed-by: BogDan Vatra <bogdan@kdab.com>
| * QJNIHelper: fix a potential race in sendRequestPermissionsResult()Marc Mutz2017-02-151-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code obtained an iterator into a QHash under mutex protection, then dropped the lock, dereferenced the iterator several times and only retook the lock to erase the element from the QHash. This is very smelly. QHash provides no official iterator validity guarantees, and the container isn't const, either (which would imply thread-safety). In particular, the dereference into the container outside the critical section is cause for concerns. Simplify the code, removing any doubts about its race-freedom, by taking the payload item out of the hash before dropping the lock, and using only the local strong reference in the remainder of the function. The only other references to g_pendingPermissionRequests are insertions with unique-by-construction keys in QtAndroidPrivate's requestPermissions(), so there was no reason to keep the item in the hash for the whole duration of the sendRequestPermissionsResult() call. Change-Id: I39fe0803b13b3046d1f0fd9c8e96c531406d57da Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: BogDan Vatra <bogdan@kdab.com>
| * Enable QtAndroid::runOnAndroidThread in a ServiceHeikki Haveri2017-02-151-1/+1
| | | | | | | | | | Change-Id: I214f5dc70c52011a5e1712ea70f97f8b564fb664 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
| * Turn QThreadData::threadId into a QAtomicPointerThiago Macieira2017-02-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | Solves a data race found by TSan. Since thread and threadId are QAtomicPointer, I've removed the explicit initialization in the QThreadData constructor Task-number: QTBUG-58855 Change-Id: I4139d5f93dcb4b429ae9fffd14a34082f2683f76 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * QJNIHelper: clean up atomic int and mutex handlingMarc Mutz2017-02-141-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | 1. Do not use Q_GLOBAL_STATIC to hold QAtomicInt or QMutex, use file-static QBasicAtomicInt and QBasicMutex instead. They are zero-initialized PODs. 2. Use only QMutexLocker to lock mutexes. Also wrap the atomic counter into a next...() function, as done elsewhere. Change-Id: I4b14ac0de9d4cb6780b1f1372c2b5fc88e918e4c Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Android: De-duplicate vtables of exported private classesMarc Mutz2017-02-162-7/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By making the destructor (usually the first non-inline, non-pure, virtual function, and therefore the trigger for most compilers to emit the vtable and type_info structures for the class in that TU) out-of-line, vtables and, more importantly, type_info structures for the class are pinned to a single TU. This prevents false-negative dynamic_cast and catch evaluation. Since the classes are already exported, users of these classes are unaffected by the change, and since it's private API, we don't need to avoid adding code to the out-of-line destructor until Qt 6. While at it, de-inline also the empty default implementations of virtual (non-dtor) functions. Task-number: QTBUG-45582 Change-Id: I3e6f37eab1dee0db445f6c13638a43ca3bf6ac62 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-02-141-11/+6
|\| | | | | | | Change-Id: I2bd2e61bae1eab4fc74fa6accd741ed9ae1f0669
| * Avoid unnecessary creation of some Q_GLOBAL_STATICThiago Macieira2017-02-091-11/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If these lists weren't created in the first place, then they are empty. We don't need to create it in order to conclude that. Unlike most Q_GLOBAL_STATICS, these are almost never used and yet they were always created due to where they were checked. Since we're calling exists() before, there are two consequences: first, since the list already exists, we're not allocating memory so it cannot throw std::bad_alloc when being accessed. Second, since we've just checked it exists, we can use QGlobalStatic's operator*(), which is slightly faster than operator()(). The weird &(*list) syntax is only to avoid changing the rest of the code that used a pointer Change-Id: Ifaee7464122d402991b6fffd14a0e44f533dc3d9 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>