summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Doc: Update obsolete external URLsTopi Reinio2015-04-111-2/+2
| | | | | | | | Update external URLs in the documentation for links where the resource is still available online. Change-Id: I99e5d6d7e030f93c3fe8d31cf300077e2897649e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Update copyright headersAkseli Salovaara2015-03-31514-6523/+6522
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I7e3e96183e073877b46bc8071b2ccae19e69426b Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
* Improve digitToCLocale sign char handlingSamuel Gaist2015-03-301-2/+2
| | | | | | | | | | | | | | | | This patch adds more char tests for the plus and minus signs to ensure that e.g. number input widgets can be used with the locale and the known sign chars. [ChangeLog][QtCore] Fixed a bug that caused negative number input using '-' to be rejected because the current locale uses e.g. 0x2212. QIntValidator and QDoubleValidator now accepts both signs as well as the locale minus sign. Task-number: QTBUG-35069 (cherry picked from commit qtbase/dc80838a378268a13ccbe74b481528f1ad631918) Change-Id: I924bebe51028c58454eb864ad07d4af5efe3b5c9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Simplify calculation of week numberLars Knoll2015-03-111-50/+17
| | | | | | | | | This also removes a dependency to 3rd party licensed code. Backport of a29b7635bd1d58b29fca96bd3e7831d0ee1f6666 in Qt 5. Change-Id: I647457d7787eed6d5bfc31de4816e68a9f236239 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* QThread: fix race when setting the eventDispatcherAndy Shaw2015-02-083-0/+7
| | | | | | | | | Use QMutexLocker to make this thread-safe. Task-number: QTBUG-29452 (cherry picked and adapted from qtbase/f4609b202208fe592d24c7ae3b4a48ee83045497) Change-Id: I5caf71d9a5dc6e3d655eac84426a0c5592772235 Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
* Fix QLineF Detailed DescriptionSamuel Gaist2015-02-061-1/+1
| | | | | | | | | | Currently angle() is used in place of angleTo() to describe the difference with intersect. This patch fixes that. Task-number: QTBUG-44309 Change-Id: Idfc521932247f76fe15fd980ff8e87e52feec1f1 (cherry picked from qtbase/7dd0ea7b644fe63ef57a9e7b30a9fd5312159e40) Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
* Bump year to 2015Kai Koehne2015-01-152-5/+5
| | | | | | | Bump year to 2015 in all but source code comments. Change-Id: I1dd7972dee65a86a9bd560ead32bbd0cbe82f439 Reviewed-by: Martin Smith <martin.smith@digia.com>
* Introduce Windows version 10.Friedemann Kleint2015-01-102-0/+6
| | | | | | | | | | Detect OS kernel version 10.0 as Windows 10. Task-number: QTBUG-43413 Change-Id: I39307cf8cc2e7cc209d6a88b8576db87086fa20e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from qtbase/b495a27d4e28ed19b00557dbaf8ab5d31c21ae4f) Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Windows: Fix OS version determination for Windows >= 8Friedemann Kleint2015-01-081-10/+67
| | | | | | | | | | | | | | | First, try to determine the version of kernel32.dll by using the version API. If that fails, loop using the version macros, taking the major version into account. Hangs in the minor version loop have been observed, potentially related to the major version. Task-number: QTBUG-43413 Change-Id: I982e78873510e7598c7cf839177e59812acd86f6 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com> (cherry picked from qtbase/6796f2337ee31b4b4f07eaa54d868b999c39233a) Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDateTime: Fix time format in docOrgad Shaneh2015-01-071-1/+1
| | | | | | | | | MM stands for month, SS is invalid Task-number: QTBUG-12236 Change-Id: I9b4a57d05d77fd38db30b53b16c382ea545edb80 (cherry picked from qtbase/a457bf3ff73627aa2c95f0482a838b14fd3233a0) Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Bump Qt version to 4.8.7Akseli Salovaara2014-12-031-2/+2
| | | | | Change-Id: Icd6fcdb59eb1b9fd8de555ef1c1c87a379f06a27 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove the use of a template qUnused function for ICCThiago Macieira2014-11-261-1/+1
| | | | | | | | | | ICC 12 does not seem to need this. Change-Id: I98e9d530e767c4d24424f0c2b5d763f863e85fe4 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> (backported from qt5/qtbase d3951a5b0f4fe9731d1512668b43f51bd98bd84e) Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* Remove use of 'register' from Qt.Kevin Funk2014-08-1116-106/+106
| | | | | | | | | | | | | | | It is deprecated and clang is warning about it [-Wdeprecated-register]. Original patch from Stephen Kelly, see commit d9fb6e6dbb2b322556d581265da2442e3b91a6a3 in qt5/qtbase This is a backport of this commit + additional manual replacements in header files. There are still some 'register' uses inside implementation files left, but headers are all 'register'-free now. Change-Id: I7225381df1f093073583d62fa86f7bd7cca869c7 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix at lot of QT_NO_ define guards for very tiny Qt builds.Robert Griebl2014-08-054-0/+14
| | | | | Change-Id: If33639be245a1ad3782e1fde279371f330a988be Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Move the C++11 support macros to a central place.Raphael Kubo da Costa2014-07-231-39/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main objective of this commit is to make C++11 support work with clang: so far, the Q_COMPILER_* definitions related to C++11 were enabled based on __GNUC__ and __GNUC_MINOR__; while clang does define those two, __GNUC_MINOR__ is hardcoded at "2" and thus none of the macros end up being defined. We now make qglobal.h more similar to how qtbase's qcompilerdetection.h works by separating the detection of the C++11 features supported by a compiler from the detection of the compilers themselves. It is important to note the list of macros has not changed, the macros have only been moved. This commit either follows the spirit of or is a cherry-pick of the following qtbase ones: - 4131c323a36ee8680a3b4d66a2a03a00544751c2 (Update the C++11 support macros) - 8dd66f42e834320c4ba0a6f2e45855d591b3b6e7 (Avoid undefined macro warning for __GXX_EXPERIMENTAL_CXX0X__) - fe5d5fdaf1d9b7d108727d290e24a6b0f00139c6 (clang: Use __has_feature() to detect C++11 features) - 0ec953c93688ec0de74cda43b91f66f4cf879e5f (Remove extra Q_COMPILER_xxx defines from the MSVC section) - 163dcf2b71f34a12137f200e4af5640e42e5f5e2 (Fix build with older Clang versions without __has_extension) - 53262b9b5b9cb536916f6d6e086a944cb17bb8d8 (Only define the MSVC C++11 feature macros in C++) Change-Id: I2ca35af1a23260a9373943f97a8a72db3fc670e4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use correct values for MAC_OS_X_VERSION_10_* defines.Jake Petroules2014-06-131-12/+47
| | | | | Change-Id: I1951fd6447a3d9d20feea99408174d4993a81f5c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Properly escape bytearray data outside the ascii range when using a codecLars Knoll2014-06-121-2/+5
| | | | | | | | | | | Some codecs can't handle the range outside ascii properly and would then fail to read the data back in correctly. Backport of change 7df8b1ada4b23acedda5724b492c26a8e322648b from Qt 5. Task-number: QTBUG-15543 Change-Id: I4c02921e787a939eeec0c7a11603b5896d756aef Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update for OS X Yosemite.Jake Petroules2014-06-062-1/+8
| | | | | | | | (Qt 4 equivalent of qtbase/203ce7c5ce36f300750607b74b2d2429be2d4959) Change-Id: Icce8517d02dc70b545cf68a265e28083018b3225 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix trailing whitespace.Jake Petroules2014-06-061-1/+1
| | | | | Change-Id: Iab22897d7c766202d214b04d422e56becb544e40 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix QSysInfo::macVersion for OS X minor versions greater than 9.Jake Petroules2014-05-311-2/+3
| | | | | | | | | | gestaltSystemVersion's encoding only has room for a single version digit. Thus, OS X 10.10 would previously have been detected as OS X 10.9 (Apple's comments in the header even warn against this). (backported from qtbase/42f9a61608fe662e797dc6541f4e82c19b878d56) Change-Id: I329355135e82d0e57d9b70a93a62a5f086aa0955 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* fix WINVER #ifdef for QS_TOUCH and QS_POINTERJoerg Bornemann2014-05-201-2/+2
| | | | | | | | | The condition in WinUser.h is _WIN32_WINNT >= 0x0602. This change is a backport of qtbase/e26ed09102e2eb350eb072decbd670b7d515be45 Change-Id: I0725e65948528889623a0b0ff290745996a8b0a3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Use WINVER instead of _MSC_VER for version check in qeventdispatcher_win.cpp.Joerg Bornemann2014-05-061-2/+2
| | | | | | | | Task-number: QTBUG-38604 Change-Id: Idb8a8219e09c6aa1a1b24e45b9da640c8d4b7161 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> (cherry picked from qtbase/e30ae1268f8e224369ff7841b90184c8694a86e7) Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Refactor OS X bundle detection for QFileInfoSamuel Gaist2014-05-021-13/+65
| | | | | | | | | | | | | | | | | | | | | CFBundleGetPackageInfoInDirectory originally used tests for the presence of information that are not mandatory in a bundle. Following Apple's documentation, the new approach is to use Uniform Type Identifier which queries the OS directly to check whether the extension conforms to kUTTypeBundle. That includes e.g. applications, frameworks etc. Then it tries to determine if the bundle can be opened with an application that is not Finder. Last thing, it checks whether the package bit is set. (cherry picked from qtbase/72d60ea08c14037250459a5424ffee7a36b909b1) (cherry picked from qtbase/bcfc68f9cd00982decd7ceb312966caf6b1ca05e) (cherry picked from qtbase/afacf694d5a6f34b88989e76971d70d700ce4949) Task-number: QTBUG-31884 Change-Id: I4ce3d8b90d116960b2044d3fafe3f745f6141416 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QNX: Fix QDir::entryInfoList()Bernd Weimer2014-04-223-11/+12
| | | | | | | | | | | | | | If D_FLAG_FILTER is set, duplicate name entries are filtered out, so this flag has to be set along with D_FLAG_STAT in the call to dircntl. Also releaved dependencies between defines__EXT_QNX__READDIR_R, __EXT_QNX__READDIR64_R and _POSIX_THREAD_SAFE_FUNCTIONS Back-ported from qtbase: aee59f06e0017e225363d4207d3d96c2b30698e1 Change-Id: Ifa2148cc49544076fcfe8fb88e2a0dfe2404959e Reviewed-by: Fabian Bumberger <fbumberger@rim.com> Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
* Fix compilation using MinGW 64 due to missing __cpuidAllen Winter2014-04-181-7/+7
| | | | | | | | | | | | Compile fails on Windows 64 using MinGW with the error message: '__cpuid' was not declared in this scope. fix by moving the Q_CC_GNU block above the WIN64 block as suggested by Thiago in the QTBUG-34022 comments. Task-number: QTBUG-34022 Change-Id: Iced4ac0b64f8ba986e49543ff3793ae8c0c33d14 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Updated year in copyright headerKai Koehne2014-03-26512-515/+515
| | | | | | | | | | | | | | | | | | find . -path '*/3rdparty/*' -prune -o -type f -print | xargs -L1 sed -i -E 's/Copyright(.*) 2013 Digia/Copyright\1 2014 Digia/g' Manually patched files: demos/spectrum/3rdparty/fftreal/fftreal_wrapper.h demos/spectrum/3rdparty/fftreal/fftreal_wrapper.cpp src/3rdparty/s60/eiksoftkeyimage.h tools/qdoc3/test/qt-project.qdocconf tests/auto/qsharedpointer/nontracked.h tests/auto/qsharedpointer/nontracked.cpp Change-Id: I3f9074923b4d6bd4666258ab04f01476cc6e901c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Sergio Ahumada <sahumada@blackberry.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add AArch64 support to qfilesystemwatcher_inotify.cppLisandro Damián Nicanor Pérez Meyer2014-03-241-0/+9
| | | | | | | | | | | | Based on a patch by Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>, licensed under CC0 (aka Public Domain) or BSD license. Backported from qtbase, commit d5dcd6d16647e4ecac239fa26ade5963f0e3f933 Change-Id: I0d01a129c039250ac33dc5f984baec9595786211 Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* BlackBerry: Improve platform specific documentationBernd Weimer2014-03-182-2/+20
| | | | | | | | | | Updated BlackBerry specific documentation around QSettings to make the differences more obvious for developers. Back-ported from qtbase: 563342d7ef7e490239cba6d335849ebb91983b9a Change-Id: I603053cecff97f3222257cbba8d72d2ec2666d6f Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
* do not use fileno calls in forked childJoerg Bornemann2014-03-131-4/+4
| | | | | | | | | | | | | | | | | | | | | This fixes an issue that causes QProcess::start to silently fail on OS X 10.9. Apparently, fileno(stdout) locks the handle on OS X 10.9. It may happen that the parent process fflush()s stdout while the child has just been forked. The stdout lock of the parent is never released in the child and fileno(stdout) therefore locks forever. According to the fork documentation on opengroup.org one may only call async-signal-safe functions between fork and exec in the child. The fileno() function does not appear in the list of async-signal-safe functions. Also, fileno(stdout) and friends can be easily replaced by the standard constants STDOUT_FILENO etc. Done-with: Fawzi Mohamed <fawzi.mohamed@digia.com> Task-number: QTBUG-37306 Change-Id: I2b1f5f47cc48a1ad020fb0493a955d2bc27aeb47 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from qtbase/b2216bbe06b8be2bef6d8bc2ffff1337f6d23358)
* Doc: Update, and reduce duplication of, QThread-related infoSze Howe Koh2014-03-131-14/+15
| | | | | | | | | | | | | | | | | | | | | | Added/Changed: - Move content from the Thread Basics overview to the QThread class ref - Rephrase bits for clarity - Use more links Removed: - (threads-basics.qdoc) Warning against moveToThread(this): This usage came about when people tried to add slots to a QThread subclass. This patch adds a warning against the root cause. - (threads-basics.qdoc) The strategy for managing member variables: Sounds error-prone. Pushing results through signals is safer. - (qthread.cpp) The note about GUI classes: Irrelevant to QThread, and it's already mentioned elsewhere. This is a cherry-pick from a9d5627e6a7b82 in qtbase.git. Change-Id: I491f64f998050daf0251abb2126bc9f7a198c17d Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Doc: Discuss the concept of thread affinity in more detailSze Howe Koh2014-03-131-7/+35
| | | | | | | | | | | | | | | | | - Create a section dedicated to this concept, which is fundamental to signal/event handling - Move relevant content from the very broad "Thread Basics" page to the QObject class ref - Flesh out existing content, including distinguishing signals from events - Address the common misconception that "member" = "child"; this has been encountered several times in the Qt Project forums This is a cherry-pick from 3b45dfe6e6ff6c0626b in qtbase.git Change-Id: If3b65f3da4e1ca414c7175c4e22bcdef38f45442 Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Qt 3 Support: Prevent double deletion of QObjectPrivate::threadData in ↵Friedemann Kleint2014-02-251-0/+1
| | | | | | | | | QSettings. Task-number: QTBUG-36908 Change-Id: I8f9f86f20bd8bb479c2637f6c276e4e2593ecef9 Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* Fix the name of the arguments of qAtan2 to match std::atan2Thiago Macieira2014-02-051-3/+3
| | | | | | | | | | | | There is no change in functionality, just swapping of the names x and y. The std::atan2 function uses (y, x) in that order, so we should too. Task-number: QTBUG-27090 Change-Id: I7d4597a6c6909f574c517033f5d49fe17b7a7ead Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> (cherry picked from qtbase/9aa67cf0c48ff8e9e73fc19c4dcd950961b5ad54) Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* qthread_win.cpp: Fix warnings when waiting for adopted threads.Friedemann Kleint2014-01-091-1/+5
| | | | | | | | | Task-number: QTBUG-35591 Change-Id: I63169bd8a9758a7dad33d4231d3d6c9d71c7e252 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from qtbase/d1f8a5641615eb83bb36b4ada5913531d0da24f1) Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* Don't use Standard Library routines in qthread_p.hThiago Macieira2013-12-061-2/+10
| | | | | | | | | | | Just write the for loops by hand so we don't need to use the Standard Library. That's necessary to support a -no-stl build. This patch is not necessary in Qt 5 since Qt 5 does not have -no-stl. Task-number: QTBUG-35424 Change-Id: Id449d807eaf7350f1a668ef16d356a9e236c6058 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QBBSystemLocale: Do not set fixed buffer size when reading pps objectsEl Mehdi Fekari2013-12-051-4/+20
| | | | | | | | | | Set dynamically the buffer size when reading pps objects since a pps file size is not always fix. Cherry-picked: qtbase/edf29a9aa93660ac8e4927db7fef2b5d925e9b59 Change-Id: Id55df6a474b6b79d96e3459e807f0bbfeacbf0cb Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
* QNX: Make use of _readdir64_rBernd Weimer2013-11-281-2/+2
| | | | | | | | | | | | Latest QNX versions support _readdir64_r. It will be used by QFileSystemIterator now, when available to support large file systems. Backport from qtbase/5d8c05baf478d8eb8cb7ce827caa2c1103f5fa3f Change-Id: I264cc39a0cae6e84ed0db2e10df5ea22c8ae3df4 Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
* Fix virtual key mapping on MS WindowsJuan Luis Boya García2013-11-251-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | In order to map MS Windows virtual keys to Qt keys without messing with dead keys now I use the built-in keyMap structure of QWindowsKeyMapper and assert every cell in the keymap is properly updated. In order to guarantee this even when the user changes the keyboard layout, WndProc now manages the WM_INPUTLANGCHANGE message, which is handled by QWindowsKeyMapper, resetting the layout structure. I don't fully understand yet some things about QWindowsKeyMapper, i.e. how QWindowsKeyMapper::updatePossibleKeyCodes workarounds the dead key issue with ToAscii; but it seems to work fine in all the tests I've done. Any further testing is highly appreciated, though. [ChangeLog][[QtGui][Platform Specific Changes][Windows] Fixed virtual key mapping on Windows. Task-number: QTBUG-33409 Task-number: QTBUG-8764 Task-number: QTBUG-10032 Change-Id: I4f7709a90906b03f4504deea1ff5c361e9f94b3f (cherry picked from commit f0d014a16b5c9b55245834459c46ea34d15d14be) Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* QThread: Fix link to snippet in documentationJonathan Liu2013-11-221-1/+1
| | | | | Change-Id: Ie27b3ae36dcf98cef4b612387aff448bc0421d29 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QLocale: Fix infinite loop in error caseEl Mehdi Fekari2013-11-201-5/+12
| | | | | | | | | | | | | | | QBBSystemLocaleData emits qwarnings when it fails to open or read a pps object. If the user code installs a message handler that will invoke QLocale API again (i.e QDate, QDateTime, ...) then this will cause an infinite loop, where the QBBSystemLocaleData ctor() is calling itself. This patch logs the QBBSystemLocale's warnings to stderr and skips the Qt message handler. Cherry-picked: qtbase/1e446fc99167a992b1a8342168b6254f43b097fe Change-Id: Iff99973532e0cba752854e325d0cd987765547d9 Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
* Threads: Fix mingw-gcc warning about 'cast to pointer from integer of ↵Kai Koehne2013-11-201-4/+4
| | | | | | | | | | | | different size' Use reinterpret_cast to convert from DWORD to pointer. Change-Id: I17a12940850aeb0bc27080725a18eb93fee72ff7 Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> (cherry picked from qtbase/edfdaba696d94206794203f9621d7e3aa8e5ab26) Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Kernel: Fix gcc warning in qsharedmemory_win.cppKai Koehne2013-11-181-1/+1
| | | | | | | | | | Fix gcc 4.7 'arning: converting 'false' to pointer type 'HANDLE {aka void*}' [-Wconversion-null]' Change-Id: I28d890d5fd4975517a9329d68c9ef73f6fadf36c Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> (cherry picked from qtbase/baf8a2fbf710314096832b0ee5735ffdc8b24210)
* qsimd: Fix compilation with MinGW 64.Friedemann Kleint2013-11-181-1/+1
| | | | | | Task-number: QTBUG-34856 Change-Id: Ie1dbeb5787e1a60aeaca585160319bbe0943e2cb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix MinGW-warnings about narrowing/invalid conversions.Friedemann Kleint2013-11-181-1/+1
| | | | | Change-Id: I9b49dd6d12a5e59c6f2674ab3c82a8a7ec583775 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* QObject: use per-thread storage for qFlagLocation()Marc Mutz2013-11-162-14/+28
| | | | | | | | | | | | | | | | | | | | | qFlagLocation() uses a global char* array to transport source location information from the connect() side to the metaobject side. The size of the array is 2 (two), which just about suffices for a single connect() statement. Obviously, if more than one thread makes a (_any_) connection at the same time, the data is useless and, worse, there's a data race. The non-reentrancy of qFlagLocations() cannot and need not be fixed, but use a per-thread flagged_locations array in QThreadData so threads don't disturb each other. Task-number: QTBUG-3680 Change-Id: If1797c60751f551694def69afee6fbe295bbe2d2 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> (cherry picked from qtbase/c012ee2940bc087720b4aa0d257540921cf9a139) Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QThreadPool: fix race at time of thread expiry.David Faure2013-11-152-18/+13
| | | | | | | | | | | | | | | | | | | | | | The current synchronization mechanism was racy: decrementing waitingThreads and then hoping that the wakeOne will wake a thread before its expiry timeout happens. In other words, on timeout, a just-assigned task would never run. And then no other task would run, if maxThreadCount is reached. Fixed by using a queue of waiting threads (rather than just a count), and by moving the wait condition into the thread itself, so we know precisely which one we're waking up, and we can remove it from the set of waiting threads before waking it up, and therefore it can determine on wakeup whether it has work to do (caller removed it from the queue) or it expired (it's still in the queue). This is reliable, whereas the return value from QWaitCondition::wait isn't reliable, when the main thread has already decided that this thread has work to do. Task-number: QTBUG-3786 Backport from qtbase/a9b6a78e54670a70b96c122b10ad7bd64d166514 Change-Id: Ic766ff67dea7a8bb8f1bc893943060ee5428d782 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QThreadPool: fix counting of waiting threadsDavid Faure2013-11-151-2/+8
| | | | | | | | | | | | | | | | | | | | QTBUG-21051 has a testcase where activeThreadCount() could actually end up at -1 (converted to an autotest in this commit). The reason was: start() calls tryStart() which returns false due to too many active threads (reserveThread() causes this), so it calls enqueueTask() - which actually wakes up the waiting thread, but it didn't decrement the number of waiting threads. Note that tryStart() is "if I can grab a waiting thread, enqueue task and wake it" while start(), in case tryStart() fails, wants to "enqueue, and then if I can grab a waiting thread, wake it". This is why enqueue shouldn't wake; waking must happen only if we can grab a thread (d->waitingThreads > 0). Task-number: QTBUG-21051 Backport from qtbase/dacf9961da86751a59da0e84bc943fe0d1c8d95b Change-Id: I1e437da27b733a72b48ff1b6f2b78f81a7ed129b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QThreadPool: fix data races in activeThreadCount()David Faure2013-11-151-5/+3
| | | | | | | | | | | | | | | | | | | | Rather than trying to make it lock-free (which requires double-bookkeeping of 4 atomic ints!), just lock the mutex before calling it. tst_bench_qthreadpool shows no difference whatsoever between the two solutions, I get 0.005 msecs per iteration in startRunnables(). Of course looping over calls to activeThreadCount() is a bit slower, from 0.0002 msecs per iteration to 0.00027 msecs, i.e. 35% more. But polling activeThreadCount() from the app is a really wrong thing to do anyway, this benchmark was just for my own curiosity about the price of a mutex in a function that sums up 4 ints. What matters is start() performance, which is unchanged (0.00007 msecs is just noise compared to a 0.005 total, that's 1.4%). Backport from qtbase/85b24bb2dea97c3a9b013bacd5a422b26fe5d14b Change-Id: Id32791069bc1e2dd61cef708d5287c9f9b7e5582 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QThreadPool: fix typosDavid Faure2013-11-151-12/+14
| | | | | | | | Task-number: QTBUG-31919 Backport from qtbase/37dc44d499884bd0d7ab9d2f1547db468c9fe53b Change-Id: I9496b059ed201da6b7a5ec02c4acb8f231e40c30 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* BlackBerry: Prevent superfluous removal of socket notifiersBernd Weimer2013-11-061-12/+11
| | | | | | | | | | | | | | | File descriptors have always been removed from bps before adding them, which lead to an annoying warning. "QEventDispatcherUNIX::registerSocketNotifier()" needs to be called after "ioEvents()" to prevent this. Back-port of qtbase/e9c51a1fdc9092e5589fd6f823ad0e704e293c88 Task-number: QTBUG-34536 Change-Id: I767a15cb2883bc820da5c858613ffb26abc002e4 Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com> Reviewed-by: Petr Nejedlý <pnejedly@blackberry.com>