aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
| * QQmlPropertyCache: don't depend on locale for toupperMarc Mutz2023-01-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The C toupper/tolower functions are locale-dependent. Given the right locale (Türkiye, e.g.), toupper(i) is either - İ (LATIN CAPITAL LETTER I WITH DOT ABOVE; if representable) or - i (unchanged; if it isn't) Both results are wrong for the present use-case. Use the new QtMiscUtils::toAsciiUpper() function instead. Amends d481f2ff518df1e44103d1850e7d52bd69260c34. Task-number: QTBUG-109235 Change-Id: Ib66593fc7eff3edc0cc16291ca3eae8bdf0dd8ed Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 179200d2a3fa0df28fbf3790f8ff1ee47d0926c0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * QML: Consider deep aliases when finding binding targetsUlf Hermann2022-12-221-16/+40
| | | | | | | | | | | | | | | | | | | | | | If we have a deep alias we need to bind to the inner object rather than the outer one. Fixes: QTBUG-109417 Change-Id: Iefe8641026cfbbf9199b2bb8d9fa2f5fba591f17 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit e9b7eaaf6e627c84cf77dc0ea76c9cb40d705711) Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
| * qquickpopuppositioner: fix popup mirroringSami Shalayel2022-12-211-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed a bug where QQuickPopupPositioner::reposition() was confusing coordinates obtained by mapToSource() and mapToItem() during mirroring of the popup. This leads to popups at the wrong places, e.g. when a rotated combobox has not enough space to unroll its popup. Translate the coordinates using mapToItem instead of mapToSource after computing the alternative position of the popup (e.g. when it can not be unrolled correctly). Add a test to check if the combobox popup appears at the right places. Skip native styles as they might be pushing the popup around, same for Android as they might have too small screens (which involves more positioning logic then just the mirroring). Fixes: QTBUG-105148 Change-Id: I0033509a8824e3a71698f91ef832b94527d8e2c8 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> (cherry picked from commit 5c1d96b70a3de9a08a473ffcbcace8d6a7c5fa3b)
| * Fix missing glyphs when using NativeRenderingEskil Abrahamsen Blomfeldt2022-12-201-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we look up glyphs with subpixel positions in the glyph cache, we use the calculated subpixel position (from a set of predefined subpixel positions) as key. In some very rare cases, we could end up with different subpixel positions when looking up an on-screen position than when we entered it into the cache, due to numerical differences when doing the calculation. The reason for this was that when entering the glyph into the cache, we used the 16.6 fixed point representation, whereas when looking up, we used the unmodified float. In some cases, the converted fixed point approximation might snap to a different predefined subpixel position than the floating point equivalent. To avoid this, we reuse the converted fixed point positions when looking up the glyphs in the cache. [ChangeLog][Text] Fixed an issue where text using NativeRendering would sometimes be missing glyphs. Fixes: QTBUG-108713 Change-Id: Iecc264eb3d27e875c24257eaefcfb18a1a5fb5be Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit 4bad329985b75090c68a70cceee7edadc172d7ab) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Flickable: prevent fixup() from being called while draggingOliver Eftevaag2022-12-192-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A previous patch 5647527a8cde84b51fff66fc482f02435770b3dd causes a regression. The purpose of the patch, that caused this regression, was to update the pressPos variables, in cases where the contentItem's geometry was modified externally, while a user were dragging the contentItem around. The mistake that was made, was how width and height changes were handled. We had previously added logic in setContentWidth() and setContentHeight() that would call fixup() (with immediate fixupMode) to ensure that the contentItem would immediately be repositioned inside the flickable's viewport, if the contentItem was being dragged. It turns out that setContentWidth() and setContentHeight() are being called from QQuickItemViewPrivate::updateViewport(), which happens quite often, while dragging. This would make fixup() and dragging constantly interfere with each other, since they'd not always agree on a specific position for the contentItem. This patch reverts the changes made to setContentWidth() and setContentHeight(), since it turns out that those changes weren't necessary after all. QQuickFlickablePrivate::itemGeometryChanged() only calls viewportMoved() on x and y changes anyways. Done-with: Jan Arve Sæther <jan-arve.saether@qt.io> Done-with: Santhosh Kumar Selvaraj <santhosh.kumar.selvaraj@qt.io> Fixes: QTBUG-109140 Change-Id: I0bddf8685d3afc1ae04b2c092212d3c1bd742c3b Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit b307bf3c4f63c6e04874a972c747f18e18ddc199) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Drawer: don't get stuck in open state after touches outsideShawn Rutledge2022-12-192-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the Drawer does not cover the whole window, it's possible to tap outside the dimmer overlay. In that case, next time you tap on the dimmer, you hit this early return in handleRelease in which pressPoint.isNull(), so it was not setting touchId back to -1 and doing the other cleanup/reset tasks. This is a touch release, and touchId should always be eventually reset after a touch release, regardless of the code path. Now QQuickDrawerPrivate::handleRelease() has a QScopeGuard to ensure that cleanup is done regardless of early returns. That's still not enough; but when we receive TouchEnd in QPopupPriv::handleTouchEvent(), it means that _all_ touchpoints are released. So as a fallback for multi-touch cases, we now ensure that all releases are handled and stored state is reset, regardless of whether an individual point ID matches the stored touchId. Fixes: QTBUG-103811 Change-Id: Ia637bae00d8edb7f7f4c8fb4337b4c3d72fe4e60 Reviewed-by: Doris Verria <doris.verria@qt.io> (cherry picked from commit 730cdc5043a8823dfcdce7d3b2035875f8f987c1) Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Fix ListView.isCurrentItem for DelegateModel, take 2Ivan Solovev2022-12-171-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The attached ListView.isCurrentItem property is updated when QQuickItemViewPrivate::updateCurrent() method is called. During the initialization it could be potentially called twice: * from the QQuickItemView::setCurrentIndex() method, but that does not happen, because the isComponentCompleted() condition is not fulfilled at that time. * from QQuickItemView::componentComplete() method, but that does not happen, because the d->isValid() condition is not fulfilled. The latter means that the model is not yet initialized. This patch attempts to fix it by adding the updateCurrent() call into layout() method. This method is called each time the component needs to be redrawn, so it creates the proper currentItem during the first call. Most of the subsequent calls will do nothing, because the currentItem will be non-null, and the currentIndex will not change. The unit-test is taken from the reverted commit d9f9d773e92940786f159897623618f3bf6bcf0f. Another unit-test is meant to check that there is no regression like in QTBUG-98315. Done-with: Joni Poikelin <joni.poikelin@qt.io> Fixes: QTBUG-86744 Change-Id: Iab86a9c0e22660126f152727e8bd393ac17f5d15 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 9124fcecb4e33d33bcd6c4d678d746bc673ea46c) Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
| * Implement touch event handling for SplitViewVolker Hilsheimer2022-12-161-27/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Amend 80166d58a18370bd5a2c6c61d2519011cfd65721, which broke touch event handling in SplitView. Implement handling of TouchBegin/Update/End events equivalently to the mouse event handling. As a drive-by, rename the logging category from 'mouse' to 'pointer', and refactor the if/else sequence to a switch statement, reducing duplication of code that's common for all event types. Remove expectFail from the test that now passes. Fixes: QTBUG-105312 Change-Id: I156f55fa40b2afaaa115e59940d26187121fc16a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 6de2397da24e8068282c2d2bda5d1637ac033bc6) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| * Don't override exclusive touch grab of filtered itemVolker Hilsheimer2022-12-161-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | A parent that filters mouse/touch events for a child might make the child the exclusive grabber of the touch point when filtering, and the child might have the keepTouchGrab property set. In that case, don't override the exclusive grabber with the filtering parent. Task-number: QTBUG-105312 Change-Id: Ic04513987d5ecb2cd0b12939b7d66091e85b35ee Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit f15f1d643ebf70fe9d3c67ea8405d819da595b21) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Documentation: Make note about QSGGeometry storing a reference to the ↵Friedemann Kleint2022-12-161-2/+4
| | | | | | | | | | | | | | | | | | | | attribute more prominent Task-number: PYSIDE-1345 Change-Id: I765e32d367c36add97a08c03df5e0ac30e92e56e Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit c6e294f7adc5d129e2e6a8ac9375ea537d983381) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * qv4qobjectwrapper: return false on failed argument conversionSami Shalayel2022-12-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was possible to call c++-methods (either invokable or as slot) with wrong arguments, which caused a crash. The reason was that CallMethod(...) converted something to a QObject without checking if it was an actual QObject. The wrongly typed argument would end up reinterpret_cast'ed into another type for the call, which leads to segmentation fault when accessing the argument in the function. Added a test where an int tried to be reinterpret-cast'ed into a QFont. Fixes: QTBUG-108994 Change-Id: I8c45c9124411ad3fd100faed0b03390843f7d034 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit cda417cf03694256a84b4abe77de0f5f49ebdf32)
| * doc: Fix up setGraphicsApi() since tagLaszlo Agocs2022-12-151-1/+1
| | | | | | | | | | | | | | | | | | | | It's the [set]sceneGraphBackend() functions that are from 5.8, the new functions in Qt 6 are since 6.0. Change-Id: If36f42615d53bd964f05ba42846b9322d8f1a0e4 Reviewed-by: Christian Strømme <christian.stromme@qt.io> (cherry picked from commit 848f40f30e46322286d75923afd6a33f42dbfe46) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Doc: Fix typoAndreas Eliasson2022-12-131-2/+2
| | | | | | | | | | | | | | | | Fixes: QTBUG-107492 Change-Id: I3f5ad0421bbd0822c76c5e32e42616461cde31c3 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> (cherry picked from commit 39e584f31e60c3b4e7cc7a26d2a09ce36dad8eab) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * QV4::Heap::SharedArrayBuffer: avoid std::aligned_storage (deprecated in C++23)Marc Mutz2022-12-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... by rolling our own. Qt 5.15 uses a pointer (additional indirection), not aligned_storage, so isn't affected. References: - https://github.com/cplusplus/papers/issues/197 - https://wg21.link/p1413 Manual conflict resolutions: - adapted to different member names and private/public access in the 6.2 class vis-a-vis the 6.4+ version. Task-number: QTBUG-99122 Change-Id: Ia116dc11336901a19fc227fb68ac266c1bfbbcb1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 6e9a9ed121ce101d19e015de03b8f1d37fa84041) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
| * QQuickNinePatchImage: fix aliasing by respecting the smooth propertyMitch Curtis2022-12-092-1/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When scaling with fractional values, aliasing can occur. Use the same approach as BorderImage and respect the smooth property of NinePatchImage. This property comes from QQuickImageBase, which sets it to true by default. We change QQuickNinePatchImage's default value for it to false, but this can be overridden by setting QT_QUICK_CONTROLS_IMAGINE_SMOOTH to 1. As NinePatchImage is not public API, and users would have to set the smooth property on every image (where some items contain multiple NinePatchImages), it's better to have one place to set this for all controls. [ChangeLog][Controls] The Imagine style now supports smooth scaling for 9-patch images when the QT_QUICK_CONTROLS_IMAGINE_SMOOTH environment variable is set to 1. Fixes: QTBUG-107989 Change-Id: I250a041f87c0270d67af191168f7bcfbf6237925 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 649151bdcc4c2e747224d4405d3b6bb13525161d) Reviewed-by: Paul Wicking <paul.wicking@qt.io>
| * Stabilize rendering of Rectangle borders under fractional scalingEirik Aavitsland2022-12-081-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default, border widths are rounded to integer values (in QSGBasicInternalRectangleNode::updateGeometry()), so one avoids artifacts where the rendered width can fluctuate with one pixel if the Rectangle coordinates are fractional. However, that rounding was done before the device pixel ratio scaling, so if the dpr was fractional, one would get a fractional rendered border width, and hence fluctuations. Fix by taking the dpr into account. The rounding is done in the Item, where the dpr is known, instead of the SG Node. Fixes: QTBUG-108831 Change-Id: I9a1d8180c72dd5e1b1eaa9f1c420eb9944f1e5a5 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 73a3b69f9ae6d49cc04ce9834ab6f3b88d11e35b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Fix potential crash in software renderer of ShapeLaszlo Agocs2022-12-051-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Consider that setNode() is only ever called when a new node is created. If now the new node has the same address as the old one, the state will be inconsistent. (setting the DirtyList flag is quite important). Fixes: QTBUG-109200 Change-Id: I6136d09d917ad7c8ec13cbcdcb34bd51cb3aecfa Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 4f92f018ea0639b8127ad25f4430e5a5ee4e61a1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * QQuickMacStyle: stop using deprecated constants, use suggested replacementsTimur Pocheptsov2022-12-021-1/+1
| | | | | | | | | | | | | | Change-Id: I6f0dfb34d836cfa3afc2fb5fc5990eb77f506e5c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 90da0220e77cb6d71df460bd0e30358d734346d1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * doc: Add note to PinchHandler.translation property about macOS trackpadShawn Rutledge2022-12-011-0/+3
| | | | | | | | | | | | | | | | | | | | Translation doesn't happen with trackpad native gestures. Fixes: QTBUG-109002 Change-Id: I7d42b0d737d45405732a389560a6c77624831c9e Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 786e1748d4469c135a922a221024f3f9c421c0de) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Connections: Don't crash when target is deletedFabian Kosmale2022-11-281-8/+6
| | | | | | | | | | | | | | | | | | Fixes: QTBUG-108697 Change-Id: I019edf3a0a702ad1dca340473265933e4d131e99 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 6cd8d209ec472a658a330f25b84f92cd61e0d4cf) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* | Merge remote-tracking branch 'origin/tqtc/lts-6.2.7' into ↵Tarja Sundqvist2023-10-0379-248/+530
|\| | | | | | | | | | | tqtc/lts-6.2-opensource Change-Id: Ib72ded968b7ac6b75b499392162e3cf3b761ec48
| * Debugger: Initialize scoped context correctlySemih Yavuz2022-11-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Initialize scopedContext with valid qmlContext. Otherwise debugger crashes on attempt to lookup an object that includes a v4Function property Fixes: QTBUG-107607 Change-Id: Iea59bdf9d379a5415abe1767f76f851978b1be3f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit fe32f58008f89b7174e9f41a781e6fba5799c026) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Revert "masm: Treat Android as generic Posix regarding mmap and friends"Ulf Hermann2022-11-252-17/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit ffecc122d785de9c4c5defd8724526b8dd4982dc. It turns out that madvise() only fails when given MADV_WILLNEED as argument on the affected devices. MADV_WILLNEED is indeed optional. Since commit 2034e10c9378364ecc7aa1af27505562d86688de we do not crash on a failed MADV_WILLNEED anymore. Therefore, we can re-enable the linux code path for android. Task-number: QTBUG-107774 Task-number: QTBUG-106864 Task-number: QTBUG-106269 Change-Id: If67a38e4fc206bd5d5ed0ef8bf66ededd09d8f59 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit ac4fea75379467dde9065825d3f15da3b86e9ad8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Doc: Fix import statement in QML code exampleAndreas Eliasson2022-11-231-1/+1
| | | | | | | | | | | | | | | | Fixes: QTBUG-108388 Change-Id: Iec1cae2761129c5d64afadaebabc9e4bddc4ebe4 Reviewed-by: Topi Reiniö <topi.reinio@qt.io> (cherry picked from commit 57f98b1e5c7751e84816fb8e6be7827b2c11474a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Remove broken assert in QQmlPropertyData::setOverrideIndexSami Shalayel2022-11-221-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The assert leads to strange crashes, as it compares if an overriding and an overridden property share the same m_coreIndex and asserts when equal. This leads to crashes when overriding a function with a property and vice-versa, as those can have an equal m_coreIndex but still is a valid override. Fixes: QTBUG-108627 Change-Id: I67f91d5fdb93603ef95b9a4557fd064edc24721d Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit d6961c09de36e15c57f29109edf5fbfef53ef4d4) Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| * qmltyperegistrar: Tolerate and warn about invalid URIsUlf Hermann2022-11-211-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If you give qmltyperegistrar an invalid URI it should still not generate invalid C++ code. In fact the module will still be somewhat usable. You just cannot import it. Fixes: QTBUG-108647 Task-number: QTBUG-101072 Change-Id: I21232f99c1ef486a62dbe339f7d0ae1b9abc8871 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 88e96debfdad3961db3225de7b4c7f90afe7698e) Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
| * PinchHandler null target: remember accumulated scale between pinchesShawn Rutledge2022-11-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This restores behavior from b4d31c9ff5f0c5821ea127c663532d9fc2cae43e which got broken in fc636af3a723ee8b4ee42cf71864ae0df5ca4621. As documented, PinchHandler.scale is the accumulated scale that would be applied to the target item (even if there is no target), whereas activeScale is the scale during one pinch gesture. After the first gesture, these two values are supposed to diverge, even if there is no target; that way you can bind scale to some property, to scale something else in the same way that PinchHandler would normally scale its target. Fixes: QTBUG-108549 Task-number: QTBUG-68941 Task-number: QTBUG-92064 Change-Id: I32ff37e394fd8466128603eddd5697ba1cc1a0ed Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 3046fe153dd2c5679479eb512dcee6bdc80bd1cf) Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * CMake: fix configuring with -no-feature-testlibJohannes Kauffmann2022-11-171-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Without the Qt::Test target: - the QuickControlsTestUtilsPrivate target could never be configured correctly, because it depends on Qt::Test. - a CMake error would be thrown, because the find_package() call which searches for Qt::Test considered Qt::Test a required component. This, of course, doesn't have to be the case. Change-Id: I0db912352e83faefbfda448f21527908c7f4cf9d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 1214c070578b1b80b2ed2128e4e9145adb7dbd2b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Doc: Add missing QQuickWindow constructorHatem ElKharashy2022-11-171-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | QQuickWindow::QQuickWindow(QQuickRenderControl *control) should be part of the public API. The user can use QQuickRenderControl with QQuickWindow to control the scenegraph rendering. This constructor is used in the QQuickRenderControl example. Change-Id: I1bb38d64173c24ba835137897ef915dfde83b1f3 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit 7454d3b612eab92b8e91741fc1c51311cf80c3a2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * CMake: fix qmlimportscanner import argumentMorten Sørvig2022-11-171-3/+2
| | | | | | | | | | | | | | | | | | | | Make sure QT_QML_IMPORT_PATH gets prefixed with with "-importPath" when passed to qmlimportscanner: add it to qml_import_paths instead of directly to cmd_args. Change-Id: I1f9609bad0340d3d3acee369a3fd582c3239bb57 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 0155d55b78f412bb53d99a39ac92bf12ded03e72)
| * QuickTestUtils: Explicitly depend on NetworkFabian Kosmale2022-11-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The test utils require Qt's Network module, which they normally get transitively from the Qml target. However, that's not the case if QML is build with its network feature turned off. To prevent the build from failing, explicitily depend on Network. Original-patch-by: Julien Schueller Fixes: QTBUG-107472 Change-Id: If9b8ce2a2544b080264a31ed0596d1c6d9ca6825 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 1803d9c0bd3aa730e14d1573a763bb8ac29fc45e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Doc: Fix compilation errors in snippetSze Howe Koh2022-11-171-2/+2
| | | | | | | | | | | | | | | | | | error: Non-const static data member must be initialized out of line Change-Id: I2b2785529ac8fd0d81e49c226065d263df417e17 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 37730c6e1786e49083263c4deff5c37db7595cd1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Dialog: fix qmllint's complaints about StandardButtons enumMitch Curtis2022-11-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | Use QML_EXTENDED_NAMESPACE instead of Q_FLAGS to expose the enum. Fixes: QTBUG-104573 Change-Id: I1cf565b897171a6402320e2c9aeeaec39cf80dca Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit ff6243ec0299c1bb063a8c5c281f351dd6cf1a4f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * QQuickLabsPlatformFolderDialog: Modify the logic of setting the folderDuan Ting2022-11-171-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | In QQuickPlatformFolderDialog, when triggering acceptance, the folder is set by the value of currentFolder, and the value is set back to currentFolder inside the setFolder function. This action causes currentFolder to be abnormal after the folder is modified. Fixes: QTBUG-104629 Change-Id: I99978de5bbd019024c499c50f61d6e7b6e7dc140 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> (cherry picked from commit 5e8b7627565d408ed6dbd9f3a192d0bbeff6720e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Doc: Fix typoAndreas Eliasson2022-11-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | Fix subject-verb agreement and simplify sentence. Fixes: QTBUG-107480 Change-Id: Id90157b9fc5684e78aa8e11c456a0f4537b11c13 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> (cherry picked from commit 56371883fc27322b6193d153e5d9614bdc890e52) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Fix wrong item-sizeHint-cache when StackLayout children were reorderedJan Arve Sæther2022-11-172-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the Tests_StackLayout::test_addAndRemoveItems() autotest The code uses an index to look up the cached size hints. This index corresponds to the layout's item child index (which doesn't have to correspond to the children index). The vector of sizeHints then had to be in sync with the index of the child layout items for this to work. The problem here was that if the first item in the stack was removed (or siblings was reordered), the vector was not adjusted for this (basically we could get the size hint of an previously removed item). In order to avoid to keep the QVector<SizeHints> index in sync with the layout children index, we change it to use a QHash instead, where we look up by QQuickItem*. QHash<QQuickItem*, SizeHints> Task-number: QTBUG-106520 Task-number: QTBUG-106521 Change-Id: I7c1f9fb018fcab093b074c45dfaba264f76749f4 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit c41075d9e2808f636d793c93e237f80a8ecadb2e)
| * QV4: Avoid memory corruption in Reflect.applyFabian Kosmale2022-11-144-9/+27
| | | | | | | | | | | | | | | | | | | | | | | | This extracts the check from Function.prototype.apply into a shared function, and uses it in Reflect.apply, which has the same issue. Task-number: QTBUG-107619 Change-Id: I899464c86554f9bbb5270a95bbe3fe27531e9a27 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 0e963a53c04b0dbe172cfb495b4d62dc8e2f31a3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
| * QML: Check for stack overflows when creating objectsUlf Hermann2022-11-143-3/+24
| | | | | | | | | | | | | | | | Fixes: QTBUG-106875 Change-Id: I3b0abda6948b79a9e3cf263f27885037fff1804c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> (cherry picked from commit edc01fbfa430d6f0ce66f1871ab28e0f691ee252)
| * Handle missing stops gracefully in Shape gradientsLaszlo Agocs2022-11-141-3/+5
| | | | | | | | | | | | | | | | Fixes: QTBUG-108298 Change-Id: Ib6e004a1518aec4c786c3aeebcd74e6cb11f45ef Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit e52efc3defe102a55b45b013764ba1bae1fe5a1b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * QQuickTableView: detect if syncView topLeft has changedRichard Moe Gustavsen2022-11-141-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It can happen that the top left cell in syncView changes after a normal relayout. This is especially prone to happen if the cells used to be large, but are suddenly made much smaller, such that the top left cell ends up outside the viewport. This patch will detect this case, and ensure that the top left is being recalculated when they are no longer in sync. Change-Id: I80cad2859a35e0f3bc58f101696112be7c084175 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit f15528407033057fb5c6e6ba5bbe8e5936fe346b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * qmldir docs: Fix typoFabian Kosmale2022-11-101-1/+1
| | | | | | | | | | | | | | | | | | Fixes: QTBUG-106884 Change-Id: I57cf3f0c6cedbba0bf850165c99d673a65b90c56 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 6a9d50f88dcd7de5933686ca2cabb262ff5d0665) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Do not crash if madvise() fails on MADV_WILLNEEDUlf Hermann2022-11-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | MADV_WILLNEED is only advisory. The kernel may ignore it anyway. Any subsequent access to the pages in question will trigger them to be re-populated. Fixes: QTBUG-107774 Change-Id: I8d70003502fdeb3e53c169b28ea6826801d47c74 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 2034e10c9378364ecc7aa1af27505562d86688de) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Fix access to destroyed QRhi objectBumjoon Park2022-11-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | If QRhi is destroyed, the rhi member of QQuickWindowPriavte must also be initialized. Otherwise, it remains a dangling pointer and causes segmentation fault Fixes: QTBUG-108252 Change-Id: Ic1b003d28da0fd1163f80a913d9ca3b4a8bb1e1b Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit 5b24e324d34b30f17ab0c405b719d290929763e8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Make QSGRhiShaderEffectMaterial::type() safe with multiple windowsLaszlo Agocs2022-11-087-8/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The history of this mechanism goes back to early 5.0 days probably, when the case of showing multiple QQuickWindows was not always considered. Using a single data storage is not only unsafe when it comes to threading (if using the threaded render loop), but seems to cause visible rendering errors if certain conditions are met. (the problem is not strictly caused by emptying the list of QSGMaterialType pointers when a window goes away, that's safe in itself, but rather there is a chance of collisions then if 'new' gives the same pointer afterwards, breaking the uniqueness contract; or something along those lines) This is now solved by locking and making the storage per window, using the QQuickWindow as the key. Fixes: QTBUG-107818 Change-Id: I4f94c4bccb43c4db246aff02e0b809cc9f106e39 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit d7d44783cee166e0dd0c24b56478ab6d4c0c6cdc) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| * Fix performance issue with drag retrigger events for qtquick itemsSanthosh Kumar2022-11-072-11/+28
| | | | | | | | | | | | | | | | | | | | | | The items that reject drag events (specifically onEntered in DropArea) should not be retriggered with DragEnter event until entered once again. Fixes: QTBUG-74496 Change-Id: I241a6004da6382685be89fe8a001b98dfde5c8a2 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 0b7374fefa1abf08e956bc5d34008352144bd9ae) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Don't convert QByteArray in `startDrag`Fushan Wen2022-11-071-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QMimeData::setData expects the provided data to contain the correctly encoded QByteArray, so if the variant contains a QByteArray, then take it as is to avoid data loss. If the variant is not already a byte array, then we ideally would make sure that the mime type (i.e. the key of the map) and the QVariant's type are compatible (image/png with a QImage works; text/plain with a QImage does not). This changes behavior and needs to be a follow-up commit. Fixes: QTBUG-71922 Change-Id: I9b9f10fd332e1f9568f6835a69a1c359457f823c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 062f9bf57657b54dc708015ec5fed3c89e5cc3ca) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * ScrollBar: fix crash on exit when flickable created before ScrollViewMitch Curtis2022-11-031-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the case from the related QTBUG-106118, the ListView is declared before the ScrollView, so when the QObject destruction happens, it gets destroyed first. The ScrollView being destroyed causes the attached ScrollBar object to be destroyed, which causes the attached object to access the flickable (ListView) which has already been destroyed. So a workaround for the crash is to declare the ListView after the ScrollView. With typical usage where ScrollView is used as-is, ScrollView (and hence QQuickScrollBarAttached) is destroyed before the flickable. This patch removes the PRINT_LISTENERS macro from the original patch, as q_func, which it relies on, was not made public until 6.3. Fixes: QTBUG-106106 Change-Id: I8d0d5544ea28c1f1557abdc38d48b26d21a7f1f5 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit c6f51533d9d2aadd3441b3292b6ab5435c35a03b)
| * Remove unused QQuickGridLayoutEngine::alignment() functionJan Arve Sæther2022-11-022-8/+0
| | | | | | | | | | | | | | Change-Id: Ifc8312b796b2c58171957a6cf545571cf7df5ec3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit fcc4ead45ea9d7ccd5cdacaf83238997d4c6fb31) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Doc: add notes for customization of the attached ToolTip controlMitch Curtis2022-11-023-0/+15
| | | | | | | | | | | | | | | | | | | | | | To customize the attached ToolTip, it must be provided as part of the user's style. Task-number: QTBUG-107684 Change-Id: I8fd2c4c64ad7aad4b940031fb3638df211288903 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit e59c31c0afd128533bbe3edd93b516f0a693c221) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
| * Properly release Element data in the shadow treeLaszlo Agocs2022-11-011-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The suspicion is that in Qt 5 this was skipped because 1) releasing the generic allocation for any Element is done anyway due to destroying the m_elementAllocator, and 2) the only other thing releaseElement() did there was to release the extra data for QSGRenderNodes, which could thus be leaked, but render nodes are a rarely used advanced feature, and 3) upon closing a window, the scenegraph is torn down and the node-removed notification conveniently puts the Element data from the shadow nodes on the m_elementsToDelete queue (which is handled in the Renderer dtor); the same goes when dynamically removing a node at run time. So even if one cared about a few small leaks for apps with QSGRenderNode usage, to trigger this one would need to exercise some code path that created and released renderers, i.e. something with QSGLayer, and in a way that it does not lead to manipulating the scene graph. (so shader effects or Item.layer seem not to trigger this) In Qt 6 calling releaseElement() is important for the most common QSGGeometryNodes as well since there are additional resources to take care of. And therefore the test code's grabToImage() (which internally creates, renders, and then destroys a QSGLayer, and thus fires up and then drops a full Renderer, while not touching the scenegraph itself in any way) exhibits the problem much more clearly than in Qt 5. Fixes: QTBUG-108026 Change-Id: Id60dfca7921efc2f3057c9cb8cedb238a1db2ee5 Reviewed-by: Christian Strømme <christian.stromme@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 3b619f85aaaff997b5613f0add44098c8a3ca85c)