summaryrefslogtreecommitdiffstats
path: root/src/gui
Commit message (Collapse)AuthorAgeFilesLines
* Fix QScreen orientation not being updated when setting a platform screenFriedemann Kleint2020-10-291-3/+3
| | | | | | | | | | | | ScreenPrivate::updatePrimaryOrientation() depends on the geometry being set which is calculated by updateHighDpi(). Move the call up. Amends 370289bef68d8505b66cb27150a3f596e23c5ed3. Pick-to: dev 5.15 Task-number: QTBUG-76902 Change-Id: I8188e04ad4a2ef7d414a2b78ecb3dd6c64528fa6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix to make g++-10.2 happyAndreas Buhr2020-10-221-0/+2
| | | | | | | | | | | | | | | g++-10.2 fails to compile qregion.cpp in RelWithDebInfo configuration, with error message: qregion.cpp:3617:12: error: ‘ET.EdgeTable::ymax’ may be used uninitialized in this function [-Werror=maybe-uninitialized] g++ is right here, for Count==1, 'ET' is not initialized but used. This patch fixes this by Q_ASSUMEing Count > 1. Change-Id: I3b9f1f58de9f3811c60640a08334487e3f8f2b23 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit dd0647b17aa43bccf36285285ecccb54f18176ad) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use valid glyph index for box font engineEskil Abrahamsen Blomfeldt2020-10-211-2/+2
| | | | | | | | | | | | | | | | | | Glyph index 0 is reserved for "glyph not found", which can confuse Harfbuzz. For QFontEngineBox we always return a valid glyph since it is the fallback font when no other fonts are available. Symptom of issue was that we could get to Q_UNREACHABLE for certain strings when Harfbuzz returned a glyph count of 0. [ChangeLog][QtGui] Fixed a potential crash when rendering text with an empty font database. Fixes: QTBUG-85016 Change-Id: Iaf1d003cdff57320bf4327aa8e63dffd9d1da82c Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 05078459de5dae65b9bb7cf2a1bc216528291648)
* rhi: Add missing \internal doc commandsTor Arne Vestbø2020-10-181-0/+3
| | | | | | | Change-Id: I09a69a04c6fcd406602e797cbeec59216fecd5d8 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit 71ad83529e7d2c7828e027666f24470cf86db63e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix compilation with optimization with g++-10.2Andreas Buhr2020-10-161-0/+3
| | | | | | | | | | | | | | | When compiling in RelWithDebInfo configuration with g++-10.2, it complains: qtbase/src/gui/painting/qdatabuffer_p.h:71:36: error: argument 1 range [18446744065119617024, 18446744073709551612] exceeds maximum object size 9223372036854775807 [-Werror=alloc-size-larger-than=] This patch disables this warning in this place. Change-Id: Id3154ce80a1921671031828aaa7144214adad5dd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit df8489816b455f43c0fa31924306523fdf3e1898) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fallback to using the family when doing an exact matchAndy Shaw2020-10-131-6/+23
| | | | | | | | | | | If the difference between the families sizes is just 1 where one of them is 0 in size then we can fallback to the family in that case. Fixes: QTBUG-87267 Change-Id: I62b25b06c88000b4d7defe91871c07873b1fc792 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit bdc9d272eebff66827b566b1b24b6697c797807a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Protect QImage work on shutdownAllan Sandfeld Jensen2020-10-124-6/+6
| | | | | | | | | | If the thread pool was not created, or already deleted, make sure the QImage routines can still run as they could before. Fixes: QTBUG-87320 Change-Id: I4105a68b6ae0637faf82cdda5f5ae44298759396 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit 0aa8925f1acd47cadc71483cac97d202444d15db)
* Avoid heap-buffer-overflowRobert Loehning2020-10-121-1/+1
| | | | | | | | | | [ChangeLog][QCosmeticStroker] Avoid a heap-buffer-overflow found by oss- fuzz as issue 25243. Change-Id: I36112f183241679e172ad1ee531e1b929d6f3815 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit 1d778a59f781ecf822c9e3f7777b680fea2c4e62) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Make the named QColorSpace constructor thread-safeAllan Sandfeld Jensen2020-10-101-5/+24
| | | | | | | | | | | Avoid accessing the shared pointer table without using atomic. Cleans up the shared table on exit for leak tracking utilities. Change-Id: Ia2d6d79dea1c8be02bae2d8111e290f49eedf409 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> (cherry picked from commit cd0b5bba9a1a76e03d4b9b5105c4d16d1e1dfd1e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* End touch->mouse synthesis when the chosen touchpoint is releasedShawn Rutledge2020-10-061-23/+25
| | | | | | | | | | | | | | | | | During delivery of a TouchBegin event, if no widget accepts it, we begin treating the first touchpoint as a synth-mouse, as before. If a second touchpoint is pressed or released in any order, it's irrelevant: the fake mouse button is released as soon as the first touchpoint is released. This fixes the bug that such a scenario caused the mouse release not to be sent, so that a widget could get "stuck" in pressed state. Done-with: Tang Haixiang <tanghaixiang@uniontech.com> Fixes: QTBUG-86253 Change-Id: I7fbbe120539d8ded8ef5e7cf712a27bd69391e02 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit f51e6552e361c0716f6301b4c5b03b12e8bfe0fe) Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Doc: Qt GUI: Depend on qtprintsupport documentation moduleTopi Reinio2020-10-051-0/+1
| | | | | | | | | | This adds 'Inherited by:' links to print support classes deriving from Qt GUI types. Task-number: QTBUG-77126 Change-Id: I84ecee5df8cae0635d42653b1483db6b3c6074ee Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit fc141be890f265db41a0143f49e9b62537a069aa)
* Ignore mouse events where globalPos contains NaNSteffen Kieß2020-10-021-0/+5
| | | | | | | | | | | | | | | A NaN value in globalPos can cause an endless recursion in QGuiApplicationPrivate::processMouseEvent() when e->enhancedMouseEvent() is true and this is not a move event. When an event contains a NaN in globalPos, print a warning and ignore the event. Fixes: QTBUG-86207 Change-Id: I8789e465921789569715e52c98193f91945ea982 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 63bbbdc4b8dba7be5690065dc6a4ffa5a85b1b32) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Do not assert on invalid ICC curv tableAllan Sandfeld Jensen2020-10-022-17/+35
| | | | | | | | Reject invalid table data, do not assert it. Change-Id: I1fdda4c735bb97bb93ac8f8654ac4cc5fada5389 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit e750fa8509d350cbbcddc81174516745f6ffe9f3)
* Emit QScreen::geometryChanged when the logical DPI changesFriedemann Kleint2020-10-012-6/+11
| | | | | | | | | | | | | | | | | | | | | Add the missing call to QScreenPrivate::emitGeometryChangeSignals() along with an emission of physicalDotsPerInchChanged() since that is calculated from geometry and physical size. Rearrange the code in QGuiApplicationPrivate::processScreenGeometryChange() to prevent duplicate emissions of geometryChanged(), physicalDotsPerInchChanged() which this change would introduce. Amends 5290027e3bab75f14fc0a2b7c206594d9cb91e76. Task-number: QTBUG-76902 Task-number: QTBUG-79248 Fixes: QTBUG-86604 Change-Id: I3dc2ec5ccd9c6413e92f9246242f323e8afc5e57 Reviewed-by: David Edmundson <davidedmundson@kde.org> (cherry picked from commit 5c7307775d32ae0a54acad8ae7a1c9d3cff7d45e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid heap-buffer-overflowRobert Loehning2020-09-251-0/+2
| | | | | | | | | | [ChangeLog][QOutlineMapper] Avoid heap-buffer-overflow Fixes: oss-fuzz-24615 Change-Id: Ia67e1fb830850d04f068d8b5c009687f3deff156 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 74146e0102d367c5e7a3567ad6bf8a46548d55de) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QFontEngine: Do not call getSfntTable with uninitalized valueChristoph Schleifenbaum2020-09-241-2/+2
| | | | | | | | | | | On FreeType font engine this results in a call to FT_Load_Sfnt_Table with a pointer to an uninitialized value passed in as FT_ULong* length, crashing. Instead initialize value to 0. Pick-to: dev Pick-to: 5.12 Change-Id: I50d6df3b2296a05640d939e862bc50adb0fec921 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* xcb: add xcb-util dependency for xcb-imageLiang Qi2020-09-221-2/+12
| | | | | | | | | | xcb-image includes xcb_aux.h, which is part of xcb-util. Fixes: QTBUG-86287 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Change-Id: I253308008c5baeb1d061ef19f516ae6ab6dff52c (adapted from commit 39b1dea2ec5cde9523df61c78dec5d4b195f66d2) Reviewed-by: Liang Qi <liang.qi@qt.io>
* xpm handler: fix read error caused by off-by-one in overflow checkEirik Aavitsland2020-09-181-2/+2
| | | | | | | | | | | | | | The recently introduced overflow check for 8 bit images was too aggressive, causing the last pixel on each line to be rejected. As a driveby, add the same (fixed) overflow check also for 32bit images. Fixes: QTBUG-86691 Change-Id: I62e4d5884e314f1171cb5a3e2c48657ce7259676 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 6f2c7469f86785e6ba81fe0280210ef7275099de) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QIcc: fix alignment concerns in ICC profile parsingAndrei Golubev2020-09-182-86/+103
| | | | | | | | | | | Updated QIcc::fromIccProfile() and friends to not rely on QByteArray pointer alignment. Used qFromUnaligned() instead Task-number: QTBUG-84267 Change-Id: I69ef7e011707bec27cd84693e7f0e92d79a577d1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit d423fe985137be1283c0998f54b6ba307a8cf923)
* Fix deprecation documentation about margin and orientation in QPrinterÖmer Fadıl USTA2020-09-172-5/+5
| | | | | | | | | There were a small typos about those methods and fixed with correct ones. Fixes: QTBUG-86635 Change-Id: Ib853e502fdcdafdf3ddf7ef6d25d368ebc2a631f (adapted from commit 8d8b271fe9cd838f2975392ca9856ac19803f0b6) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix documentations string in QPagedPaintDeviceNicolas Fella2020-09-121-1/+1
| | | | | | | | | pageLayout().pageOrientation() does not exist, but pageLayout().orientation() does. Change-Id: I17a667b18aba284b91972422e604568e2fdbda05 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 89c65bc8f7e4c9ab8198fba08eb1ef6f7f5184d2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix build with -trace lttngJoerg Bornemann2020-09-111-1/+1
| | | | | | | | | | | | | Fix superfluous space in qtgui.tracepoints and make tracegen more lenient towards unknown types (the ETW implementation outright ignores those). Fixes: QTBUG-86546 Change-Id: I71cc323afa1009dbaefe20e55818ecb6c0b09c59 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Milian Wolff <milian.wolff@kdab.com> (cherry picked from commit 756c65d3676d2b3ce5c7b56145e5f0f7cf7178ad) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* When finding the engine for a fallback font, then clear the familiesAndy Shaw2020-09-061-0/+1
| | | | | | | | | | | | If it is a fallback font, then it should just have family set to that font so it does not get interference from what the families were originally set to. Fixes: QTBUG-85560 Change-Id: I6232f3d2ae12052fa3b0b3bc0e7f106e239a585d Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit 973a795bec836be88eb1d19657dfad26b9aa959f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Mark obsolete QPrinter functions as deprecated from 5.15 onVolker Hilsheimer2020-09-033-5/+24
| | | | | | | | | | | | Some of the methods are overrides of virtuals in QPagedPaintDevice, so document and mark those as obsolete as well. Adjust code that calls those APIs to use the recommended replacement. Change-Id: I3cd1980609ea20808d17379a5f97ca595e869875 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 6bbf3f0257603eb39d5511910e8bee1ed862b6cf) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QTextHtmlParserNode: Fix warnings flood about setting negative pixel sizeFriedemann Kleint2020-09-021-1/+2
| | | | | | | | | | | | Exclude the default value (-1) from the check. Amends 0bd770fb875d5391dd78df95542c25bd15051938. Change-Id: Ib98ae166fd5fdab546c5d4212ce78345b5c9b583 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit d23c118fd4b733b60bb41ee07c6a91d914afd129) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid overflows in variantHash()Robert Loehning2020-08-281-2/+2
| | | | | | | | Fixes: oss-fuzz-24702 Change-Id: I876bac9e2c276693e59802dfeeea2229a873ee34 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit e0da5159dc4f53fcf725ef6e3aa4e04862bcbae0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QTextHtmlParserNode: Avoid extreme values for font's pixelsizeRobert Loehning2020-08-281-0/+1
| | | | | | | | | | | They currently cause an integer-overflow in variantHash(). Fixes: oss-fuzz-24702 Change-Id: Ibee4413ca766c8ade9aeff2f2052b82cb9f7d213 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 0bd770fb875d5391dd78df95542c25bd15051938) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Manually initialize TextureOp and BufferOp structsEirik Aavitsland2020-08-271-7/+21
| | | | | | | | | | | As a workaround for broken compilers, this reverts commit 66876da1fd18a037c613639a552001ee87e68a7a and implements the initialization explicitly instead. Task-number: QTBUG-86210 Pick-to: 5.15.1 Change-Id: I0190c7bf90d52448d25f74f8abac40824b23a59c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QPixelFormat: Fix warning about mixing different enumsMarcel Krems2020-08-231-14/+14
| | | | | | | | | warning: C5054: operator '+': deprecated between enumerations of different types Change-Id: If111b076914667fb149e62e051f52f408db9a338 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit be83b626d736c3b8e58b3e22a02774acbc2fdb10) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qwsi: revert parts of 00ae1e6b7bf6efa5f5e57d37844e44d521604fb6Gatis Paeglis2020-08-232-24/+2
| | | | | | | | | | | | | | We actually do not need this "mode" in qwsi API. I think while writing the patch from 00ae1e6b7b I got confused by focusing on my test application. We can't know what the native event filter will filter out, therefore it makes sense that we unconditionally do filtering at qwsi level as well for user input vs other events in QWindowSystemInterface::sendWindowSystemEvents(). Change-Id: Idb23152a24bf3ba3b91804427a6e78f991969c29 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 7318328c2d658f6ca2e9443c6e3e3b0a179e9811) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Properly deprecate Qt::MidButton in favor of Qt::MiddleButtonEdward Welbourne2020-08-221-1/+1
| | | | | | | | | | | | | MidButton had its // ### Qt 5: remove me upgraded to Qt 6 at 5.0; but it dates back to 4.7.0 Replace the many remaining uses of MidButton with MiddleButton in the process. Change-Id: Idc1b1b1816673dfdb344d703d101febc823a76ff Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 16e546e32fec393bc3b126f280114bcbfa7151ff) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Allow smooth curve stroking for very wide linesEirik Aavitsland2020-08-211-1/+5
| | | | | | | | | | | | | | | The earlier limit set on the curve threshold turned out to be too strict, leading to visibly bad rendering in reasonable use cases. Ref. 5322998a0ba80b1e095340245ddb00aaf5947be9 As a drive-by, add a missing fixed-to-real conversion. (This is a no-op in a default build, where qfixed==qreal.) Fixes: QTBUG-85193 Change-Id: I7cc3543d7aa4e90643b275686372400879decef2 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit 4db44bc32f9a08e89391aa3d99a01060a4f10737) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QGuiApplication: fix handling of spontaneous events' modifiersNicolas Guichard2020-08-202-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | QtQuickTest synthetized events can have modifiers, but those modifiers were not accessible globally, from QGuiApplication::keyboardModifiers for instance. eg. calling QML's TestCase::mouseClick with modifiers triggering a call to QGuiApplication::keyboardModifiers did not give the expected result. QtTest synthesised events can also have modifiers and those were correctly handled by QApplication to set modifiers globally. This fix moves the handling code from QApplication::notify to QGuiApplicationPrivate::maybeSimulateModifiers and calls this function from QGuiApplication::notify too. The definite fix would be to do as suggested in the comment attached to the moved code: > Qt Test should not call qapp->notify(), but rather route the events > through the proper QPA interface. This is required to properly > generate all other events such as enter/leave etc. Change-Id: I734e5bbc82232b13828b1a1f82e06ee8eb695417 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 4b1ffab8ad95eda737fde015c243442a28de8e23) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* rhi: d3d11: Enable setting xxxColor as an alpha src/dst blend factorLaszlo Agocs2020-08-191-11/+17
| | | | | | | | Fixes: QTBUG-86111 Change-Id: Iabcf1708ea65e9f05f39caf9df9b45c25ac5dbb8 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 2da2e24bbc9511776c0d4ad5c60d0de5dff54e4b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QBezier: Don't try calculating a unit vector when length is nullRobert Loehning2020-08-191-0/+2
| | | | | | | | | It's undefined and causes a division by zero. Fixes: oss-fuzz-24273 Change-Id: I3d34d5c43cccff9255abaf87af265ddea3fe6d95 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 7fa5fdae5c4f4c83acb74ff8cd65eacfa567a727)
* Update QHighDpiScaling on DPI changeMorten Johan Sørvig2020-08-192-0/+4
| | | | | | | | | | | | | | | Make sure Qt reacts correctly to DPI changes while the application is running, also when going from “standard-dpi” to “high-dpi” (like Windows 100% to 200%). Call QHighDpiScaling::upateHighDpiScaling() on DPI change and update the m_usePixelDensity flag from there. Fixes: QTBUG-85384 Change-Id: I8ca83e4eea76cc8ba701a18e1f8c535b9953918f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 733b65384468374d781455763a4dd32887b32626) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* High-DPI: Use correct DPI for QT_USE_PHYSICAL_DPIMorten Johan Sørvig2020-08-191-1/+3
| | | | | | | | | | | | | | | | | | Setting the QT_USE_PHYSICAL_DPI environment variable will make Qt use physical DPI when determining the screen scale factor, instead of logical DPI. However, the code was using QScreen::physicalDotsPerInch(), Whose return value is itself scaled by the device pixel ratio. (See QTBUG-62649 for further discussion). Use QPlatformScreen API instead and calculate the DPI based on geometry() and physicalSize(). Change-Id: Ifa29065c447b0d3431e0f14aacb5aafce61051c2 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit e93ec716bf839686f7ffffc33958d90a58725e9b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid recreating QRegularExpression for every text blockJoni Poikelin2020-08-191-9/+9
| | | | | | | | | | With very complex regular expressions this makes a significant difference in performance. Change-Id: I5267bf71cae98dffb58ec7a1fc982dae639ff312 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit d0b30de54299e8e6e8b1df0c138494c17c2b2642) Reviewed-by: Joni Poikelin <joni.poikelin@qt.io>
* Discard extra mouse move event generated by touchpadAndre de la Rocha2020-08-181-0/+7
| | | | | | | | | | | | | | | | | | | On Windows, and possibly other platforms, a touchpad can send a mouse button press followed by an unexpected mouse move event to the same coordinates, before sending a mouse button release, which may confuse applications. Before the enhanced mouse event processing was added, the code in QGuiApplication was responsible for deducing the mouse event type and other info, and in the process performed a checking that discarded events that did not change state. The enhanced mouse processing code lacked this checking. This change adds an equivalent checking to the enhanced mouse event processing. Fixes: QTBUG-85431 Change-Id: Ie3e2ae8cbf9870d465dfd2c8808942dd6fc647d2 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit b50daef9771d8829fc7f808898cbe051a5464b79) Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* MSVC: Fix C4996 warnings in 5.15 when building QtKai Koehne2020-08-171-0/+3
| | | | | | Task-number: QTBUG-85227 Change-Id: I57d8cc2f6f9654a2851912a1b9f00b0bdac9aa06 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Remove outdated documentationPaul Wicking2020-08-121-5/+0
| | | | | | | | | | We don't have this class in Qt anymore. Drop the related snippet as well. Change-Id: I5149e2f9da483b9ad678a6d414a278cb7e107f10 Reviewed-by: Topi Reiniö <topi.reinio@qt.io> (cherry picked from commit 7bd965258e5c335f6fdba775ba84f787a0217950) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid potential ub in corrupt bmp fileEirik Aavitsland2020-08-071-0/+2
| | | | | | | | | | | biHeight may be int_min, in which case qAbs<int>() will not work. Fixes: oss-fuzz-22997 Change-Id: Ic07d5aa0b4e4f2b6395e1a12d742e31b5282fdfc Reviewed-by: Robert Loehning <robert.loehning@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 6f909a5178296855cdd53b053ced9c551a2474a6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Clear old triangulated vertex data when a path is completely clippedJoni Poikelin2020-08-051-1/+1
| | | | | | | | | | | | Old data was held in buffers which caused OpenGL paint engine to re-render previous shape again with current settings if the current path was completely clipped. Fixes: QTBUG-35513 Change-Id: I0cd448e0b18d199af11e82d79b1ab72d0f89c79e Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit de3b2541de380c04008cce7937076e10496cb78b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix "rectange" typos in qtbaseOliver Wolff2020-08-053-3/+3
| | | | | | | Change-Id: If064fae5eaaeb2e53e3dd05cb9dc1cdf49ad1f04 Reviewed-by: Rainer Keller <Rainer.Keller@qt.io> (cherry picked from commit f4093d02ff387956de4cd2662cc2d4e0e6d3fda4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Reintroduce QGradientData for BC purposesMårten Nordheim2020-08-041-11/+13
| | | | | | | | | | | It was public and thus exported in 5.15.0 but was reverted in ba74bd6c3837d2cdabb7c73a9fa7a041323bfa45. The removal unfortunately causes some BiC test failures, so let's just keep it public and exported. Fixes: QTBUG-85829 Change-Id: I992af40b19dda93aa2319a62b7f09e0ae9c687c1 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Sanitize lengthValue in CSS parserRobert Loehning2020-07-271-5/+4
| | | | | | | | | | | Limit the LengthData to the integer range before rounding it, taking into account that qRound() substracts 1 from negative values. Fixes: oss-fuzz-23220 Change-Id: I1b4383f3c33aac22746831002b2c74fc134faf77 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 188501fe27899cdc6a1aacf0d8c1a11144bd564a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix under non-integer scaling incorrect update areaTang HaiXiang2020-07-241-1/+1
| | | | | | | | | | | | Given some decimal scaling, the clipping of the QRegion/QRect passed to the QRegion/QRect done inside paintEvent cannot handle the decimal scaling. Solved by only converting QRect to a certain QRectF and calling QRectF overload instead of QRect. Fixes: QTBUG-82601 Fixes: QTBUG-64854 Change-Id: I0d8f4193aabfc0d917612db68d2a39ebb726fa2f Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit b4aee30692c166025b4e2283c19dbc1247bcce54) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix buffer overflow in XBM parserAllan Sandfeld Jensen2020-07-241-1/+3
| | | | | | | | | | | | | | Avoid parsing over the buffer limit, or interpreting non-hex as hex. This still leaves parsing of lines longer than 300 chars unreliable Change-Id: I1c57a7e530c4380f6f9040b2ec729ccd7dc7a5fb Reviewed-by: Robert Loehning <robert.loehning@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit c562c1fc19629fb505acd0f6380604840b634211) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Multiply instead of shiftingRobert Loehning2020-07-241-1/+1
| | | | | | | | | | The shift operator is undefined for negative values. Fixes: oss-fuzz-23735 Change-Id: Ib4bad0bf2135f9ddc95f6d7de64d935a02b4791e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit fd0c9fcaccbbb284f00c3403152bd3faf5940888) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Ensure styles always get to polish the application paletteTor Arne Vestbø2020-07-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before 0a93db4d82c051164923a10e4382b12de9049b45 we would polish the application palette even when it was the default palette, as we always recreated the system palette each time a style was set. After the change we skipped polishing the palette unless it was set by the user, under the assumption that the style would set its own default palette if it wanted to override the system palette. This turned out to break the style's ability to slightly tweak the palette via polish (versus the more full on standardPalette approach). We now polish both the default palette and user palettes, and we do so as part of the normal palette update logic. This ensures that the style also gets a chance to polish the palette when the platform theme changes. The polish will not have an effect on the resolve mask of the palette, as the polish is conceptually the same as a base palette, and should not affect e.g. Qt::AA_SetPalette. Fixes: QTBUG-85469 Fixes: QTBUG-85188 Change-Id: I869e9c442b177de4f1dc49eb75220709306f4d12 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 0bf120f5fd197cd215cd9520a494b162887d1ec4) Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>