aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Map window coordinates to the same coordinate system as the QPointerEvent pointAlexey Edelev2021-05-111-1/+4
| | | | | | | | | | | | If the window has parent windows its geometry should be mapped to the global coordinates before check if it contains the point coordinates. Fixes: QTBUG-91716 Change-Id: I300547361dbe895b67caeee0d47f416426444552 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit c740a9d30571079fa22fd26cb8e72df6ca28c7b2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Clarify preconditions for using QML_ELEMENT et alUlf Hermann2021-05-111-0/+15
| | | | | | | | | | You need to include qqml.h and you need to make your own class declarations available to the registration code. Change-Id: I98e6b0b8a0acc309482416c3137d8ed782bbdc82 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 40c759cbfa9dfb944a924b6c01fbfd1a15a7a25e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Remove documentation for qmlRegisterType() with no argumentsUlf Hermann2021-05-111-10/+0
| | | | | | | | | | This function has been removed. Change-Id: I10a0b268313c6dbbaf27e66ee0e3a49aae87a531 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 0d7e9d95cbfda42e45a484046280f17d5b16df38) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* MASM: Put pageSize into an inline namespaceFabian Kosmale2021-05-072-0/+7
| | | | | | | | | | | | Apple errorneously detects pagesize as belonging to their private API. Avoid this by putting the functions into an inline namespace to change their mangling. Fixes: QTBUG-69577 Change-Id: I061febdc6f961fa8a6e1d43de4154a8e26b04f27 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 719fa10c8219537187f2e3c63eacdf44bd76d410) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use QQDeliveryAgent::sceneTransform, if set, in QQuickItem::mapFromGlobalShawn Rutledge2021-05-075-3/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During dragging of a QEventPoint, Flickable computes the drag delta as pos - mapFromGlobal(point.globalPressPosition()) We cannot use only the global position delta, because the Flickable might be transformed in 2D (by setting rotation on it or in a parent, as in tst_qquickflickable::clickAndDragWhenTransformed) or in 3D (by mapping it onto a Model object). So we really need QQuickItem::mapFromGlobal() to actually work regardless how many of these transformations are in place. This is just the beginning: we have a lot of these mapFrom/To functions; but it's enough for the Flickable in the quick3d/dynamictexture example to work better. Without this fix, if you tried to drag a yellow note on the door panel, at the very first drag ListView saw a large delta and considered its drag threshold exceeded immediately, whereas the DragHandler on the note saw a very small delta; so ListView grabbed and DragHandler did not steal it: it relies on having "first dibs". When the drag threshold is exceeded, Flickable merely plans to grab on the next event rather than grabbing immediately, and therefore a child has a chance to grab first. Therefore it's normally OK for DragHandler to simply become the first exclusive grabber when the drag threshold is exceeded, and not steal the grab from another item (although grabPermissions can be changed to allow stealing if necessary). However this means that we continue to enforce the drag threshold in local (transformed) coordinates: if Flickable should wait until the user drags 10 pixels, but it's scaled to half-size, it will start dragging after only 5 pixels of movement, for example. Task-number: QTBUG-92944 Change-Id: Id01cc833ca80850ca18a965adf47f435e43e20ed Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit f83efd3feb564cf8b929b9dfde6787853a561069) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* TextEdit: update all glyphnodes on QTD::contentsChanged() signalShawn Rutledge2021-05-071-0/+8
| | | | | | | | | | | | | | When a syntax highlighter changes formatting, the actual text doesn't change, and QTextDocument emits contentsChanged() but not contentsChange(int, int, int). We need to regenerate QSG nodes. contentsChanged() is connected to QQuickTextControl::textChanged() and from there to QQuickTextEdit::q_textChanged(). Fixes: QTBUG-74572 Change-Id: Ia62aa6d3adfc9a9d496ee8811db4c2d963dd0c54 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit d0ffa3c42bb58eef0d2a2c3326984695a60e9667) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qquicktableview: upon forceLayout(), check for visible rows/columns at the ↵Richard Moe Gustavsen2021-05-061-30/+48
| | | | | | | | | | | | | | | | | | | | | | origin There is a bug in TableView which will stop the user from scrolling/flicking back to the first column if it has become visible after first being hidden. The reason is that this is somewhat of a special case that happens only if the current left column is already at the origin of the viewport, since that will fool tableview into thinking that there can be no more columns in front of it. This patch add an extra section to the function that checks for visibility changes, to detect this special case. Fixes: QTBUG-93264 Change-Id: Ieaad507b45ea11dc231519e9f49cbf182d6443ba Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 546df684e272bbbc5e8b871ae9b224fdb34a4cfa) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Workaround mingw compiler bugUlf Hermann2021-05-061-0/+5
| | | | | | | | | | | | | std::acosh(v) wrongly returns NaN for v == Inf on mingw. This makes the ecmascript tests fail. Fixes: QTBUG-93175 Change-Id: Ic6677b3259dad591b946b23d4d6a6859f6e70b0f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 3a8c0fd5cb9bfec439c306593bce19f434c871ce) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* DragHandler: don't try to handle native gesture eventsShawn Rutledge2021-05-052-0/+14
| | | | | | | | | | | | | | | | | | | | | No gesture handling has been implemented in DragHandler (although we could). It just made the target item jump unintentionally. QQuickMultiPointHandler::wantsPointerEvent() returns true for gestures, because PinchHandler handles them, and the pattern is that base classes only rule out some kinds of events but leave the final decision up to the leaf class. The autotest has to use a touchpad now, not the primary pointing device, because QQuickPointerDeviceHandler::wantsPointerEvent() returns false if pointerType != Finger and acceptedButtons() is not satisfied. Fixes: QTBUG-92165 Change-Id: I984de750c9ae892f3ee61c7ed5b3ac4a7d187024 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 73051631545dc59d4419a5ef2202355349aab480) Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* V4 Debugger: Collect locals also from block scopesUlf Hermann2021-05-051-1/+2
| | | | | | | | | Block scopes can contain "const" and "let" members. Fixes: QTBUG-92224 Change-Id: Ie13d7d573e2759c510e1ea48c6edc68a095f40a0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 051dd3178bc4c9214af60c69cecfc2c28f13174d)
* Store memory of grabbing agents in EventPointDataShawn Rutledge2021-05-054-132/+163
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QQuickDeliveryAgentPrivate::grabberAgent(event, point) was too naive: it's not only that each point could be delivered by a different agent, but also each point could have an exclusive grab in the context of one agent and multiple passive grabs in the contexts of different agents. E.g. in qtquick3d/examples/quick3d/dynamictexture, many grabs can occur if you press on a door: the View3D has a TapHandler to pick the door, so that you can click to open; each Panel has a TapHandler to defocus whichever TextArea has focus; there is a ListView for dragging through the panel delegates sideways; if you press on a yellow note, its DragHandler prepares to start dragging; etc. So at least, a TapHandler in the subscene and the other one in the View3D need to get passive grabs, and need to receive the release event in the correct coordinate system, to detect taps. When we apply the sceneTransform of a particular agent before re-delivering an update or a release, based on the grab, it has to be in the correct coordinate system for that grabber. So on grab, we use EventPointData::exclusiveGrabberContext or passiveGrabbersContext to store the pointer to the QQDeliveryAgent that was doing the delivery when the grab occurred. When we deliver the next event to a grabber, we also look up the correct DA to do the delivery. This gets done twice: once in QQuickWindow::event() to find the DAs that need to handle the event, and in QQDeliveryAgentPriv::deliverUpdatedPoints() to ignore passive grabbers for which a different DA is responsible. The failsafe "never allow any kind of grab to persist after release" is moved to QQuickWindow::event because we don't want to do it prematurely in a subscene agent, and ATM we don't require the main DA to deliver last: it depends on the order in EventPointData::passiveGrabbersContext. QQuickPointerHandler::onGrabChanged() should only be called from the relevant DA, to avoid overreaction: that is, the DA that is delivering an event at the time the grab occurs. QQDelAgentPrivate::onGrabChanged() gets called on all DA instances, but only one of them is supposed to store itself as the assigned DA for handling a particular point ID. It's not always the same as QQuickItemPrivate::deliveryAgent(): that goes astray when the same 2D subscene is mapped to the main scene and also onto multiple QQ3D models. In that case, if the user interacts directly with the 2D scene, the main DA should be assigned; or if the user interacts with one of the mapped subscenes, its DA should be assigned. We have to stop delivering to subscenes when the event is accepted, at least, because of the usual convention that delivery is done when the event remains accepted rather than being purposely ignored. So in the dynamictexture example, if you click on a TextEdit on one of the doors, it receives the event first (because it's on top) and accepts it; that stops delivery in QQuickDeliveryAgentPrivate::deliverPressOrReleaseEvent(), and now also stops QQuickWindow::event() from visiting the next subscene, or the main scene, so that the TapHandler in the View3D doesn't get clicked, and the doors don't open. Task-number: QTBUG-92944 Change-Id: I1b4520b665e58874d17a936024cf62e4c7175d8e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 5c08e911375966761ee8e4d7cd425120985876e2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid stale QSGTexture pointer accessesRomain Pokrzywka2021-05-051-1/+3
| | | | | | | | | | | | | | On rare occasions, it seems to be possible for the texture to be used after deletion, which results in crashes in pixmap() after casting. Rather than storing a raw pointer, wrap the texture in QPointer to avoid the stale pointer accesses. Task-number: QTBUG-80415 Change-Id: Ia0ee556f4a3a4eee777ca14065635f4bc5f90da2 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 1c010b202506bb7eb0f0e24ab37ad50e319abada) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Make PinchArea translate correctly inside a rotated parentShawn Rutledge2021-05-051-1/+7
| | | | | | | | | | | Also includes 9dacc312e5b0f5aeb0f8370f4f7722b57754a3c2: fuzzy comparison in the test to avoid failure due to roundoff. Fixes: QTBUG-63673 Change-Id: I91231bb8555b7eb02a9580f9f184b261d8bd44c8 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 7642205be45135add120373299df02e05f4ffc58) Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* V4 debugger: Properly count break pointsUlf Hermann2021-05-042-1/+2
| | | | | | | | | | | | We cannot just take the number of active breakpoints as ID for the next one. It's possible to remove breakpoints after all. Fixes: QTBUG-93404 Change-Id: Icde7a8e47c740e930f2313ffd9034b00033a54aa Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 7f12cf3346d65d0bff78fff8000ed519fbb921ba) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* ShaderEffect docs: Clarify vertex output/input naming requirementsLaszlo Agocs2021-05-031-2/+21
| | | | | | | | | | | | | | | | | | | | | | To be complemented by an rhi change that adds verification for this and prints a warning with mismatching names. The common use case with ShaderEffect is to provide a fragment shader only, while using the default, built-in vertex shader. In this case one must be aware of how to correctly declare the texture coordinates input, and this was not very clear in the docs. In short, we need to advise that the fragment shader input must be declared as qt_TexCoord0 at location 0 in order to be portable. Just having a matching location number but a different name is not sufficient. (because with old GLSL versions the location qualifier will not be there at all and matching is name based) Task-number: QTBUG-92500 Task-number: QTBUG-93370 Change-Id: I975557e9a754db8e7c69b86531a2d873f059c7ce Reviewed-by: Christian Strømme <christian.stromme@qt.io> (cherry picked from commit 40959164bbc0e7144b3ba3e426296d0de61d60f5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Add a link to the page where the backends are listedVenugopal Shivashankar2021-05-031-1/+3
| | | | | | | | | | | | Considering that there is lot more to know about the backend value, link to a topic where this info. is covered is better than list the values in the function documentation. Fixes: QTBUG-93083 Change-Id: I4ae714685395e9c37de82d9a3ee42220a1f07f89 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit cc58bdfb57f6fe15113b797cad4d0486c9957ac6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* ListView: support QList<QUrl> modelsMitch Curtis2021-04-302-2/+9
| | | | | | | | | | | | | | | | | | For now this patch just tacks on another list type, but there may be a better way to account for all types in the future. This change also adds tst_qquicklistview2 to speed up development. tst_QQuickListView is 10000 lines long, and compiling it is slow (36 seconds on a 2016 i7 MacBook Pro). In addition, a similar approach (creating a second test to avoid the slowness of a massive one) already exists for QQuickItem tests. Task-number: QTBUG-72906 Change-Id: I05455a2f20978b07eb38591ab63e7d0fb7dac1ab Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 0e3902b83dc3c59567a81a90c3f3c0365bdf68da) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QQuickDeliveryAgent::event(): handle tablet events explicitlyShawn Rutledge2021-04-281-0/+7
| | | | | | | | | | | | | | | | | | | | | QQuickWindow::event() forwards all input events to the DA. If it's not handled there, it eventually gets handled at the bottom by forwarding to QWindow::event() which then dispatches to QQuickWindow::tabletEvent() and from there to da->deliverPointerEvent(); however the switch in QWindow::event() is not meant to be the normal entry point for input events anymore. In a subsequent patch we will move the failsafe "never allow any kind of grab to persist after release" into QQuickWindow::event(), before that is reached; that in turn breaks tst_PointHandler::tabletStylus(), showing that the point is ungrabbed on release before PointHandler handles it and has a chance to emit pointChanged. So we must handle tablet events earlier, alongside mouse and touch events. Amends 68c103225f4e8bd6c1b18ef547108fd60f398c0f. Change-Id: Id7508e4bbbdbfe88d002d298c15ec727040f02ef Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 73148c79a328cb834a51de5c152f32851194ce52)
* Restore scene position after changing it during deliveryShawn Rutledge2021-04-271-0/+7
| | | | | | | | | | | | | | When we visit multiple subscenes via multiple DAs, if they are changing the scene pos, the original gets lost, and then maybe we visit some handler via the root DA again (like a TapHandler declared in a View3D). This helps to fix qtquick3d/examples/quick3d/dynamictexture Task-number: QTBUG-92944 Change-Id: I9bd8cfc2510168b6e14002957833b54eb9586ab0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 30013ccae388aa55b870aa70bc20979d7c434c05) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Document QQmlComponent::createWithInitialProperties() error handlingMitch Curtis2021-04-271-0/+8
| | | | | | | | | Unlike create(), it can produce errors that should be checked. Change-Id: I78f2e58c8666eb45f6e850c43e3e97a448b2758e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 4f0622f7f553cd841874f0efe65d7f13edeec216) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQmlComponentPrivate::setInitialProperty: improve error messageFabian Kosmale2021-04-271-2/+7
| | | | | | | | | | We can discern between the case where the property does not exist at all, and the case where we cannot set it. Change-Id: Ia2e8f4cc077a00b90d720db01bff1542a812dea0 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 7275328b967582010abfd59c9a93feef4cb1379f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove extra colonZhang Hao2021-04-241-1/+1
| | | | | | | | | | | JavaScript Grammatical errors, There should be no colon after the function brackets Fixes: QTBUG-93048 Change-Id: I902d490bf810fa60e3b3d2a76de7902345289cfe Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit df8e6136834326e363db49829d227a303e5425ed) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Expand QML_EXTENDED_NAMSPACE's documentationFabian Kosmale2021-04-211-1/+32
| | | | | | | | | | | | Note that it doesn't necessarily need a namespace; mention that it however requires the "namespace" and its contained enums to be exposed to the metaobject system to work. Moreover, add a minimal code example. Change-Id: I814c65b2b59747f902f2291e2f98962eb98d4d59 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit a3959ea9df49b5c30833d49daede5bf60a70897e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix C4267 warning in qqmlirbuilder.cppKai Köhne2021-04-211-2/+2
| | | | | | | | Fixes: QTBUG-92966 Change-Id: I9acdb0d624a0950f9e28c6463530b27d282123e2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit e881ca02897f51175c382401d9713f6f77ede426) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQmlDelegateModel: build fixGiuseppe D'Angelo2021-04-201-1/+1
| | | | | | | | | Capturing of `this` via `[=]` is deprecated in C++20. Be explicit. Change-Id: Ic3b0a14c8eea83afbd17e97a2e3cdefbce045ff2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit dcdbd0b0af345c1b919ba9f09b5e591e5d00f4cb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qqmlirbuilder: Fix treating parser warnings as errrosMaximilian Goldstein2021-04-191-1/+3
| | | | | | | | | | | Previously parser warnings (i.e. inline components having lowercase names) were treated as errors. Because these were not handled properly this also resulted in the QQmlComponent with the warning never becoming ready. This resulted applications hanging instead of terminating. Change-Id: Ia5ad3b54edc1b94dd94d0bf771c3494691abec71 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit e49be8d2b1b7acb310873a63f46980d1f0296f95) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Clear passive grabbers on press in QQWindow not in DeliveryAgentShawn Rutledge2021-04-192-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | In case the window's main scene and a subscene both contain handlers, and one of the handlers in the main scene takes a passive grab on press, we don't want to lose it while we are delivering to the subscene. For example in Qt Quick 3D's dynamictexture example, if you click on one of the doors, the TapHandler in the View3D grabs on press; but the door also has a 2D subscene, which allows dragging (either dragging one yellow note item, or flicking the ListView). If you drag, the TapHandler does not detect a tap; if you tap, nothing gets dragged. So this is an example of a cooperative scenario involving multiple DeliveryAgents at the same time: a passive grab can occur in the main scene, an exclusive grab can occur in the subscene, and they don't interfere with each other. But if we clear the passive grab while delivering to the subscene, the TapHandler does not get a chance to detect a tap. So we should do that only once, when the window receives the press event. Amends 68c103225f4e8bd6c1b18ef547108fd60f398c0f Task-number: QTBUG-92944 Change-Id: I9f064764a17b1efe758909f61fca6658f65d43e5 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 48b1c59b65332b773eb51d25c422b53dbd3d6762) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove documentation references to NVPR rendererAndy Shaw2021-04-192-44/+11
| | | | | | | | | | | Since this is no longer supported, it is removed from the docs Change-Id: Id23716594e6ea9fd3d05d88a2586d380d1db09db Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Nico Vertriest <nico.vertriest@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit 39de040452d25c3a279599519638890859d483b8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Document that QML_SINGLETON only works with QObjectsMitch Curtis2021-04-191-7/+8
| | | | | | | Change-Id: I18c38037cd635fa3300c761b16038b67ac3b0d74 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 03a2e51063de99f85b3b801c7ccd6663163a61b0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix documentationVolker Hilsheimer2021-04-171-0/+1
| | | | | | | | | | The '### Qt 7' comment between documentation and function definition breaks qdoc's matching logic, so put the comment above all that. Change-Id: I4a6786422d8c30a257f09d630351a878c64bd377 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 24af448c559af7b55d1afc79047ff76ddd26950e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickTextInput: update cursor rectangle after padding changedWang Chuan2021-04-161-0/+5
| | | | | | | | | | | The position of cursor delegate needs to be updated when we change padding, otherwise it will be in a wrong position. Fixes: QTBUG-91867 Change-Id: I89ca84fe893ebf517ab67890196eede14a4055d7 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit d98694c4023881673259ba040c10df7e71ec3d37) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickItem::forceActiveFocus(): actually force active focusShawn Rutledge2021-04-161-0/+12
| | | | | | | | | | | | | | | | | | | | | It was trying to get by with setFocus() but that doesn't always work, in cases when the item's d->focus flag is true (leftover state) but it doesn't actually have focus anymore after a reparenting scenario. Item.focus represents the intention to be focused when possible, and does not necessarily change due to environmental circumstances, such as having its parent reparented. QQuickItem::setFocus(true) returns early if the new requested focus state is the same as the stored d->focus; so it was not enough for foceActiveFocus() to call only setFocus(). In the bug, TextInput and Loader both get stuck in the state d->focus == true, so forceActiveFocus() did not do anything before. Fixes: QTBUG-89736 Change-Id: Ib7f4caccf81b60a02e2655332b64efba4d1fd7cf Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit a8be17a1472c6f504c0c40f68fdc13df035ac4b4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix qml module version to use the repo project versionAlexandru Croitor2021-04-1632-32/+32
| | | | | | | | | | | | Use PROJECT_VERSION instead of CMAKE_PROJECT_VERSION, so that the repo project version is used in a top-level build, rather than the version of the qt5 project. Task-number: QTBUG-92861 Change-Id: I5a7a09baf81353558e512800746ac24e8e8b9a47 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit cd7bd71d08f1c21648756d0a9fd501ce37a8cc0c) Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Check thisObject when calling various methods on URLUlf Hermann2021-04-141-38/+122
| | | | | | | | | | We should not crash when you try to call them on the wrong object. Rather, throw a type error. Change-Id: I1b146d9c77d838e013408988e02a65a623641f1f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit f32436122f6ac16bfd6f23228b85a6f7c12502b6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* doc: demystify QSGOpenGLTexture::fromNativeExternalOES()Shawn Rutledge2021-04-131-2/+3
| | | | | | | | | | | | Plausible explanation comes from https://stackoverflow.com/questions/25618977/how-to-render-to-a-gl-texture-external-oes Amends c2c180e4ee58f8cfc104207b3b56e83ddcb7e79a Change-Id: I9baba2119ea85823cda829d32859c4e45f757d09 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit 9b0069d94a5b725923e303ccdb3d7739088e06fc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add QQuickDeliveryAgentPrivate::isHoverEvent()Shawn Rutledge2021-04-132-0/+13
| | | | | | | | It's just another type-switching function, needed in QtQuick3D now. Change-Id: I6ecc6d82177368556cbab1b3fd038ce325f39496 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 476a4b91d7d2b471d5f1364f33f855a013a2c7c6)
* QV4EngineBase: Do not create zero-sized array on 32 bit platformsFabian Kosmale2021-04-121-1/+3
| | | | | | | | | | | | Zero-sized arrays are a non-standard extension, and do not work on MSVC. We can instead conditionally add an explicit padding member on platforms where POINTER_SIZE == 8. Fixes: QTBUG-92562 Change-Id: I8462eb05e16c42045c0c95f026321c6e20e5c6bb Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> (cherry picked from commit 506463fe8ae0125f18d6236db9b7cd8b99885d08) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Do not batch lines with > 1 width in alpha passLaszlo Agocs2021-04-121-1/+5
| | | | | | | | | | | | Cannot possibly do reasonable overlap checks when we have no idea how such lines are rasterized, meaning we do not know the real bounds of the geometry. Fixes: QTBUG-91749 Change-Id: Ia444232330da2f1d29841589f0e65bb52822c4ae Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit 74c458f9fdf0639cd68684b5184bf561166e14cb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't crash when trying to invoke non-existing string converterUlf Hermann2021-04-091-2/+1
| | | | | | | | | String converters are removed in 6.2 anyway. Fixes: QTBUG-89892 Pick-to: 5.15 6.0 Change-Id: I504c00d99580e3d27d04f420295dd97251657ef4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Do not auto-clean components with live inline componentsUlf Hermann2021-04-091-1/+11
| | | | | | | | | | | The inline components do not hold a strong reference to their outer type because that would be a reference cycle. Fixes: QTBUG-92236 Change-Id: I6d76a114352653210f0ece6c198cf761d3b4eda1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit d0d4cc528ba9e3c39c15a2292066dac1d457abd5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* When resolving property types, also update the property type namesUlf Hermann2021-04-091-2/+12
| | | | | | | | | Otherwise we end up with a mixture of QML and C++ names. Task-number: QTBUG-92447 Change-Id: I94c44307d8dd762d11cfd8f178f33ab6a895ee83 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 4beba3a2b68a389c426791dd43c638f3539d8f20)
* QV4QObjectWrapper: Store the whole signalFabian Kosmale2021-04-083-11/+21
| | | | | | | | | | | | | | | | | | | | | | 90be89d771425044a84e9e79e4e668e065acc825 changed the connection logic to actually pass the receiver to connect in order to fix disconnect cleanup. However, we omitted to change QObjectSlotDispatcher::impl accordingly. The previous logic was: - store the index of the signal in signalIndex - In impl, in the call case, we would get passed the emitting object (sic!) as the receiver parameter. Then we would use the object and the signal index to obtain the QMetaMethod. - From the QMetaMethod, we could get the signal's number of parameters. After the aforementioned change, that does not work anymore: The receiver is now the actual receiver of the signal, thus we get the wrong method, and potentially the wrong number of parameters. To fix this, we now store the complete QMetaMethod of the signal. Change-Id: I868c51edf24a61d14eaf958ed7942da27f54a5c3 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit e7e4eba6875c0f375c4fd03af9b3ed9ea44d0ba1) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix missing 'We mean it' warning for generated qml_compile_hash_p.hKai Köhne2021-04-011-0/+15
| | | | | | | Change-Id: I327d377c80749741274a76dfa609417c005bf6c7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 403ecb6422b499d9033934148994fe251acc937b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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>
* Add "we mean it" warning to private headersVolker Hilsheimer2021-03-314-0/+44
| | | | | | | | | Fix warning from configure step. Change-Id: I5afeeeeabf1cb22149e1df3cecb27c6cf4a0567f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 07a9cc199f101a11c83a9d75e5eb198134c75a8d) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* 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)
* CMake: Account for qtbase refactoring in qt_internal_add_plugin()Craig Scott2021-03-311-15/+44
| | | | | | | | | | Task-number: QTBUG-88763 Change-Id: I66c22f876be66ca64cd364f574a6f3e862e4abf5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 661f120c1d9e00aff31c432f84f83f58b8aa9c9a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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>
* Prevent CMP0116 warning with CMake 3.20 or laterCraig Scott2021-03-301-9/+16
| | | | | | | | | | | | | | | | | CMake 3.20 introduced a change in the handling of relative paths in *.d depfiles referenced by custom commands. To avoid a CMP0116 policy warning, we have to explicitly set the policy to NEW and also change the relative path(s) we embed in the depfiles to be relative to CMAKE_CURRENT_BINARY_DIR rather than the top level binary directory. Fixes: QTBUG-92026 Change-Id: I1a84d29f1a8d5c48bae5bc11596806f1e0e07919 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 8deb1b279fad2b10598af0870dd3b0d99f5ef128) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qqmlapplicationengine: Handle errors during component creationMaximilian Goldstein2021-03-301-0/+8
| | | | | | | | | | | Previously QQmlApplicationEngine did not handle any errors that occurred during object creation (i.e. failures to initialize required properties) which lead to QObject::connect errors and to the error messages not getting printed among other issues. Change-Id: I69bc566a6d349c786cae82a963a621388684c8f5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 890cb4cb236333fd5b112fffc0e9088ecb43f2df) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>