aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
Commit message (Collapse)AuthorAgeFilesLines
* QQuickItem: Do not dereference nullptrFabian Kosmale2021-03-311-1/+2
| | | | | | | | | | | During engine shut-down, the delivery agent might already have been deleted, but we still get a call to setEffectiveVisibleRecur. Thus we need to check that the agent is non-null. Change-Id: Ie2d5923d686789c0758913799ff0702a85a55402 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit f8fc2d11a9cb2c55f4efc4a089663967ff78cc0b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Consistent naming for (to|from)Is(Defined|Sourced) in animationsAndreas Buhr2021-03-316-41/+40
| | | | | | | | | | | | | | | | | To store whether "from" and "to" values are defined and/or sourced, QQuickPathAnimationUpdater used fromDefined format, QQuickAbstractAnimationPrivate used fromIsDefined format, QQuickAnimationPropertyUpdater used fromIsDefined format, QQuickAnimatorPrivate used isFromDefined format, QQuickBulkValueAnimator used fromDefined format, QQuickAnimationPropertyUpdater used fromDefined format. This patch changes all these to use the variable names "fromIsDefined", "fromIsSourced", and "toIsDefined". This makes the code more readable. Change-Id: Ia6c228208eb651247b0ba70f83afadb5b1027049 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 702b00bc8bfdc51592a01c9b7ed5939d85a7e192)
* QQuickSinglePointHandler: don't reset the point in hover handlersRichard Moe Gustavsen2021-03-305-5/+18
| | | | | | | | | | | | | | | | | | A HoverHandler should not reset the reported position when it receives a mouse release. As it stands, a HoverHandler, like all the other SinglPointHandlers, will emit a position change of (0, 0) when clicking on it. This patch will factor the reset code into the virtual handleEventPoint(). By doing so, the subclasses can choose to call the base implementation to opt in for the "reset" logic. This patch will let all the subclasses, except HoverHandler, do that. Fixes: QTBUG-83980 Change-Id: Idc5720a2aad2b0b5714807965e0edc4e8325bfdc Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 79cde77f23358adbe57ab8ce08730d2de5bb1288) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* DelegateModelGroup: Fix bug where item could be removed from the modelJan Arve Sæther2021-03-291-9/+93
| | | | | | | | | | | | | | | | | | | | | | | If an item was removed from the DelegateModelGroup before it was completed it caused subsequent items in the model to be missing in some cases. The reason was that while populating the ListView, it iterated with an index for each item to call createItem() on. However, createItem() might call onCompleted (which in the case of QTBUG-86708 removed the item from the DelegateModel), which caused the next index we called createItem() with to be wrong (it became one step ahead). We therefore add a helper class MutableModelIterator, which keeps track of if a index in the model got removed (and if the iterator index needs to be adjusted because of that).... Task-number: QTBUG-86708 Change-Id: I33537b43727aed4f2b9bdda794b011b6684c44b4 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 0ff9db566c48172c688bf9327fe6a781dc4a1c34) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickTableView: always update content size when rebuilding small tablesRichard Moe Gustavsen2021-03-272-2/+26
| | | | | | | | | | | | | | | | | | | | | If you have a TableView with only a couple of rows, and you add a third one, the contentHeight doesn't update. This is fine if not all rows are loaded (some are outside the viewport), but when they are all inside, it should update to reflect the exact height. The same is also the case for the contentWidth. If you add a new row that increases the with of a column (and all columns are visible), the contentWidth should update. This patch adds an extra check when we do a rebuild (which we do when you add a new row), to see if all rows or columns are loaded. And if that is the case, we update contentHeight or contentWidth, respecitively. Fixes: QTBUG-92099 Change-Id: I806bfb7c3606fca97c5d27cbb91856cc40df9fb8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit d6a5afd120838647e0dd2a420dacf06389f0a48e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Warn when requesting GL/Vulkan but Qt is not configured for thoseLaszlo Agocs2021-03-261-0/+5
| | | | | | | | | | | | On embedded and mobile it can happen that the Qt build has no Vulkan support (because it is not there or not detected in the sysroot), and while this is visible in the configure output, it is best to make it also clear at run time. Change-Id: I316671a04aba80d38d2f8514695f55b05fb94dbd Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 4b83ae6472b30626c3492442a91125830ce28ebe) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* PinchHandler: scale incrementally when new pinch gesture beginsShawn Rutledge2021-03-253-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | When the gesture begins, we begin multiplying the target item's scale by 1.0 at first; it doesn't make sense to start immediately with the accumulated scale remembered from previous pinch gestures, because the target item remembers its own scale. When QQuickPinchHandler::wantsPointerEvent() returns false because some irrelevant gesture was received (for example a PanNativeGesture), that's not a good reason to deactivate. Deactivating and re-activating with each ZoomNativeGesture event results in extreme behavior, because PinchHandler depends on the BeginNativeGesture and EndNativeGesture events to reset internal state. Likewise, the fact that the button state is NoButton is not a good reason for wantsPointerEvent() to return false. Added an autotest: the first of its kind that actually simulates the native gesture events. Fixes: QTBUG-92064 Change-Id: I3a9b92d70f99497ee58ad8557d90d521fbe16d41 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit fc636af3a723ee8b4ee42cf71864ae0df5ca4621) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickTableView: forceLayout() should work, even when no items are loadedRichard Moe Gustavsen2021-03-241-3/+9
| | | | | | | | | | | | | | | | | | As it stood, we would return early from forceLayout if no items were loaded. This made sense, since when no items are loaded, there would be no items to lay out. But after we changed the logic so that an application can show or hide rows and columns by returning an empty size from the size providers, we now always need to do a layout to check if some rows or columns should become visible. Fixes: QTBUG-92076 Change-Id: I2a07bf8e62cfeebcbe36c01aa92eca3ed8227cd3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 9ba9336ec4515d157a1207fad1dcd2de311527ac) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickItemAnimation: close potential memory leakVolker Hilsheimer2021-03-231-7/+4
| | | | | | | | | | | | | Fix static analyzer warning bff6cb4333f531d5a72f7bf6dc1485f6. If ownership of viaData is not passed to the viaAction, then the object might be leaked. Use std::unique_ptr to make ownership transfer explicit and implicitly delete unowned objects. Change-Id: I89f2a6b630941a98a74db302bc1ab08055c71974 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 78aea267209c34abeb4895712dc76c923aa46165) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Call commitTextureOperations for small atlas texturesRoman Genkhel2021-03-231-1/+3
| | | | | | | | | | | | Atlas textures with size not greater than QSG_ATLAS_TRANSIENT_IMAGE_THRESHOLD are not visible Fixes: QTBUG-91182 Change-Id: I4e72e1c32c15b9e1a21cdb07262f219cc641bb5f Reviewed-by: Jaeyoon Jung <jaeyoon.jung@lge.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit a7b32a3e893892fc96d58af110af568043f09e72) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Revert "Use unique_ptr to clarify ownership of QQuickDefaultClipNode objects"Volker Hilsheimer2021-03-221-5/+5
| | | | | | | | | | | This reverts commit 02c6e7bc3aca42a188b772aa9794b919e60017e7. It broke text selection, the currentClipNode pointer must not be reset to nullptr even if ownership is transferred to a node. Change-Id: Ia66f7ed4be17916f3725bd3cb2cbd0e7c9d6327a Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit 68324c56c1b8f4ad5dfcdc6f77abda3eedaf2dfd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Add missing } and indent accordinglyAndy Shaw2021-03-201-1/+2
| | | | | | | Change-Id: I11331f0f0434f2888d1f64aa01f999f42a15bdda Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 13ab07e932725d8c76208c265b60031e37305704) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Clean up QSGRhiSupport wrt static functionsLaszlo Agocs2021-03-203-23/+19
| | | | | | | | | | | Make static everything that can be static. At the same time, make configure() non-static. Does not change behavior in any way, but this is the more logical approach. Also more future proof. Change-Id: I601d59a0547106802f330a7551a97186cde481e0 Reviewed-by: Christian Strømme <christian.stromme@qt.io> (cherry picked from commit fb8ba3f7250f837dd29600d30108ba6f4470a727) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use unique_ptr to clarify ownership of QQuickDefaultClipNode objectsVolker Hilsheimer2021-03-191-5/+5
| | | | | | | | | | | | | | | | The clang static analyzer warns in 3df1fff15a10a64372ed4f92ba05271f about a potential memory leak. While that particular claim is a false positive (the loop is always entered if sortedIndex is not empty), the re-use of the currentClipNode variable makes it hard to follow the object ownership, and there might still be a potential memory leak. Use std::unique_ptr to force explicit transfer of ownership, and get implicit destruction of objects not owned at the end of the scope. Change-Id: If826e1d81b92f1da60aae2262b628dcaaa2e592a Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit 02c6e7bc3aca42a188b772aa9794b919e60017e7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add assertions and checks on QQWinPriv::deliveryAgentPrivate()Shawn Rutledge2021-03-191-23/+55
| | | | | | | | | | | | | | | | | | | The static analyzer found the case where it could actually be null during delivery of a WindowDeactivate event. In other cases, we assert rather than testing, until we know that it can actually be null. It shouldn't often be null because it's created in QQuickWindowPrivate::init() and destroyed in the destructor; however we've already seen races when event delivery continues while the window is being destroyed. If more such cases materialize, we can replace asserts with if()'s or check the new inDestructor flag. Fixes static analyzer warning 16738055c4c458145b59ad9b6bb643b5 Change-Id: I408e9a7d71a77fd29c2af91e59caf9ede6585af9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit fb69e86bee67a228ca581a8bfe3384da14398f76) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickWindow: don't leak old screenChanged connectionsAndreas Hartmetz2021-03-121-4/+3
| | | | | | | | | | | | | | | | | | Connections could accumulate. Because the newest one was invoked last due to how signal-slot invocations are ordered, rendering was correct, but the stale connections caused unnecessary updates (and wasted a small amount of memory). This comes from a misunderstanding I had at the time about how QMetaObject::Connection works. Destroying or overwriting one does not affect the actual connection. While at it, also modernize the connect(). Change-Id: Idde81bdbff8947ed517bf2740d623a395c0acb74 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 9f8292d48913c5bc50377749c2b3e030cf16d703) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Port shader code example in GridMesh docsLaszlo Agocs2021-03-101-13/+23
| | | | | | | Change-Id: Ic3a11d24fdc02fa383350997083b38407d75feab Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit ef16f8876d70c9fab4780f5063dc463e38ba3056) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix click-to-focus in items within subscenes; improve loggingShawn Rutledge2021-03-044-23/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the ability to focus an item by clicking (such as a TextInput) when it's part of a subscene mapped to a 3D object in Qt Quick 3D, even if there are multiple subscenes with focusable items. QQuickDeliveryAgentPrivate::setFocusInScope(subsceneRoot, textInput) for example did not succeed; for one thing, this check fails: // Does this change the active focus? if (item == rootItem || scopePrivate->activeFocus) { because in a 3D scene, so far the viewport has focus by default, so the given scope (subscene root) does not have active focus. Each window ultimately has one actively focused item, so we need to delegate to the delivery agent belonging to the window's root item, to set its active focus. It's not even clear whether it's really a good idea for each subscene delivery agent to have its own QQuickDeliveryAgentPrivate::activeFocusItem. It might give us flexibility: perhaps each subscene root item should be a focus scope, and each delivery agent should decide which item would be hypothetically focused if the whole subscene got focus. But for now, it seems enough to set the activeFocusItem on the root item of the whole scene. Another problem was that when QQuickItem::forceActiveFocus() goes up the parent hierarchy, it didn't find a focus scope. So when you clicked on a TextInput that already had its focus property set to true, 1) QQuickItem::setFocus() does nothing because d->focus is already set 2) QQuickItem::forceActiveFocus() did not find a parent focus scope Therefore neither of them changed anything, and it wouldn't get active focus. Setting the ItemIsFocusScope flag on each subscene root item fixes (2), and that seems to be enough for now. Another problem was that QQuickWindow::event() was calling QQuickDeliveryAgent::grabberAgent() even when delivering an event that is NOT a press event, in spite of the comment "When delivering _update_ and _release_ events to existing grabbers, use the subscene delivery agent, if any." A hover event often results in a HoverHandler getting a passive grab, but that passive grab is not a reason to deliver a subsequent press event to the same subscene. When the mouse moves, we need to start over with picking in the 3D scene. When the 60fps frame-synchronous hover event occurs, we need to start over with picking, in case 3D objects are being animated under the cursor. When a press occurs, we need to start over with picking in case the press occurs in a different location from the last hover (even though that's unlikely with a mouse, it happens easily with a touchscreen). Another problem was that QQuickItemPrivate::deliveryAgent() was not finding the subscene DA during delivery of key events. A child item's extra is often not allocated, but we still need to keep looking at the parents. The optimization from 68c103225f4e8bd6c1b18ef547108fd60f398c0f was also wrong: after an Item's default initialization, we always need to do the search for the subcene DA. Only if we are sure that the item is NOT in a subscene (as in all normal 2D scenes) we can avoid doing that search next time. Consolidate the number of lines of output in the qt.quick.focus logging category and show the activeFocusItem transition. As with most logging in Qt Quick, it's expected that you set QT_MESSAGE_PATTERN to include %{function} so that you can always see where each line comes from. Therefore the log output itself has only minimal context (as in "q focus item x in scope y") rather than repeating the function name. Change-Id: I1b2a989c02c58c966653f965c0de512aa641bb99 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 543598a6cc07d67e7651c9f65c058465ea6d8425) Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Extend ShaderEffect docs with a shader migration guideLaszlo Agocs2021-03-031-4/+158
| | | | | | | | Fixes: QTBUG-91497 Change-Id: Ia280e768537404505481ea7046922785531e77c2 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit e83e91bad4bc85a925eab50e2f58fc3a7ae21112) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickPaletteProviderPrivateBase: use palette getterFabian Kosmale2021-02-281-1/+1
| | | | | | | | | | | Otherwise, we can get a crash in QQuickPopupItemPrivate, which does not have a palette when using the Fusion style (so m_palette is nullptr), but instead hands us its popup's palette. Change-Id: Ib472139735dc3a7892771c6097267c0ec6902a99 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 6b8a6b9fc86e94c1160d640a2b9718a7ae275b08) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickDeliveryAgent: Do not send hover to deleted itemFabian Kosmale2021-02-281-1/+2
| | | | | | | Change-Id: I58fff14184abc9dcffb3992a473fd2a1ef8446c7 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 503bfae6ef76c18e1596cd872c0f6dd0838bbc51) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix typo in QQuickGraphicsConfiguration docsLaszlo Agocs2021-02-261-1/+1
| | | | | | | Change-Id: Ia1ca8276560f913e84b9e4c119cd1ced89737790 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 1a738838c4a199c61fce32c7eaba466181526335) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Move event delivery from QQWindow to QQuickDeliveryAgentShawn Rutledge2021-02-2519-509/+1115
| | | | | | | | | | | | | | | | | | | | | | QQuickWindow owns QQuickRootItem which owns QQuickDeliveryAgent, so for every window there's an object responsible for event delivery, while the window itself is mainly responsible for rendering (separation of concerns). However, QQuickRootItem and QQuickDeliveryAgent can now be used in cases where the scene doesn't directly belong to a window, such as when a Qt Quick sub-scene is mapped somewhere into a Qt Quick 3D scene. In that case, we must remember which delivery agent was in use at the time when a QEventPoint is grabbed and deliver subsequent updates via the same DA. There's also a QQuickDeliveryAgent::Transform abstraction which subscene-management code (such as QQuick3DViewport) can implement, to provide a formula to map the window's scene coordinates to subscene coordinates; if defined, it will be used during delivery of subsequent updates to existing grabbers. Task-number: QTBUG-84870 Change-Id: I70b433f7ebb05d2e60214ff3192e05da0aa84a42 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 68c103225f4e8bd6c1b18ef547108fd60f398c0f) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Split event delivery code from qqwindow into qqdeliveryagent.cppShawn Rutledge2021-02-253-1967/+2025
| | | | | | | | | | | | | | | Event delivery logic will live in util/qquickdeliveryagent.cpp now. The actual QQuickDeliveryAgent class will be created in a followup patch. This patch is roughly the same as this series in dev branch: 44eebdf5f5fe3bd7be16bc0ef05f8fc63e38a9f2 ca9c29348a9e149109d9d381cdd44538160b7898 902c68f3ceaae407306ca5a3fdcdcfa159009e78 79f0af6cd097f55eacb763574e173f134c9c0a32 0ccea574f8e4e9a3954ef3bb95909565957bacbe dbdee417dc073a0da3c99849a3f393fa3cb660e9 Change-Id: I25f234d0550768cb01cd80c38525291202b25d99 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Don't invalidate unaffected render ordersEskil Abrahamsen Blomfeldt2021-02-252-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | If you have a list of render orders A, B, C, then A and C changes, we also invalidated B. This was to avoid the situation where B was ignored by the batching algorithm and A and C would end up being batched together. This has a performance impact for some scenes though, where you might have top level and bottom level items that constantly change, causing all geometry in the scene to be uploaded every frame. Instead of doing this, we skip invalidation of B, but include its bounding rect when checking for overlaps, so that we still avoid batching A and C together but without the need to re-upload B. Fixes: QTBUG-90632 Change-Id: I462cf1938360643ca9fa1425ae8c8e08b534fd76 Reviewed-by: Andy Nichols <andy.nichols@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Michael Brasser <michael.brasser@live.com> (cherry picked from commit 9aa3db2e19b2e1622b878cf34b1978f4fdbcac39) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove Windows 7 VM workaround from rhi initLaszlo Agocs2021-02-191-11/+1
| | | | | | | | | There is no longer a Windows 7 configuration in CI. Change-Id: Ic190735301f03e84974132ed1183adfd9352187a Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 4d9d5ab8187a2e1391afdcd0716bd43196040984) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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>
* Doc: Fix warnings about snippets in qtdeclarativeNico Vertriest2021-02-192-2/+6
| | | | | | | | | | | Cannot find file to quote from: 'code/backend/backend.pro' Cannot find file to quote from: 'code/doc_src_qtqml.pro' Cannot find file to quote from: 'code/doc_src_qtquick.pro' Change-Id: I26642a375a659a3d8dbda097702ffc2f68d10137 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit ca7d2c1f4ca010096b668108200cd9f1357a5b2e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Rename DBG_* logging categories in Qt QuickShawn Rutledge2021-02-158-71/+71
| | | | | | | | | | | | | | We prefer camelCase rather than SHOUTING for module constants. It fits well to have logging categories as constants that start with lc. That has become conventional in various modules, and we've been using that convention already for some time when defining new logging categories. Now we finish renaming the Qt Quick ones, ahead of a refactoring which will result in moving some of them around. Change-Id: I47003b9e525fe70d35dbd2450d03379b52d67c1d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit a8685fdb4d57c0ba36d80c395c2ae878595f04da) 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>
* Use functions as signal handlers when accessing parametersUlf Hermann2021-02-1220-31/+33
| | | | | | | | | | Injected signal handlers are bad practice because they aren't declared. Task-number: QTBUG-89943 Change-Id: I3a691f68342a199bd63034637aa7ed438e3a037b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 4cc91a6a0e4f9063233a4d6554ae64855cf99c14) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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>
* 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>
* Don't hide the inputMethod when finishing the editAndy Shaw2021-02-041-2/+0
| | | | | | | | | | | | | | There is no reason to hide the inputMethod explicitly when finishing the editing. This will be taken care of for us by the platform plugin and will account for a situation where Qt Quick Controls 2 will check if the item had focus when it is in an popup being closed at this point too. Change-Id: I687718ae9b4fabbf6456597a475507d2ec1a1f45 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 6da66ff611902d8c4d485568d746f49c69f1330f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove superfluous include directiveFriedemann Kleint2021-02-021-1/+0
| | | | | | | | | | | It is not conforming to the include conventions (module missing) and thus breaks the Qt for Python doc build. Introduced by 48b4c1f450109b148f03f62574d78b460859c4a1. Pick-to: 6.0 Change-Id: I1ff56a967c457f1909b7f6e2e430458e3a3f47c9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Make the internals of QQuickAnimatorController privateUlf Hermann2021-02-021-1/+2
| | | | | | | | | | No one should mess with those. All the pointers have complicated ownership semantics. We can just befriend the test instead of making it all public. Task-number: QTBUG-90401 Change-Id: I6c4adbab7046b40db7f4628780ef928445ea3eb2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Doc: Fix documentation warnings for Qt QuickTopi Reinio2021-02-011-10/+7
| | | | | | | | | | | - Source code for several QML modules has moved, adjust documentation configuration accordingly. - Comment out \instantiates commands referring to internal/undocumented classes. Task-number: QTBUG-90439 Change-Id: I360c8a5c02c5a03b84c77010f399d1a0e36b1263 Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
* Doc: Fix qdoc link warningNico Vertriest2021-01-271-2/+4
| | | | | | | | Path th qmllocalstorage missing in sourcedirs/headerdirs Task-number: QTBUG-90412 Change-Id: I8971e7c569e2ce3bb2c763178af6f1b546b3dc41 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Fix compilation after subpixel handling changes in qtbaseFabian Kosmale2021-01-274-5/+6
| | | | | | | Change-Id: Ife394e660274dd9dbe17207e18c5024f90628a00 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* 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 Pick-to: 5.15 Pick-to: 6.0 Change-Id: I528e06ff22dfcad804593db6771d9163b21808f4 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add env.vars. to toggle pipeline cache load/saveLaszlo Agocs2021-01-255-8/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QRhi has APIs (but private ones) that allow retrieving and restoring the contents of the "pipeline cache". (which may map directly to VkPipelineCache, or may be a simulated, OpenGL program binary based solution) In many cases it is convenient if the saving of the cache blob to a file, and then, during subsequent runs of the application, the loading of cache contents, can be enabled via environment variables: QSG_RHI_PIPELINE_CACHE_SAVE=filename maps to setting the EnablePipelineCacheDataSave flag on the QRhi, and writing the collected data to file upon application exit. (more correctly, when the QRhi is about to be destroyed by the render loop) QSG_RHI_PIPELINE_CACHE_LOAD=filename maps to attempting to read the contents of the specified file, and, if successful, passing it to QRhi right after initialization. When supported and the data is not corrupt or incomplete, the result is likely improved pipeline creation times (the exact details depend on the driver with Vulkan, while with OpenGL it all maps to glProgramBinary instead of compiling from source) Setting QSG_INFO=1 can be useful to see what is happening when the above 2 env.vars. are set. With OpenGL the simulated "pipeline cache" is orthogonal to the Qt 5 era shader program disk cache: loading from both is supported transparently to the application. When QSG_RHI_PIPELINE_CACHE_SAVE is enabled, the disk cache will not be written to. Task-number: QTBUG-90398 Change-Id: I82d9a81e9dab39d3513a6aa7c6e1ff748a4ec6e5 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* 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 Pick-to: 5.15 6.0 Change-Id: I30deba018825937a4ebd757e5250efca87519822 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Export QML and Quick value typesUlf Hermann2021-01-221-9/+9
| | | | | | | They need to be accessible from C++. Change-Id: I60f2213bdbe6b8b64856e13f1e0cc798f8a51086 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Expose the list of preferred instance extensions to rendercontrol usersLaszlo Agocs2021-01-213-5/+38
| | | | | | | | | As all QRhi stuff is private, it needs to have a public counterpart in Qt Quick in order to fully support the case of Vulkan-based QQuickRenderControl usage. Change-Id: Iaf9a7aa56022acd31af6ebf16de6b83a04966ff4 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Query QRhi's desired Vulkan instance extensions instead of hardcodingLaszlo Agocs2021-01-211-2/+1
| | | | | Change-Id: I9859e1b2f786f1e578f3536bb3299c38a3a9a8b6 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Doc: Fix CI warnings qtdeclarativeNico Vertriest2021-01-211-1/+1
| | | | | | Task-number: QTBUG-90439 Change-Id: I24664b27c3185c595b1ffd994cdf51b944f494ee Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Change section about writing a qmltypes fileUlf Hermann2021-01-201-1/+1
| | | | | | | | | | | You should not write qmltypes files manually. We only document their existence and that you should add them to manually written qmldir files now. Change-Id: I434398656179806c3e57724324aba38738384e1d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* 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. Pick-to: 6.0 Fixes: QTBUG-90485 Change-Id: Iad640ae57317ea86ee68ca053654b0b30ade003a Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>