summaryrefslogtreecommitdiffstats
path: root/src/gui
Commit message (Collapse)AuthorAgeFilesLines
* Rasterizer: compute intersection factors only when neededEirik Aavitsland2021-01-201-7/+12
| | | | | | | | | | Fixes oss-fuzz issue 29285 Change-Id: I8f7e0bc898b119d153a36cef5a74371249ed7686 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Robert Loehning <robert.loehning@qt.io> (cherry picked from commit e1ed570f9d0ec3998f130e2c3870ef49e7994dbf) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix XCB launch key mappingAllan Sandfeld Jensen2021-01-161-18/+17
| | | | | | | | | | | | | | They have been reported wrong since Qt 4, and not fixed for behavior compatibility, fixing it for Qt 6. [ChangeLog][X11] XF86LaunchXX keys have been remapped, so the Qt names and X11 names match, instead of being 2 off. Fixes: QTBUG-25261 Change-Id: Ie3a8676439ae3e93a78218c9e7f4443565e84356 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io> (cherry picked from commit cfd935fe6c26800befc10889afc0aebde311acca) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix convertToRGBA64PM for Grayscale16Allan Sandfeld Jensen2021-01-151-2/+1
| | | | | | | | | | | The input has been fetch into a set of uint32s, so no longer a string of ushorts. Fixes: QTBUG-90246 Change-Id: Id52a6824317b0744310008cc2ce2f726539b4c8c Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit ade24763c74ce506276218ec1ce0e307301717fe) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* AA_SynthesizeTouchForUnhandledMouseEvents: keep correct coordinatesShawn Rutledge2021-01-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | QGuiApplicationPrivate::processMouseEvent() sends a QWindowSystemInterfacePrivate::TouchEvent if the mouse event is not accepted and AA_SynthesizeTouchForUnhandledMouseEvents is enabled. A QPA TouchEvent always contains native touch points, which is why it calls QWindowSystemInterfacePrivate::fromNativeTouchPoints to translate the QMouseEvent's device-independent position back to the raw position that it would have had if it came from a real touchscreen. Therefore we must give that function touchpoints that are actually in native coordinates. It may be that some of this transformation could be avoided entirely, but here we prove that the existing way works correctly, by adding coordinate checking to the tst_QWindow::mouseToTouchTranslation() test. Task-number: QTBUG-86165 Change-Id: I4c9ca2b11e9eb76d79712c187db3eb9865da581a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit aeeac48cbdea744406f0c8abefe271f571b61d07) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QGuiApplication: use global position to create local position for synthetic ↵Richard Moe Gustavsen2021-01-141-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | mouse events When QWidgetWindow handles a QTouchEvent, it will call updateTouchPointsForWidget() for each widget it tries to deliver the touch event to. This will make sure that the point's position() is updated to be local to the widget being processed. The problem is that we never reset this overwriting of local positions in the event after we're done. So if we later try to synthesize a mouse event from it, the local position in the fake mouse event will be based on the local position inside a random widget, and not the original local position sent from QPA. Rather than trying to store all the original local positions inside the event before going through this delivery logic, and reset it afterwards, we base the local position of the synthesized mouse event on the (unmodified) global position instead. Fixes: QTBUG-90033 Pick-to: dev Change-Id: I1588351482de7cce9c06d102db3686ea8dd0c118 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* a11y: Do not cache classes that don't have a factory pluginJan Arve Sæther2021-01-131-5/+4
| | | | | | | | | | | | | | | | | | | For Qt Widgets we thought it was a good idea to also store in the cache if a class didn't have a factory plugin. This worked fine there, since the number of QWidget classnames is quite limited (so the factory plugin cache will soon reach a limit) In QML however, classes are often suffixed with e.g. Button_QMLTYPE_123, Button_QMLTYPE_124 etc. This number suffix is just increased continuously. This could lead to that the factory plugin cache will grow ad infinitum, which will cause "memory leaks" in addition to a performance penalty. Fixes: QTBUG-75106 Change-Id: I9ba189f989f0b90ab62a2c54a2e9230236a998d8 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 583668005d4d6399fc16d165dcb6a5af2b94323d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Windows font engine: Silence warnings about not being able to enumate font ↵Friedemann Kleint2021-01-131-2/+2
| | | | | | | | | | | | families Turn the warning into a qCDebug() statement and add explanatory comment. Fixes: QTBUG-85683 Change-Id: I2a6a7a089a660294f3e9c3096299c75635b3b215 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 29b2387587fe2ed2a73bdcbfa928acb755537284) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove QtDBus includesDavid Skoland2021-01-137-66/+79
| | | | | | | | | | | | | | Per the discussion of QTBUG-88831, we determined that module-wide imports are unfortunate, especially for compile times. Following this, all QtDBus includes have been replaced with the headers for the classes actually used in each file. Additionally, some cleanup of header file order and format has been performed in the changed files. Change-Id: I62c1b75682a48422f0ba1168dd5d7bd0952808ac Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 9e09677c1dd4da92735736a0fbcb703416bf4d6d)
* rhi: gl: Reset tracked state upon a buffer update or readbackLaszlo Agocs2021-01-131-33/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...encountered in the command list. Move all, previously local, tracking variables into a struct. This allows creating helper functions to reduce error-prone repetition in the executeCommandBuffer() function body. The only real change in the patch is in the handling of Command::BufferSubData and Command::GetBufferSubData: here, instead of calling glBindBuffer directly, use a helper function that also resets the relevant state tracking variables. A subsequent Command::BindVertexBuffer or BindIndexBuffer will therefore correctly rebind the appropriate buffers. This is particularly relevant with certain command stream patterns exercised by some Qt Quick 3D scenes: - A View3D renders a mesh, - another View3D has some 2D Qt Quick content, as well as a model with the same mesh. When both View3Ds use the default Offscreen render mode, the resulting command list consists of segments along the lines of: 1. prepare resources for first View3D 2. render content for first View3D - this binds the vertex and index buffers for the mesh (state is tracked; all 1-4 steps are within the same command list, processed by a single call to executeCommandBuffer()) 3. prepare the content for the "inline" 2D Qt Quick scene - this may update vertex and index buffers, that may lead to adding BufferSubData commands to the list (tracked state (last vertex/index buffer) may need invalidation/updating - and that's where our problem lies) 4. the second View3Ds 3D content is rendered: a model with the same mesh as the last (Quick)3D draw call, so same vertex and index buffers. If #3 did not invalidate and/or update the tracked state, the glBindBuffer calls are (incorrectly) skipped. Fixes: QTBUG-89780 Change-Id: Icc933252f3993b8727d192e7ba4aa0f842bab51e Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 5f8efb259774040303f37d00b6307afd22857af2) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Doc: Add details to QFont::toStringPaul Wicking2021-01-121-1/+20
| | | | | | | | | | Add details that explain the return value. Fixes: QTBUG-81467 Change-Id: Ifad407a27259711fc9abe1bacc7ba9db105bdcc0 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 8c395a20eddc15ae923b7658f275fa87c8d33db9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use design metrics when adding text to QPainterPathEskil Abrahamsen Blomfeldt2021-01-121-0/+5
| | | | | | | | | | | | | | | | | | | | | When we add text to QPainterPath, we will add the design metrics (unhinted glyphs) and scale these down to match the target font size. But the glyph positions we pass in are based on the hinted metrics, samples at the target font size. Thus, on fonts/systems with hinting, these do not match the scaled design metrics outlines. To fix this issue, we make sure the text layout uses design metrics when determining the glyph positions. [ChangeLog][QtGui][Text] Fixed an issue where QPainterPath::addText() would get inconsistent kerning for smaller font sizes when hinting is enabled. Fixes: QTBUG-20900 Change-Id: I651997d1a6a86e6271557438afa2cdad078a83ca Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 6a3f8cbc3ad47d8585aac25d3775ed2350afe20c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Explain how boundingRect handles null QRectFPaul Wicking2021-01-111-1/+3
| | | | | | | | Fixes: QTBUG-87107 Change-Id: Ib7f9bd58b0f3454167dc61f95e0d8e6dec52a5ed Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit 149ad1e615bf0974e52a681af73e9fb04bc1c762) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Link to correct locationPaul Wicking2021-01-111-4/+4
| | | | | | | | | | Reflow text to fit style while at it, to satisfy git clang-format. Fixes: QTBUG-89709 Change-Id: Iab2bf09399adf2cb0f0219ab40978bb238825ae8 Reviewed-by: Topi Reiniö <topi.reinio@qt.io> (cherry picked from commit 713829b718e3842cec3266838d5692f754582de6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QPdfWriter: fix embedding fonts in pdf filesChristian Ehrlicher2021-01-091-1/+1
| | | | | | | | | | | | | The container size change from int32_t to int64_t created a subtle error during font serialization. The size of a QByteArray was serialized without a proper cast and therefore now 8 bytes instead 4 bytes were written to the stream. Fixes: QTBUG-89727 Change-Id: If9255a5a3124038356bc5053810f98c7c88f8a01 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 05706bd2b005dd159be34107cc43c92e7f12eb35) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Revert "Fix invalid text layout data when a full layout run is interrupted"Frederik Gladhorn2021-01-071-5/+2
| | | | | | | | | | | | | | | | This reverts commit 09ee4282e5eedf5b44245e8b28b223339f87ddfa. The commit made the layouting time go from linear to quadratic, which is problematic when rendering big documents impractical. I wrote an alternative fix for QTBUG-20354 which will come as separate change since it approaches the problem in a different way. Fixes: QTBUG-89599 Task-number: QTBUG-20354 Change-Id: Ie450332f06ee40e60c8e4c6c7d10834bff1acf74 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit a62fa9b7cc520f3548356182bf5d6642c05be204) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove superfluous OpenGL_GL_PREFERENCE assignmentJoerg Bornemann2021-01-061-2/+0
| | | | | | | | | | | | | | | We did set this variable, however after src/gui/configure.cmake was loaded (it is early-loaded in src/CMakeLists.txt), meaning the assignment had no effect. Also, what this assignment tried to achieve is covered by our global CMake policies now. Task-number: QTBUG-89754 Change-Id: Ie7aeee1505d112d799455b2915acbfa7e9a12a64 Reviewed-by: Cristian Adam <cristian.adam@qt.io> (cherry picked from commit 36b1e03ecdaac40aaae5fa42ee9a5b3b50991ea3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QInputControl: accept surrogate category characterLiang Qi2021-01-051-0/+3
| | | | | | | | | | See also https://unicodebook.readthedocs.io/unicode_encodings.html#utf-16-surrogate-pairs . Fixes: QTBUG-89184 Change-Id: I04eff7f42f0030346603a7b31e4ac854a477030c Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit e688b99995b8c624dbcea296c99fb89262d29e15) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Handle maxImageCount 0 in QVulkanWindowLaszlo Agocs2021-01-052-4/+6
| | | | | | | | | | Take the logic we use in QRhi's Vulkan backend. Fixes: QTBUG-85791 Change-Id: Ifdc2b3d351af71fbc86e20abcede902303e41fc4 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit f6cb24f4c0f1f48f9010ba78670577ff5643132f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* rhi: vk: Fix DS WAW hazard reported from sync validationLaszlo Agocs2021-01-041-10/+23
| | | | | | | | | | | | | | | Running with synchronization validation (SDK 1.2.154) we get: Hazard WRITE_AFTER_WRITE vs. layout transition in subpass 0 for attachment 1 aspect depth during load with loadOp VK_ATTACHMENT_LOAD_OP_CLEAR Attempt to fix this with an appropriate subpass dependency. Fixes: QTBUG-89760 Change-Id: I67e15a09aab564f63aab646761ccdb1f8b82111d Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 8bd58a97d70027575b7f4ec227e7a57ed11990bc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update QPalette() documentation to not mention the application paletteTor Arne Vestbø2021-01-041-1/+4
| | | | | | | | | | | | | | | | | | | It's an implementation detail that the default constructed palette happens to use the d-pointer of the application palette, and as a result has the same colors as the application palette if requested. The palette has an empty resolve mask, and hence all the colors in the palette are undefined. Users should not rely on QPalette() to represent the application palette when for example overriding a parent palette. Task-number: QTBUG-85226 Change-Id: Ia6747887eef6e9a5f21b2002066608c433260de2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 74559dccc84ed0f0f7d8f57165fe387c3e112485) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Use host variables instead of hardcoded directoriesAlexey Edelev2020-12-211-1/+1
| | | | | | | | | | | | | | | | | | | | 'QT_HOST_PATH' indicates that we use crosscompilation toolchain to build project. In this case 'Qt6Config.cmake' loads 'Qt6HostInfoConfig.cmake' from host QT_HOST_PATH, that defines correct paths to host tools. Replace hardcoded paths for host tools by paths recorded in Qt6HostInfoConfig.cmake. Correct conditions for QT_HOST_PATH, evaluate it explicitly as string, but not as boolean expression. Fixes: QTBUG-86557 Change-Id: Ib52bbd32478051d019a932dcb1f735e2d4aacfbf Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 56bdef94379479f27858dccc73a95614648735bb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Clarify QWindowPrivate::maybeQuitOnLastWindowClosedTor Arne Vestbø2020-12-171-3/+3
| | | | | | | | | | | | | | We only need to check QGuiApplication::quitOnLastWindowClosed() at the point where we've actually concluded that the last window was closed. Checking for !q->parent() was redundant, as we were already exiting early when !q->isTopLevel(). Change-Id: I934e186d707361b31d19692c04d2e17b7ba0f49e Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 1649137b9311a5ee3d12bc8824f5453294bd6fe9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix qt_alphaVersion and qt_opaqueVersion in the trivial caseAllan Sandfeld Jensen2020-12-171-4/+53
| | | | | | | | | | | | | | | | | The case no conversion was needed wasn't handled, but was assumed to be handled by some call sites. This can speed up QPixmaps on devices with non-standard screen formats. [ChangeLog][QPixmap] Opaque pixmaps on devices with a non-standard opaque format will now correctly match format for faster blitting. Same with semitransparent pixmaps on devices with a non-standard semitransparent format. Change-Id: Ia05ff518fea36b7e3ed5c089fa9e8681a02fc574 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 30811f6428549bbdc54c2566b1493f83d3c24a66) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Prevent copy in texture upload with invalid inputLaszlo Agocs2020-12-171-2/+4
| | | | | | | | | | | Skip the memcpy when src is null. Also silences a Codechecker warning. Change-Id: I5042d725000cb6dff6864408fa9ed9e0ca35145a Reviewed-by: Christian Strømme <christian.stromme@qt.io> (cherry picked from commit 796de4f0668cc4b38f9e8653a0b2f53f0b3423b9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid overflowing QFixed in text layoutEirik Aavitsland2020-12-101-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>
* Shortcut QImage::convertTo when no conversion is necessaryAllan Sandfeld Jensen2020-12-081-2/+2
| | | | | | | | | Avoids a detach when converting to existing format. Change-Id: I9a4801878ddec295a02f2c88f4a40ec13d513a94 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit cc81aae4b312da40945ddfecb806f4abe6b74048) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix links to OpenGL documentationAndreas Buhr2020-12-081-199/+199
| | | | | | | | | | | | Some links were broken. Some stated to be pointing to OpenGL ES 2.0 documentation but pointed to OpenGL ES 3.2 documentation. Task-number: QTBUG-88533 Change-Id: Iad25d8f709b8fa9421039d5cb51cee21093e3191 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit cd661122987826357adb22684c3d953efadee638) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* doc: Remove dpiawareness command line argumentTor Arne Vestbø2020-12-071-2/+0
| | | | | | | | | | | We don't want to (officially) expose customizations like this to the user, now that high-DPI is always enabled and should work. Change-Id: I2f0bd7c625b565896b0766586f191ff5001eb60a Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit ecb61c17f5f22a997d98da9ce750367bc02d1f96) Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QInputDevice: Parent default keyboard to core app singletonFabian Kosmale2020-12-041-1/+1
| | | | | | | | | | | | With this we can avoid leaking the QInputDevice which is created when the platform plugin does not provide any. The onwership is solved in a similar way as in the plugins, except that here we have no parent which really fits, so we use QCoreApplication::instance instead. Change-Id: I77a212fb592ba3d5a42b2ecd486763e3b4d3410e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit bc093cd294cbf48eb93b776fc0b927f0a43fa603) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QImage::setPixelColor on RGBA64_PremultipliedAllan Sandfeld Jensen2020-12-041-4/+1
| | | | | | | | | 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>
* Improve documented function argument namesAllan Sandfeld Jensen2020-12-043-14/+14
| | | | | | | | | Make them less \a fun. Change-Id: Ief9a572dcbeb029b18b352c89551963bade90198 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 47923f7d4766a3b8943d292798b5b7e8792e598c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Replace discouraged Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPEAndreas Buhr2020-12-0450-120/+120
| | | | | | | | | | | | | | | Q_MOVABLE_TYPE was conceived before C++ had move semantics. Now, with move semantics, its name is misleading. Q_RELOCATABLE_TYPE was introduced as a synonym to Q_MOVABLE_TYPE. Usage of Q_MOVABLE_TYPE is discouraged now. This patch replaces all usages of Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPE in QtBase. As the two are synonymous, this patch should have no impact on users. Change-Id: Ie653984363198c1aeb1f70f8e0fa189aae38eb5c Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 0440614af0bb08e373d8e3e40f90b6412c043d14) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix links to Application ExampleVolker Hilsheimer2020-12-021-1/+1
| | | | | | | | | | | The example was renamed in 6cb36d825d365988ea7a601218bdd3a329290469. Change-Id: Ic9daac60002c9988dfeb5c7dcde74edb69388f37 Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Jason McDonald <macadder1@gmail.com> (cherry picked from commit 0cc9a99865c4b6dfb1a212a5aba0fc5907f19b24) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix documentation links to High DPI documentationAndreas Buhr2020-12-013-8/+8
| | | | | | | | | | | | The documentation on High DPI was recently rewritten, renaming several sections. This patch fixes the links which were broken by this change. Task-number: QTBUG-88533 Change-Id: I5e9417554270a6740986d7cec5e3433d043e5560 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 10b6a87679d02d7cf5dcd2f75d5640ffb1e1303e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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>
* Doc: Use explicit linkage with target_link_librariesKai Koehne2020-12-011-1/+1
| | | | | | | | | | | | | | | The Professional CMake book suggests always using explicit linkage with target_link_libraries, so let's use that. Whether to use PUBLIC or PRIVATE depends on the context. But let's be conservative and advise on using PRIVATE by default. Task-number: QTBUG-88935 Change-Id: I12b80ee85be9f6916f1e4dea6b1c9cb29e03c20f Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 130b2090147e0d28e35fd736fbefcd588c0014f6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Revert "xcb: add xcb-util dependency for xcb-image"Liang Qi2020-12-013-26/+4
| | | | | | | | | | | | | | | | This reverts commit 39b1dea2ec5cde9523df61c78dec5d4b195f66d2. 39b1dea2 is wrong, the bug is for static build of qt with static xcb. It adds the explicit dependency of xcb-util 0.3.9, which is not available on Debian yet. Task-number: QTBUG-86287 Fixes: QTBUG-88688 Change-Id: Iffc821f49bdfcad3f2556951d3677c35a7682266 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 92a57e0b016f811876ec1d62328ca8edfe452a3a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Re-generate project files in srcJoerg Bornemann2020-12-011-1/+1
| | | | | | | Change-Id: I1f5f822d68129490f1a7c495f718aead0b520ca9 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit d4e9f0e6332d1ea740e28718d21281099c6d62e7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Fix QVector[2|3|4]D documentationTopi Reinio2020-11-301-84/+57
| | | | | | | | | | | The \fn commands for friend functions need to include the class scope for QDoc to find the declarations. Fixes: QTBUG-88932 Change-Id: Icbb45c12d7d657d95243231148483c00baf07c36 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 3789ca6c9947d1357641424a5102cdf3fba2dcc7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Restore QOpenGLVersionFunctionsFactory entry in changes docsLaszlo Agocs2020-11-301-0/+6
| | | | | | | | | | This used to be present in source-breaks.qdoc in qtdoc, but seems this one note went missing when merging the content to other places. Change-Id: Idfd165eb1c7616c595f7a6515cc98d8477671e09 Reviewed-by: Jerome Pasion <jerome.pasion@qt.io> (cherry picked from commit 5b3cc25492c68e0eb8cfded9cbe0f6878233fff3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update setHighDpiScaleFactorRoundingPolicy docsTor Arne Vestbø2020-11-271-6/+3
| | | | | | | | | | | The default is now passthrough. And let's not mention the environment variable overrides, as they are meant for internal testing. Change-Id: Ie2409e5411d4bdcdf041834cb5ca9e1215aa173a Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 58afadc624cf284cfe93d6a5c85557ed6e4f9765) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix typo in rhiAntti Määttä2020-11-271-1/+1
| | | | | | | Change-Id: I2e920e8e68b7010b565c422bb26708d172d345e8 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit aa5839bdcef90d5976cb9e6a4647c5172f51c7e9) 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>
* Windows QPA: Pass device for synthesized touch/tablet eventsFriedemann Kleint2020-11-272-0/+33
| | | | | | | | | | | | Add the overloads for mouse events with device/without timestamp and pass the active tablet or touch device. Task-number: QTBUG-88678 Task-number: QTBUG-46412 Change-Id: I8695b493540d0cbf50e9c72afe870a7633de3ab9 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit d3caea04dc6c3a7072a43294b70bec860c199bf1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Output source in debug operator of QMouseEventFriedemann Kleint2020-11-251-0/+4
| | | | | | | | | Task-number: QTBUG-88678 Task-number: QTBUG-46412 Change-Id: If9282f5b845ef16ff7e7ce523f78e3b8adfbef90 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit 45c623c42ac26eafff8e401709fa4c97ed9cd585) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Return subclass type from overrides of QEvent::cloneVolker Hilsheimer2020-11-241-34/+34
| | | | | | | | | | | C++ allows overrides to return a covariant type, so if calling code has already cast the callee down to the right type, don't require it to cast the returned clone down as well. Change-Id: I802f00a3c78e03047046986d0ed0a479b47573b8 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 146b37cdf376fb2fde85fa27326acfbeb2a024e3) 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) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QGuiAppPriv: don't clear target and window for TouchCancelShawn Rutledge2020-11-211-2/+0
| | | | | | | | | | | | | It's nice not to leave garbage in QPointingDevicePrivate::activePoints between events; on the other hand, this garbage doesn't matter, because every press event sets the target and window independently, without caring what was stored there from before. But it was wrong to clear it before we've even delivered the TouchCancel event. Change-Id: I924039a7c7a8ed75f420d1837c63dc19d3cc98b6 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 45a65cbeb2775da71d4e7b417b45d54341a3ee7f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix weight when reading old serialized QFontsEskil Abrahamsen Blomfeldt2020-11-211-1/+4
| | | | | | | | | | | | | | | | | | | The QFont::fromString() needs to differ between strings produced before and after Qt 6.0 when interpreting the weight value, since in older strings this will be the legacy scale. Luckily the number of tokens in the string can be used for this purpose, since many tokens were added in Qt 6.0. This broke KDE, where font settings are stored in QSettings and serialized using QFont::toString() from Qt 5. Fixes: QTBUG-88589 Change-Id: I199737fed61917f8b9d8f86176ead29a89eb8e0c Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit 1d14067680f02f47b2f8ff375c44eb64633eec02) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix safe conversionAllan Sandfeld Jensen2020-11-211-4/+11
| | | | | | | | | | | | Ensure the resulting QScFixed values are no larger than can be safely returned to int after shifting the fixed factor away. Fixes: QTBUG-88683 Change-Id: Id0754b021e5fa9a3cf0d15e37ac643cfc1509993 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit a31484302d71c29c0e0e62f9941f9d5f0c87f9aa) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>