summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Cherry-pick upstream patch for non-gcc/clang/msvc compilersv5.12.115.12.11Allan Sandfeld Jensen2021-05-183-4/+15
| | | | | | | | | Fix build w/ non-GCC-compatible Un*x/Arm compilers Fixes: QTBUG-93779 Pick-to: dev 6.1 6.0 5.15 5.12 Change-Id: Ib52e9ded6e2814c7998d6cd798e945da0f87f7a1 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Gracefully reject requests for absurd font sizesEirik Aavitsland2021-05-111-0/+6
| | | | | | | | | | | | Avoid overflows. Fixes: QTBUG-89899 Change-Id: Ic1a83c1704fe20be3d032358dc91ee8e751f2281 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit 679750684087cad7a48921c4174a53cdf4855049) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 781b55b24e190442d7e055a5e54e8acb44104519) Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Avoid overflowing QFixed in text layoutEirik Aavitsland2021-05-111-0/+3
| | | | | | | | | | Fixes: QTBUG-89172 Change-Id: Icb78c8eeb1dbe4c5d4c6476beebafc0115a91e8c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit 36ccbee34e89d185918a2925444dac11211e5c60) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit e071eb1302465bd2bd5873cbe407e7550a50a947) Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QVnc: clip requested screen region to available screen imageEirik Aavitsland2021-05-111-2/+3
| | | | | | | | | | | | | Avoid potential oob memory access. Fixes: QTBUG-91770 Change-Id: I34fff1cf8dec5275572a027288b0e8310359d9f8 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit c494c1e8754ed13b409133196d9db00bf7e0f2b5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 29b06697843851cd577cef7d69c428195cf08f4b) Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Update bundled libjpeg-turbo to version 2.1.0Eirik Aavitsland2021-05-1139-667/+1079
| | | | | | | | | | [ChangeLog][Third-Party Code] libjpeg-turbo was updated to version 2.1.0 Change-Id: I82a58609120923c18f6031fec7d597138ec473ee Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 127f617387c00139dddbfc9438ab032e24559566) Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Simplify bundled libjpeg buildEirik Aavitsland2021-05-114-2/+1
| | | | | | | | | | | | | | Move the config headers of the bundled libjpeg back into its source directory, where they originally live, to avoid having to trick with the include path to find them. The goal is unification across maintained Qt branches, making version updates simpler. Change-Id: I5b574446bbd264b0a1cb3efceb4c1cb7203cac7d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 5df88b85c6e61409c5c759e78f32edaac7b2022f) (cherry picked from commit 19fedbafb5efaf27765bc25677ee9295ec08dc06) Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Explicitly set input files for qtpreprocessChristoph Keller2021-04-121-0/+9
| | | | | | | | | | | | | This fixes build errors with Xcode 10. Xcode 10 build system (a.k.a "New Build System") needs to know the input files in order to build a correct dependency graph. Especially when a build is not run for the first time and files changed in-between. Task-number: QTBUG-71035 Change-Id: If8fbad3a1915add9b35c79131b03cdbe6b7ac06d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 8115219407fdbe7c01e97c76ccf3aa48b1fd8f78) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Only embed launch screen when building an appChristoph Keller2021-04-081-1/+1
| | | | | | | | | | | Xcode's new build system checks duplicated entries when building. Qmake wants to embed the launch screen for all types of configurations (static libraries etc.) which makes Xcode bail out with "Multiple commands produce LaunchScreen.storyboard". Task-number: QTBUG-71035 Change-Id: I5c028e687f16e046b12156c1a8a89540deba4d3b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 9c24ad3b94cb8c67468e947f02dd1f9aaf246085)
* Explicitly set output files for qtpreprocessNikolay Avtomonov2021-04-071-1/+7
| | | | | | | | | | | | | This fixes build error with XCode 10. XCode 10 build system (a.k.a "New Build System") requires all the files that are generated by scripts and used later on build to be explicitly defined as output files. Task-number: QTBUG-71035 Change-Id: Ibec39eee53b0cb3acecf592f1ca53c04b9975cad Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 3f0858ed10d249acb942597b4065080411281b87) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update bundled libjpeg-turbo to version 2.0.6Eirik Aavitsland2021-04-060-0/+0
| | | | | | | | | [ChangeLog][Third-Party Code] libjpeg-turbo was updated to version 2.0.6 Change-Id: I3e308d241853edf3c1d616955cda203220a258d8 Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit ede0082f861146d441df641d93f815dbe63a9076) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update bundled libjpeg-turbo to version 2.0.6Eirik Aavitsland2021-03-2326-150/+235
| | | | | | | | | [ChangeLog][Third-Party Code] libjpeg-turbo was updated to version 2.0.6 Change-Id: I3e308d241853edf3c1d616955cda203220a258d8 Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit ede0082f861146d441df641d93f815dbe63a9076) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid undefined color values in corrupt xpm imageEirik Aavitsland2021-03-121-1/+1
| | | | | | | | | Issue reported by Codechecker. Change-Id: I1a5aa2203fb31e0ce3b630a11e450925aee81fb0 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit f651e6a26cb59f7b7c7671cded8a10b9f98f5c71) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* xcb: unset old states and set new ones for windowLiang Qi2021-03-081-16/+33
| | | | | | | | | | This partly reverts a02959bb5b43a3f9d881e5213ceedf535202b6a1. Fixes: QTBUG-87078 Change-Id: I69e18ad3c0a8d142b2e1f5ab87990addc97d9df1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit f61b140482d9578c07410a5979379e44e05352e5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* xcb: fix thread synchronization in QXcbEventQueue::waitForNewEvents() againIgor Kushnir2021-03-053-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch amends a41701904e880f58e19b352ade1931d6cd1a7112 If peeking into the event queue looking for a clipboard event fails, QXcbClipboard::waitForClipboardEvent() calls queue->peek for the second time to "process other clipboard events, since someone is probably requesting data from us". QXcbEventQueue::peek() in turn calls QXcbEventQueue::flushBufferedEvents(). This second flushing can acquire a waited-for clipboard event. The issue was that the code in waitForNewEvents() ignored this possibility and assumed that there were no clipboard events before or at its current m_flushedTail. If there were no more events on the X11 connection after tailBeforeFlush, the waitForNewEvents() in waitForClipboardEvent() blocked execution for 5 seconds and eventually timed out. The fix is to remember QXcbEventQueue::m_flushedTail just after looking for and not finding a clipboard event in the queue. And then wait for more events via QWaitCondition in waitForNewEvents() only if there were no more events after the remembered m_flushedTail. Fixes: QTBUG-75319 Change-Id: I4919c5b9b9227b3a8a29a11e7094f97960b3a121 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io> (cherry picked from commit f2d22d5a5126e7a73da620a60847fc124f724333) Reviewed-by: Liang Qi <liang.qi@qt.io>
* Android: make calling exit() conditional on an environment variableVille Voutilainen2021-03-041-2/+3
| | | | | | | | | | Task-number: QTBUG-82617 Task-number: QTBUG-85449 Task-number: QTBUG-83043 Change-Id: I5ac67b5d57550e5a1f816e5db01f4aab31127283 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 6e0ce4ee8005d36ee5d080212b8d83b42ebcae17) Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
* Avoid int overflow in QImage rotate90/180/270Eirik Aavitsland2021-02-241-11/+16
| | | | | | | Fixes: QTBUG-91223 Change-Id: Ice53c80d695a5ffdf9162df84e7c9b1e43106bae Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 8daa94431341afece6beb052e6224d215f8507b7)
* Blacklist failing tests on macOS 10.14Morten Johan Sørvig2021-02-182-0/+3
| | | | | | | | | | | These tests fail locally, and have been reported to fail on the CI system. Change-Id: Ia76bb15c288af4171ebe47b3c30f3651a63df3f2 Task-number: QTBUG-75786 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 17affdfbcbb1774dd71782d63889689909fb4bff) Reviewed-by: Liang Qi <liang.qi@qt.io>
* QSslCertificate: Guard against accessing empty QByteArrayRobert Loehning2021-01-111-1/+3
| | | | | | | | | Fixes oss-fuzz issue 29276. Change-Id: I57b0c26e5377bd6b82d9f044ae1d1d13acec996a Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit ce90248882b73b4b816a8550710279e3e55ab64c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QSslCertificate(OpenSSL) - harden protection against nullpointersTimur Pocheptsov2021-01-071-2/+25
| | | | | | | | | | | | An invalid (as input data) certificate may have non-zero number of invalid (nullptr) extensions (if OpenSSL failed to parse them, for example). Fixes: QTBUG-89547 Change-Id: I4b93ac9f482f850f02d01b0aea10560dc11b688d Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de> Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit f31997448838902eb5237b567f0c80f423f2406e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QStandardPaths: Don't change permissions of XDG_RUNTIME_DIRAlexander Volkov2020-12-312-40/+37
| | | | | | | | | | | | | | | | | | Conform to the XDG Base Directory Specification: "If, when attempting to write a file, the destination directory is non-existent an attempt should be made to create it with permission 0700. If the destination directory exists already the permissions should not be changed." At the same time the spec states about XDG_RUNTIME_DIR that "its Unix access mode MUST be 0700", so don't consider the directory with wrong permissions correct and use a fallback. Task-number: QTBUG-68338 Change-Id: I03c6b35b3f7d5ceb8e6326695bfc8207da92ea67 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit 68de00e0d4f2c574162a6e033d41786e3757d25d)
* Android: KEYCODE_MEDIA_PLAY_PAUSE translated rightPiotr Mikolajczyk2020-12-211-1/+1
| | | | | | | | | | | KEYCODE_MEDIA_PLAY_PAUSE was incorrectly translated to Qt.Key_MediaPlay. This patch changes it to Qt.Key_MediaTogglePlayPause. Fixes: QTBUG-66448 Change-Id: Icd2747857bc479228bfdffcd8ab8fdef7b79e918 Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit 096b4590d5aefc16b9c68611fdc1463b4c173f80) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QStandardPaths/Unix: improve the XDG_RUNTIME_DIR creation/detectionThiago Macieira2020-12-073-88/+330
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | First, use QT_MKDIR instead of QFileSystemEngine::createDirectory(), as the latter can't create a directory with the right permissions. That would allow an attacker to briefly obtain access to the runtime dir between the mkdir() and chmod() system calls. Second, make sure that if the target already exists that it is a directory and not a symlink (even to a directory). If it is a symlink that belongs to another user, it can be changed to point to another place, which we won't like. And as a bonus, we're printing more information to the user in case something went wrong. Sample outputs: QStandardPaths: runtime directory '/root' is not owned by UID 1000, but a directory permissions 0700 owned by UID 0 GID 0 QStandardPaths: runtime directory '/dev/null' is not a directory, but a character device, socket or FIFO permissions 0666 owned by UID 0 GID 0 QStandardPaths: runtime directory '/etc/passwd' is not a directory, but a regular file permissions 0644 owned by UID 0 GID 0 QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-tjmaciei' QStandardPaths: runtime directory '/tmp/runtime-tjmaciei' is not a directory, but a symbolic link to a directory permissions 0755 owned by UID 1000 GID 100 Change-Id: Iea47e0f8fc8b40378df7fffd16248b663794c613 Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit ad5a65b6a2bfca1658634e380559d14ea1e904a4 plus a lot of others) Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Android: Kill calls to deprecated func in API 29Piotr Mikolajczyk2020-12-071-56/+8
| | | | | | | | | | | | | | | | | Since API 29 functions: - getExternalStoragePublicDirectory - getExternalStorageDirectory are deprecated and no longer return directly accessible path. This patch replaces calls to those with suggested call to Context.getExternalFilesDir(String) Task-number: QTBUG-87803 Change-Id: I36bc5d5b72a80017996445af0d577aacf5e112d3 Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit e1440dd7bc1a5da9a536f88b9733d04ec8fa6e61) Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Fix QImage::setPixelColor on RGBA64_PremultipliedAllan Sandfeld Jensen2020-12-042-4/+9
| | | | | | | | | QColors were not premultiplied before being set. Change-Id: Id3765b6932a72374ddfd788fae4bb628a4edf0b7 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 0c19e3f703a7c3fd59e6db8a9d4ac7091674b552) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* widgets: Avoid crash in QScrollerFabian Vogt2020-12-041-1/+2
| | | | | | | | | | | | | | | | | Quoting c6a32751 in okular[1]: QScrollerPrivate::setDpiFromWidget() before Qt 5.14 crashes when the target widget does not intersect a physical screen, because QDesktopWidget returns screen index `-1` in this case, which leads to an out-of-range read from QApplication::screens(), which leads to a segfault when reading from an invalid QScreen* pointer. [1] https://invent.kde.org/graphics/okular/-/commit/c6a32751 Fixes: QTBUG-88288 Change-Id: Ia572bf0207aa6d8ca2a209d22daa36b962e6de7d Reviewed-by: Fabian Vogt <fabian@ritter-vogt.de> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Cosmetic stroker: avoid overflows for non-finite coordinatesEirik Aavitsland2020-12-011-0/+2
| | | | | | | | | | | | | | | int overflows are usually avoided by clipping the qreal coordinates to the device rect. However the clip function did not handle inf or nan coordinates, so such values would be passed on. Fix by treating any line with such coordinates a fully clipped away, i.e. rejecting it, since it cannot be meaningfully stroked anyway. Fixes oss-fuzz issue 25330. Change-Id: I4646172fc7a7e0a3a5f5cf03ce10ff0fb56b0d03 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Robert Loehning <robert.loehning@qt.io> (cherry picked from commit cfad8a352ae151dd413af1bdea08e25d56309963) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Containers: call constructors even for primitive typesGiuseppe D'Angelo2020-12-013-25/+16
| | | | | | | | | | | | | | | | | | | | | | | | | Trivial types are automatically classified as Q_PRIMITIVE_TYPE, but it doesn't mean that they can be initialized with memset(0) (notably, pointers to data members on Itanium ABIs are initialized with -1, not 0). Drop that kind of optimization, and always value-initialize objects in containers. Fix the documentation to match as well. This is a rework of f6f68409a40beaa5f034c411dd7e296c7828d8fd and 82b13880b994ff9b87710e0729e32035ab3b63a4 in Qt 6. [ChangeLog][QtCore][QTypeInfo] The semantics of Q_PRIMITIVE_TYPE have been slightly changed. Qt now value-initializes types marked as primitive (which, by default, include trivial types) instead of simply using memset(0), which is wrong in some corner cases. Change-Id: Ib61396be883424e2f03a9f3bbce1eaddce6aa731 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 76671a57b5418ec98fe2c94a963728ac3306dc82) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QMacStyle - remove vertical adjustment for inactive tabTimur Pocheptsov2020-12-011-2/+0
| | | | | | | | | | While it worked as expected with beta, with final release this thing looks wrong again, especially in the dark mode. Change-Id: I6857344de897e0f39d9d8e66431635dbe2f4d077 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit abee4cdd5925a8513f51784754fca8fa35031732) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Let QXcbConnection::getTimestamp properly exit when X server quitsSheng Mao2020-12-011-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | QXcbConnection::getTimestamp uses dummy events to get timestamp from X server. However, in some cases, X server shuts down while client tries to get timestamp. In this case, QXcbConnection::getTimestamp keeps getting null event and thus falls into indefinite loop. This fix checks if xcb connection is still valid and use a special xcb_timestamp_t value, CurrentTime (0L), as returned value. CurrentTime should not be generated by X server and if getTimestamp returns this value, it means an "exception" case is triggered. This fix is introduced because in kwin_x11 (KDE project), X server can exit on logout. kwin_x11 should handle disconnection from X server. But the indefinite loop prevents kwin_x11 to process disconnection event and therefore kwin_x11 cannot quit properly. Fixes: QTBUG-88435 Change-Id: Iaf7ef3f8a35fa8389d22a608e3c49041bf90e1b9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit dbd1c8b047700bb6d0adae848d6cbb89fa2fcfff) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Limit pen width to maximal 32767Allan Sandfeld Jensen2020-11-271-4/+7
| | | | | | | | | Fixes oss-fuzz 25195 Change-Id: I8c68cf71f6702d8b1b1a2ddda3284c14f02d7972 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit c7a335817e909951bfd142018f855645b4a46168) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Limit value in setFontWeightFromValue()Robert Loehning2020-11-241-1/+1
| | | | | | | | | | | QFont::setWeight() just accepts values between 0 and 900 anyway. Fixes: oss-fuzz-24986 Change-Id: Ic65139a7821be3a12c65444d010736f03c8b74f5 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit ccc205bf38ffbe60180a069939a4aff01e7734e5) Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QStackedLayout: fix a memory leakGiuseppe D'Angelo2020-11-231-1/+3
| | | | | | | | | A layout takes ownership of the QLayoutItem passed to addItem. Change-Id: Iea3c64453f3cbf4f1b5660e505c1a35dca537833 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 1fcc882d7ca564f17e49b8d51adc43eb5b97c57b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid integer overflow and division by zeroAllan Sandfeld Jensen2020-11-231-3/+3
| | | | | | | | | | | | Restrain patterns to sensible lengths and values. [ChangeLog][QCosmeticStroker] Pen patterns are restrained to a maximum length and values of 1024, fixing oss-fuzz issue 25310. Change-Id: If062f8336ff5ad113258391b0d70b8ac6f42c4b3 Reviewed-by: Robert Loehning <robert.loehning@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit 1ff25785ff93d0bd3d597e3a65a261bdbfa13c3b)
* macOS: Upgrade supported SDK to 11.0Tor Arne Vestbø2020-11-231-1/+2
| | | | | | | | | | | | Testing seems to indicate building against the 11.0 SDK works fine, and doesn't opt in to any new behaviors on Big Sur that Qt isn't ready for. Change-Id: I7da11cf25f2be7443c94ba7a4e9cd99dc1034455 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit a07c9a1a70ce755140dd31f55c6acd72270f4ddd) Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Doc: explain how to create a test touch device for use with touchEventMitch Curtis2020-11-201-1/+7
| | | | | | | Change-Id: Ib60eb0754449da7c50f8632ebd5228ddbe8389f1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 5861e06568c44c58aecacdf26fd7938240348956) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Propagate device-pixel-ratio of system tray iconTor Arne Vestbø2020-11-201-0/+1
| | | | | | | | | | | | | | | | | When preparing a system tray icon on a system with a retina screen, we end up creating a full-height icon of height 44. If there's also a 1x screen available, macOS will scale down this image for us when presenting the icon on the 1 screen, but the downscale will fail to preserve the aspect ratio of the original image on Big Sur. Telling macOS which device-pixel-ratio the image has seems to fix this, and is the right thing to do in any case. Fixes: QTBUG-88600 Change-Id: Ic31def94d073da1b256bbfcaf5905f92c169f43d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit a6aaa2b7071b7666a807b450dc5738742f3cc9e0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* widgets: Don't report new focus object during clearFocus() unless neededTor Arne Vestbø2020-11-201-6/+7
| | | | | | | | | | | | | | | We do not unconditionally clear focus_child like the existing comment said. We only do it if the focus_child was the widget that is clearing focus. So in many cases we'll end up with the same focus object as before. We can not report that as a focusObjectChanged to the window, as that will potentially trigger a reset or cancel of the current input method for the (unchanged) focus object. Fixes: QTBUG-86976 Change-Id: I54367e46eda7a94d967f58960bd926c195dc09cc Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 7d5ba1c17ecbb620731ff7322fd278c3ce496dad) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Account for Big Sur always enabling layer backed viewsTor Arne Vestbø2020-11-191-2/+9
| | | | | | | | | | | | | | | | | | | | Previous versions of macOS (Mojave and Catalina) enabled layer backing only when the application's build SDK was 10.14 or above, to provide an opt-out workaround for applications that were not ready for layer backing. This seems to no longer be the case, as Big Sur will enable layer backing regardless of the SDK version used. Tested by passing -Wl,-sdk_version -Wl,10.13 -v -mlinker-version=519 during linking, to simulate what the effects of linking to the 10.13 would be. Also confirmed by real-world use of the 10.13 SDK via Xcode 9. Change-Id: I867edc001b6709ba0ad0fd70918bd9b77d317cf8 Fixes: QTBUG-87014 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 2cae34354bd41ae286258c7a6b3653b746e786ae) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* xcb: Avoid use-after-free in QXcbConnection::initializeScreens()Alexander Volkov2020-11-181-2/+4
| | | | | | | | | | | | Extend the scope of the resources variable to avoid its destruction while it's still in use. Fixes: QTBUG-88512 Change-Id: I3298aabc871ff455bd1203ec276e7600d3e151ef Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 86b8c5c3f32c245795e9eab2a74e4b6982e5a496) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QRectF/QPointF/QSizeF: document that operator== and != are fuzzyGiuseppe D'Angelo2020-11-183-8/+37
| | | | | | | | | | | This has been the case for a _very_ long time, and I can't believe this hasn't been documented anywhere. Change-Id: Ib157edf14e87a6f546c155496f70a760ab218cca Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit cca62a7360a117880eea5821fd7403d68a1431c8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QMutex: order reads from QMutexPrivate::waiters and QBasicMutex::d_ptr in ↵Alexander Kartashov2020-11-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QBasicMutex::lockInternal() Threads that unlock and lock a mutex at the same time perform the following operations: Thread 1 Thread 2 -------- -------- QBasicMutex::lockInternal() QBasicMutex::unlockInternal() d_ptr.testAndSetOrdered(..., d) d = d_ptr.loadAcquire() d->waiters.loadRelaxed(); (1) d->waiters.fetchAndAddRelease() (2) d_ptr.testAndSetRelease(d, 0) (3) d->derefWaiters() (4) d->waiters.testAndSetRelaxed(...) (5) if (d != d_ptr.loadAcquire()) (6) d->wait() The operation (1) isn't serialized with the operation (6) so its memory effect may be observed before the effect of the operation (1). However, if memory effects are observed in the following order: (6) -> (1) -> (2) -> (3) -> (4) -> (5) then Thread 1 doesn't notice that Thread 2 updates d_ptr and goes to sleep with d pointing to a stale object, this object isn't reachable since d_ptr is zeroed so Thread 1 cannot be woken up. The patch adds the "acquire" barrier into the operation (1) so that it cannot be reordered with the operation (6). Fixes: QTBUG-88247 Change-Id: I1d0c405c0bf5080ec1815d351b9b4b75efeab21a Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit d08e3b6de16118becaada17a58aed4042f400a5a)
* Link to qAlpha in qRgb() and qRgba() docsMitch Curtis2020-11-180-0/+0
| | | | | | | Change-Id: I5a3b8573123e82f4c8c92fa7a2e1af06e2e84eb2 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> (cherry picked from commit 418389c3ed925b2da3538d808ceeb53727978a8c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix x-height name in stylesheet docsFlorian Bruhin2020-11-181-1/+1
| | | | | | | | | | | | The *height* of an x being called "ex width" makes no sense. Also, it seems like this measurement is typically called "x-height" rather than "ex height", see e.g. https://en.wikipedia.org/wiki/X-height Change-Id: Id8e2c1aa9be1a4a60e667a076486777d34f1e76d Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit befa3729db0d1010694bd1bb4cbadd36ff5c49fb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QMacStyle: fix tab widget renderingTimur Pocheptsov2020-11-111-2/+83
| | | | | | | | | | | | | | This patch-set combines two recent patches for Big Sur (hiding 'disclose' button on a NSPopUpButton) and adjusting for (now) visible button's round corners. Since it makes little sense to only partially fix the thing, we also backport another change (not so recent, missed 5.12 in the past) that corrects clipping (where we are trying to cut NSBox'es frame, which otherwise is semi-visible through semi-transparent buttons in the 'Dark' theme). Task-number: QTBUG-86513 Change-Id: Ieea5a47ba3073eb564594039895cf70a0a34e7be Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Q_PRIMITIVE_TYPE: improve the documentationGiuseppe D'Angelo2020-11-101-2/+3
| | | | | | | | | | | | | | A key piece of information missing from Q_PRIMITIVE_TYPE documentation is that for them value initialization must equal memset()ting with zeroes. A type like QPoint is primitive because `QPoint p;` is initialized to (0, 0), but a type like QSize is movable (and NOT primitive) because `QSize s;` is actually initialized to (-1, -1). Amend the docs. Change-Id: I121684810da46be5d0579c7d3de945149390a32a Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit b8b75cdcfa71189c7726607be7b66d0ddeaae372) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Bump versionJani Heikkinen2020-11-061-1/+1
| | | | Change-Id: Ia07ff236f308c6256507900836ffc38f5e64094f
* macOS + FreeType: fix crash with non printable unicodeAnton Kudryavtsev2020-11-051-1/+4
| | | | | | | | Task-number: QTBUG-84096 Change-Id: Ia60b7094ef9e82cf24f5a8b7995000ae65bb379a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit ebfd0b14aadc8d7e1415fa6a698038dffd251cb0) Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
* Revert changes in strto(u)ll.c to avoid integer overflowsRobert Loehning2020-11-054-25/+36
| | | | | | | | Found in oss-fuzz issue 26045. Change-Id: Id9eac1b4f67ad9bbe2d92dd69cd03338a6ced74e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 2096400d6e8249e49df049f9600073fb2219c97a)
* Fix gui build without feature.highdpiscalingTasuku Suzuki2020-11-021-0/+2
| | | | | | | (cherry picked from commit b75e6e00b7c41b46179b69b0f1bcfc8d497cb59b) Change-Id: Ic206cb6fa1b9fae1db9923ef6596852e93b3cbe5 Fixes: QTBUG-87659 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Add changes file for Qt 5.12.10Antti Kokko2020-10-281-0/+109
| | | | | | | Change-Id: I49118e7699a158bc799aee3005ccdb740916d887 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit d43c6f1bada49b8c0a90feb96a7b8297f9f1ab05) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>