aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Improve QSGMaterial docsLaszlo Agocs2021-02-191-15/+31
| | | | | | | | | | | | | | Remove a Qt 6.0 editing issue where the docs continue saying "QSGMaterialShader and QSGMaterialShader", which is a leftover from 5.14/5.15 times when QSGRhiMaterialShader still existed. While we are at it, improve the code snippets and talk a bit more about type(), inspired by recent mailing list discussions. Change-Id: I4b21ed00285bf18e22e64a7574a273abdf8be3e5 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 258077e00eb8f3f4b0ef21a9a0395268b6c86532) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qquicktextinput: Fix validation for IM eventBartlomiej Moskal2021-02-192-2/+28
| | | | | | | | | | | | | | | | | | If validation did not pass after text pre-editing is finished, it need to be roll back to state before pre-editing started. Before this change, if validation did not pass, text was always rolled back to previous state. In pre-editing text case, it means back to the state in which part of the text was removed (and later changed to pre-edited text). It may cause a situation of removing part of the text that was already validated Fixes: QTBUG-90239 Change-Id: I3ec39e0f6b8a93d4e6fd190af30d4c80a0e495eb Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit b1ae151acc80254ab0ec2937c55b99223205875c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQmlPropertyPrivate::signalExpression: handle object being nullFabian Kosmale2021-02-191-0/+4
| | | | | | | | | | | | | | | QQmlData::get expects a non-null pointer, therefore we need to check whether the object still exists. Note that while this fixes the crash in the referenced bug, PropertyChanges still does not support a dynamic target. Task-number: QTBUG-46350 Change-Id: Ifeecf5df83e87468a1d314ce2b120006124d6f4b Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 1ff376e64bf5af6df7e0079700d2b9164037dc89) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* docs: Fix documentation of the Locale numberOptions propertyShawn Rutledge2021-02-191-1/+1
| | | | | | | | | | Document the property not the enum type. Fixes: QTBUG-91196 Change-Id: Id11a436caf1c683a0e70a1b8e8ce86c6118725d8 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 3670395af58f21f203ce2289a04feef7c6de53f5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix lookup of existing inline components by nameUlf Hermann2021-02-191-1/+1
| | | | | | | | | Previously this would always return the inline component iwth ID 1. Change-Id: I49dc6eb64fcd8428667f3b22afcb7212aa792db3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 7104a3a6f8fe518bd8a0d0d246c0f65df340ee38) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qquicktextinput: Fix Undo history for IM eventBartlomiej Moskal2021-02-151-4/+6
| | | | | | | | | | | | | | | | | | | Do not set m_cursor (cursor position) before calling removeSelectedText() in processInputMethodEvent(QInputMethodEvent *) method. Before this change, DeleteSelection command was added to history with new cursor position. If this command will be later rolled back, cursor position will not be set correctly. It should be set to position before handling the event. Task-number: QTBUG-90239 Change-Id: Ib5e46d232e6b32f904e745da4f9e5bc03a58963f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 6ec8c62ca22c363fa00e085de10198a90e3d65dc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* MouseArea: fix containsMouse behavior during visibility changesVolker Hilsheimer2021-02-121-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | QQuickItem returns whether it contains QGuiApplicationPrivate's lastCursorPosition. Since that position stores the coordinate last seen by Qt (the window border), it will always be within the window, and within an item that covers that part of the window's border. However, QQuickWindow stores the lastMousePosition as well, and resets that value when it receives a QEvent::Leave. We can use that to test whether the window that contains the item has seen a Leave event, in which case the item is definitely not under the mouse. Notes on the test: That we use QPointF() as the "reset" value leave the small possibility that the cursor might be at position 0,0 of the window (ie inside the window), and the QQuickItem there will not be under the mouse. We can't confirm this (through an expected failure test), as QTest::mouseMove interprets a QPoint(0, 0) as "center of the window". And since we can't simulate mouse moves outside a window's boundary using QTest::mouseMove, the test needs to explicitly synthesize a QEvent::Leave for the window. Fixes: QTBUG-87197 Change-Id: I04870d6e914092275d9d790312fc702fb99f2935 Done-with: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit ba1246c543118515ea244787f3d7f9c1133ccf0f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickWidget/Documentation: Mention the need to set the graphics APIFriedemann Kleint2021-02-111-3/+7
| | | | | | | Change-Id: I3b60586604003e360070a0d481e1a3df2e087e5c Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit 80bc943025398d0cdb29e4edbe096d8ac127263e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QJSValue string parameters used in signalsMaximilian Goldstein2021-02-111-1/+1
| | | | | | | Fixes: QTBUG-86482 Change-Id: If938fad22f51b08fe3cb20b94634efe46a1eed47 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit e887f25dd6c4c9630a7367c3a2ed95a284191843)
* Return errors if validation of inline components failsUlf Hermann2021-02-091-1/+3
| | | | | | | Fixes: QTBUG-90038 Change-Id: Ic01b5d097e0b9e6720bcec7ccb18c22abb5418f4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 001596d472557bca08eb93159e724301dea88ad6)
* QSGBatchRender: avoid crash if buffer shrinksFabian Kosmale2021-02-081-2/+2
| | | | | | | | | | | | | The QRhiBuffer does not shrink; thus we can end up with buffer->buf->size > buffer->size. This would subsequently lead to an out-of-bounds memory access, and a crash. Fix this by using the uploadStaticBuffer overload which takes the size. As a drive-by, remove pointless QByteArray::fromRawData call. Change-Id: I40058ada6a6a5eb745ae559e8c9ed474fd41f75c Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit f0a51eef5696782ec325b20f14cfe353d0a58d20) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Do less work when there are no active ImageParticle particlesMichael Brasser2021-02-063-8/+29
| | | | | | | | | | | Don't mark geometry and material as dirty if there is nothing to change. Task-number: QTBUG-41867 Change-Id: I016d2d76f4ebf731f5bfc931ba616ee5d074bc65 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit e3cb305a6a19bf394c1068a7e483e1c95e11c22b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickItemParticle give() method kill particleFabio Falsini2021-02-051-0/+1
| | | | | | | | | | | | | | | Currently removing an item connected to a particle only invalidate the particle that will be reused for the next item set. This has the effect that the new item inserted appears in the same position as the old one just removed. This patch force killing the particle to assign next item to a new particle starting from initial position. Change-Id: Ic937a6d7aea65368cceb1405bb81ef1502d988a5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit d0b1bef8b889ab852eaf906fdc9cd4219238872e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QSequentialAnimationGroupJob: Protect against self-deletionUlf Hermann2021-02-052-9/+9
| | | | | | | | | | | | setCurrentAnimation() can indirectly delete the animation group job itself by invoking the animation controller. Use the RETURN_IF_DELETED mechanism to avoid the resulting dangling pointers. Task-number: QTBUG-90401 Change-Id: Ibd0ad21e8d3af4760604c3ff37dc46101d5f49ad Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 680f28b08f65ad38c8d5498b5738231b2a2779a3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Invalidate external renderpass descriptors from Quick3DLaszlo Agocs2021-02-053-0/+19
| | | | | | | Change-Id: I362b35b3d038d4fb24fab0e73cb120027f2308ea Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 93fe74ca433850e505f8f8940e99f3bf6a6dc050) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQmlIRLoader: Actually load RequiredPropertyExtraDataFabian Kosmale2021-02-031-0/+7
| | | | | | | | | | | | | | | | If a QML component wants to mark properties of its "parent" component as required, it can do so via required propertyName The information about those properties is stored in a RequiredPropertyExtraData data structure. This structure is already serialized to disk in the QQmlIRWriter. However, we neglected to restore it so far in the loader. Fixes: QTBUG-90538 Change-Id: I789daff9bc881e4f35c942c77f5116b5284de81b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit b322a971f06823a4356f2b3aa331501aa4d0dc7f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove superfluous include directiveFriedemann Kleint2021-02-031-1/+0
| | | | | | | | | | | | It is not conforming to the include conventions (module missing) and thus breaks the Qt for Python doc build. Introduced by 48b4c1f450109b148f03f62574d78b460859c4a1. Change-Id: I1ff56a967c457f1909b7f6e2e430458e3a3f47c9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit ecd54e68b90ad7022d1bdb71f1c1640ab392adae) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QuickTest: Do not recurse forever on inline components in enumerateTestCasesFabian Kosmale2021-02-011-1/+4
| | | | | | | | | | | | | | | | | | | | | In TestCaseCollector::enumerateTestCases, we visit the super compilation unit of QML tpyes to check if they might be instances of TestCase. However, in the case of inline components, the super unit is the current compilation unit, and we would recurse endlessly. This does not address the issue that an inline component might actually inherit TestCase. However, as this only affects the enumeration output and does not actually affect test execution, this is not that much of an issue. It should also be noted that the enumeration also fails in any case where TestCases are loaded dynamically (with a loader), so the method is not 100% accurate even in the absence of inline components. Fixes: QTBUG-90740 Task-number: QTBUG-90762 Change-Id: I7e133d62c4f62fc46e9bd3999ff755f7ded3c386 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit edca9f3d60141a823a3b4401039f260c2c7f7888) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickWindowIncubationController: Use QPointer to guard QSGRenderLoop referenceMike Achtelik2021-01-261-3/+3
| | | | | | | | | | | | | | In some cases, when the QGuiApplication is shutting down while there is an active QAnimationDriver and an incubating object, the QQuickWindowIncubationController will try to access an already destroyed QSGRenderLoop. So use a QPointer to guard the QSGRenderLoop access. Fixes: QTBUG-90489 Change-Id: I528e06ff22dfcad804593db6771d9163b21808f4 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit bac93541ba324e75c532c1987e861109e1c5b131) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* export QAcccessibleQuickItemJan Arve Sæther2021-01-221-1/+2
| | | | | | | | | | | | This is needed in order to make controls in qtquickcontrols2 module more accessible. Their accessibility implementation can now inherit from QAcccessibleQuickItem Task-number: QTBUG-75042 Change-Id: I30deba018825937a4ebd757e5250efca87519822 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 21b975f186e6cec81914b6ee9a6aae5b847069d1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QAnimationGroupJob: Don't call virtual functions from dtorUlf Hermann2021-01-222-23/+42
| | | | | | | | | | | | | The subclasses are already dead at that point. We don't need to notify them anymore. Rather, refactor the code so that we can clean up QAnimationGroupJob itself without virtual calls. Task-number: QTBUG-90401 Change-Id: I6917bf299ceb1383b9d29687e5bf53ae36803ecf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 75437f824d4c3a608af9eb1afddcb4d8c1a25944) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Ensure we cancel touchMouseSynthesis upon receiving touchCancelRichard Moe Gustavsen2021-01-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | As it stood, we wouldn't cancel touchMouseSynthesis after receiving a touch cancel event. The result would be that the first touch event sent to QQuickWindow thereafter would have touchMouseId set to value different from -1. This again would fool QQuickWindow into believing that the event belonged to a touch event it has synthesized before, and it would as such take a different/wrong path for delivery. This caused text selection to fail on iOS, since a press-and-hold on a line edit from QPA would cancel the touch event and show a magnifier glass. When the user later touched inside the line edit again to move the cursor, this new touch event would not be delivered to the text edit. Fixes: QTBUG-90485 Change-Id: Iad640ae57317ea86ee68ca053654b0b30ade003a Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit a738c3566790c6e9abeea3c4c3dacfceaa82f66a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Change QQuickShortcut::setSequences to bind to all sequencesAndreas Buhr2021-01-151-23/+60
| | | | | | | | | | | | | | | | When binding a Shortcut to a standard key sequence like QKeySequence::FullScreen, it binds only to one key sequence, even though there might be multiple key sequences associated. This patch changes the code to emit a warning in this case and allows to bind to multiple key sequences using 'sequences: [ <key> ]'. Fixes: QTBUG-88682 Change-Id: I88998aa8858d8f2c0c86e46bae94afd7ceb15b66 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 6511b17038627ac30cb6622b13c7d46d9877bac5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Pass QWheelEvent data to QML engine via QQuickWheelEvent pointerVolker Hilsheimer2021-01-155-18/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Passing events as objects or references in signal parameters requires copying, and we removed the broken copy semantics from QEvent for Qt 6 as much as possible. QVariant::fromValue still allows creation of a QVariant from a type that doesn't have a (public) copy constructor, which is why this passing of a QWheelEvent through a QVariant to QML went unnoticed. While QWheelEvent is a gadget and thus supposed to be invokable from QML, it's still a QEvent. Most QEvents are not gadgets - like QKeyEvent, QMouseEvent, QTouchEvent. We have QQuick*Event QObject wrappers instead to provide access to the low level event data from QML. So, use a single QQuickWheelEvent object instead to pass the data to QML, that class is designed for exactly that prupose. We need to copy the data anyway, and since we don't need to create/destroy the wrapper object for each event, this has no practical overhead. Extend the QQuickWheelEvent to provide access to the phase information of QWheelEvent as well, and simplify the reset() method. Note: making the QQuickWheelEvent store the QWheelEvent directly would allow passing calls to setAccepted through to the QWheelEvent. That is left for a future cleanup, and another reason for not passing events around as copies. Fixes: QTBUG-89594 Change-Id: Id86a9b30c5a8c7c50091e464e368568a7f5ca2ea Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 2b15a1fbe2f26a090f79ab5aa238f375bc67fda3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQmlComponent: Avoid crash when setting initial properties in JS moduleFabian Kosmale2021-01-151-1/+2
| | | | | | | | | | | In a JS module, we lack a qml context. Thus, we have to check whether qmlContext is null. In that case we use the engine's scriptContext('s ExecutionContext) instead. Fixes: QTBUG-90245 Change-Id: I337e9c7cade472f52fc81c93d1152ff59f8018a5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit e68b498424f63c1cb6151e4fc6bbc50bac584909)
* QuickLayouts: fix crash when layout width depends on parent widthIvan Solovev2021-01-151-2/+2
| | | | | | | | | | | | | | | | | | Some tricky cases of setting layout width based on parent layout width were leading to infinite recursive loop of layout size calculation (see the attached example in the related Jira task). Initially the QQuickGridLayoutBase::rearrange() method already had a recurse check, but it seemed to happen too late, so that the recursive calls kept happening from the ensureLayoutItemsUpdated() calls. This commit moves the recursion check up, so that it's actually executed before we have a chance to get to the next level of recursion. Fixes: QTBUG-87253 Change-Id: I473ee219e7b5b13547e33ebbd3a6d884de2c7d45 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> (cherry picked from commit 4f8041b01445fd4eec0beb133719645d00d0b2ac) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Flickable: ignore trackpad events with px deltas in disallowed directionShawn Rutledge2021-01-151-5/+18
| | | | | | | | | | | | | | | | | If Flickable.flickDirection == HorizontalFlick, then if the accumulated QWheelEvent::pixelDelta()'s abs(dx) > 2 * abs(dy), clearly the user is trying to scroll horizontally; otherwise, don't accept the event. That way the event is allowed to propagate to a parent Flickable that does allow flicking vertically. Likewise if the nesting is the other way around, only allow the inner vertical Flickable to accept if the flicking is actually vertical. Fixes: QTBUG-57245 Fixes: QTBUG-80236 Change-Id: Ieb0bf9310a67210ce7e9fe7a80c88baef2cc7ede Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit dccd8f0b5ca8f6faefb49718e33f9090243f3202) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix Text with ElideRight not being rendered when width goes from 0 to >0Fabian Kosmale2021-01-141-1/+4
| | | | | | | | | | | | | | | | | | | QQuickText attempts to reduce relayouting. However, it was a bit to aggressive in doing that. If only the width changed in a geometrychange, it would not relayout if widthMaximum was true. However, if the width goes from 0 to greater than 0, the value of widthMaximum should have actually been false (but we would only notice this after relayouting). Thus, don't skip relayouting in that case. Amends 56ade46b4234bb828b8e4f9a6bf83b5687bd122e, which fixed the same issue, but for height. Fixes: QTBUG-83408 Fixes: QTBUG-33608 Change-Id: I14b610c703eb0496c71de7b12ad9fcf16842af64 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit 127c79fb7fda16b9a48ce8c425d1700d1aa7502d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QQuickShortcut::setContext so re-grab all shortcutsAndreas Buhr2021-01-131-0/+7
| | | | | | | | | | | | | A while ago, QQuickShortcut was extended to not only have a shortcut m_shortcut but in addition a list m_shortcuts. During this extension, the setContext method was missed: Shortcuts in m_shortcuts are not re-grabbed on context change. This patch fixes this. Task-number: QTBUG-88682 Change-Id: Ie73d516f2a325a328b6e975d69490eea29a18401 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 28f515e6334fd1c15a2f7f18de6be7bfe1f9c302) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* ListModel: Fix move handling in syncFabian Kosmale2021-01-131-3/+23
| | | | | | | | | | | | | | | | | When a ListModel is modified in a workerscript, we reconciliate the state in ListModel::sync. However, the logic for moving elements was wrong, causing crashes in endMoveRows due to invalid moves. This patch ensures that elements are moved to the correct position. Notably, whenever an element is moved, we must update the targetIndex of all elements affected by that move. Amends 3accc1dae76575120e71cadb547e961ecd50bcb0. Task-number: QTBUG-85557 Change-Id: I1a1ffa43eab39ed2315f1916527d897b208c2c3b Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> (cherry picked from commit 2996439993c587bc9c7169e4f152169f28247c21) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Regenerate Shape fill geometry when alpha changes to non-zeroLaszlo Agocs2021-01-131-0/+4
| | | | | | | | | | | An alpha of 0 removes the scenegraph node for the fill. If the alpha changes to non-zero afterwards, the geometry needs to be regenerated. Fixes: QTBUG-85103 Change-Id: I180b9eb78bd98b99bc87c4d960108b95eb6ae723 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit a129c02e7b0d9977eafa66dc191ef185774f461e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Add links to examples of Qt Quick Particle SystemNico Vertriest2021-01-121-0/+6
| | | | | | | | | | | Doc Using the Qt Quick Particle System did not contain links to examples. Fixes: QTBUG-29378 Change-Id: I82e3a3af4925f7c8e58ce6a5c5af57b854cb9e36 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 24372250debc0a067470392776a178b155cedf3e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: mention that Item's childrenRect property is local to the itemMitch Curtis2021-01-052-0/+76
| | | | | | | | | As opposed to being local to the item's parent. Change-Id: Idcf2cdbedcac24a6890ce761c3f2a23f2c7a8dc4 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit a0769549cdb81c7104b60c2a67dfa62e8c42c224) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Fix broken QDoc markupPaul Wicking2021-01-051-2/+2
| | | | | | | | | | \code must be closed with \endcode. Fixes: QTBUG-89738 Change-Id: I0cadb14b6726a6fdc6c3fb773155066d30490e74 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 357e426d9849a048d3063030f2a1355f22c259e0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* doc: explain QQItem event delivery, handlers, setAcceptTouchEvents()Shawn Rutledge2021-01-051-4/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | We quietly recommended calling setAcceptTouchEvents() in the Qt 5.10 release notes in any Item subclass that wants to receive touch events, and in the docs for setAcceptTouchEvents() itself; but the message about the impending behavior change might not have been obvious enough. In Qt 6 it becomes mandatory, so clearer docs will hopefully help to stave off bogus bug reports. We also never had a great overview of event handling from an Item's perspective; now it's a little better. Followup to ab91e7fa02a562d80fd0747f28a60e00c3b45a01 and a97759a336c597327cb82eebc9f45c793aec32c9 [ChangeLog][QtQuick][QQuickItem] When subclassing QQuickItem, you should call setAcceptTouchEvents(true) if you need the item to receive touch events. It will be required in Qt 6. Task-number: QTBUG-87018 Task-number: QTBUG-87082 Change-Id: I1c7a43979e3665778d61949c9d37c1d085ed594b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 7c648280bb53c4276ba4ae2abf26d070fedde71a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* JIT: When making memory writable, include the exception handlerUlf Hermann2020-12-187-18/+40
| | | | | | | | | | | | | makeWritable() rounds the memory down to the next page boundary. Usually we include the exception handler this way, unless the offset from the page boundary is less than the exception handler size. Make it explicit that we do want the exception handler to be writable, too. Fixes: QTBUG-89513 Change-Id: I2fb8fb0e1dcc3450b036924463dc1b40d2020c46 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 86a595b126bc6794380dc00af80ec4802f7d058c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix crash during model resetJoni Poikelin2020-12-171-0/+5
| | | | | | | | | | | Commit 37fcffa035d55ac00f85f57ce1390fff3be213c6 fixed the issue for remove rows, but it can also happen with model reset. Fixes: QTBUG-83352 Change-Id: I0ec1a67e822e4f8fe5b8f87f38dfae1f26b3fab5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit d99d192884608408759492bd656ab99a2f4f23ed) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QML: Fix proxy iterationFabian Kosmale2020-12-171-2/+6
| | | | | | | | | | | | If the target of a proxy was extensible, we did not set the iteratorTarget to its correct value, and thus the ForInIteratorObject would not be usable. Fixes: QTBUG-86323 Change-Id: Id1924ac4087bab38c006b8eba92b619b79d36b7a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit dd740d6b3469448dc1fd31c1742781e923e9f274) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickShapeGradientCacheKey: Fix a MSVC integer conversion warningFriedemann Kleint2020-12-171-1/+1
| | | | | | | Change-Id: Ie81bc6504cb79fbfe30d552a85016f5acf0ff6f3 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit 0d7faa3cbbffbdc45eb3ca3c996e5e7d8cf85bdc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QV4 Engine: Remove MSVC special casingFabian Kosmale2020-12-153-18/+2
| | | | | | | | | | | This patch removes a workaround for old versions of MSVC; we should be able to rely on the standard library nowadays. Original-patch-by: Alexander Neumann Fixes: QTBUG-89203 Change-Id: I8047565000fc7e4e3b8ac28584ff4a479b648274 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit fb4de27768935393744cbd67e9789d325e70e742)
* CMake: Regenerate projects using pro2cmake one last timeAlexandru Croitor2020-12-103-8/+6
| | | | | | | | | | And fix up some incorrect qmake project files Change-Id: Ia6d27ac68195635021fe7c4a5f06386a60f3f323 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit c1c4a874e31ba108a3600fbbb0aee7fc0bf34601) Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: Disable static plugin imports for qml static pluginsAlexandru Croitor2020-12-101-0/+3
| | | | | | | | | | | | | There is no point in generating cpp files containing Q_IMPORT_PLUGIN() macro calls for qml static plugins. It causes unnecessary compiling of 10+ files for each such plugin. In a static Qt build, plugin imports should only be done for executables, tools and applications. Change-Id: I9d02ca9272a0765e2620cd8860afadd8546e3c37 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 4e7ee1279cad0f49483895c3237fd86a6359aedd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Show a tableview even if the syncView has an empty modelAndy Shaw2020-12-091-5/+2
| | | | | | | | | | | By showing the tableview, we can be sure that headerviews will be visible even in the syncView has an empty model. Fixes: QTBUG-87526 Change-Id: I68c8b119122a2d2f88c2afbeb2d6c71a83a3ce33 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 27c254203b3e7dd6d3a4445feb205fbe98c32d30) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Fix occurrences of \Q_OBJECT in code snippetsTopi Reinio2020-12-086-73/+260
| | | | | | | | | | | | | | | 'Q_OBJECT', even in a comment, interferes with automoc. Prefixing it with a backslash solves the automoc issue, but documentation looks wrong as content inside \code is taken verbatim. Move code snippets to doc/snippets and refer to them with \snippet commands. Change-Id: Ied7fdf87ef5edd2b237498b91b162c19bf7bc636 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit ed6f55ca126c80514e886b3b400a22ba5d443589) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Kill Flickable's wheel momentum if angleDeltas not multiples of 120Shawn Rutledge2020-12-072-34/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Wheel momentum is great on old "clicky" mouse wheels: they feel really clunky without this feature. But it's also terrible on most laptop touchpads. We still aren't generating QWheelEvents with pixel deltas and ScrollPhase on most platforms (still only on macOS); but eventually we should. However, those laptop touchpads tend to generate angleDeltas that are not multiples of 120. Added logging categories qt.quick.flickable qt.quick.flickable.wheel and qt.quick.flickable.velocity. [ChangeLog][QtQuick][Flickable] Flickable now tries to detect whether you're using a "clicky" wheel on a desktop mouse. A laptop trackpad can generate QWheelEvent::angleDelta values that are not multiples of 120; in that case, smooth scrolling with momentum is disabled, to avoid losing control of scrolling. Set the environment variable QT_QUICK_FLICKABLE_WHEEL_MOMENTUM_ENABLED=0 to opt out of the old behavior entirely, or set it to 1 to opt in unconditionally. Task-number: QTBUG-38570 Task-number: QTBUG-56075 Task-number: QTBUG-80720 Task-number: QTBUG-82565 Change-Id: I0da2d31259fa1c79ab217a3fa9e888893fc7b235 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 33c87736db7ec79c89c0497192727697d126628d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid unused parameter in QSGRhiSupport in certain configsLaszlo Agocs2020-12-071-0/+4
| | | | | | | | Fixes: QTBUG-88604 Change-Id: Id84faf648656993777f780e147917151ce05d3e0 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit b0f49c89780c7a1ce90b2c4e161bbba0d0beb868) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove unused functionVolker Hilsheimer2020-12-041-3/+0
| | | | | | | Change-Id: I7ee5187b4e17f2aba2788adfb47325f7a7020d69 Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit 628af504fced03c41269749634b830775412410d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix qdoc warning, document macro parameterVolker Hilsheimer2020-12-041-1/+1
| | | | | | | | Change-Id: I60c3d9cc34bc658d5317da951cc1975990f27a9b Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> (cherry picked from commit e070e571d184b4f6eb1f065009aac0779d004f29)
* qmlfunctions.qdoc: Add QML_IMPLEMENTS_INTERFACESMaximilian Goldstein2020-12-041-1/+16
| | | | | | | Change-Id: I4ff76b49bd5f40eb58c9f44669bb4836dd9e48be Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 7b89ae6ef4158dcbd1940e088c84eba747c166bc) Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Document how to use CMake for Qt QuickKai Koehne2020-12-043-1/+41
| | | | | | | | Task-number: QTBUG-73058 Change-Id: Ie72c1f4331ad05f31d9a646730133c97c4b15790 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit c8b108ca76e29d5c1b55468a9659eef80a6afa86) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>