aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
Commit message (Collapse)AuthorAgeFilesLines
...
* Doc: Document pooled(), reused() signals for ListView QML typeTopi Reinio2020-11-261-1/+32
| | | | | | | Change-Id: Ic8b2fa8333fdc6aae051f3b2faa3a0c0ecad9ad5 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit d6a5a8525936ce3009ccbe8a68b7fbfa8e50b8ae) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Fix documentation dependenciesTopi Reinio2020-11-261-1/+14
| | | | | | | | | | | - Add missing dependency to qtquick3d - Remove qtscript, qtquickdialog dependencies - Use multiline formatting to have a clean git history of dependencies Change-Id: If79df67ef14cce4156cd24042725e56654da4444 Reviewed-by: Topi Reiniö <topi.reinio@qt.io> (cherry picked from commit 22852a84a7146e2b36c59731845cba1d0eb3c409) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove most examples/demos from highlighted listVolker Hilsheimer2020-11-251-7/+1
| | | | | | | | | | There's nothing new in those, leave the space on top to more intersting stuff. Change-Id: I9c349393b073e80155db594f6777778f31efdf02 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit b58f962abf3e939907d4ad0bd452e1a721558316) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Remove version numbers for import statementJerome Pasion2020-11-245-9/+16
| | | | | | | | | | | -recommend using the import statement without versions for Qt 6.0 -update use of \qml Task-number: QTBUG-87155 Change-Id: I555d582a13006c5abb6dc1e0266d2987ba79c6d8 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 370fe537badd2b98c2da7f8918a15411d5aa67ad) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickTextInput: Store mask data in std::unique_ptrFabian Kosmale2020-11-242-5/+5
| | | | | | | | | | This ensures that the memory is freed reliably Fixes: QTBUG-88807 Change-Id: I841a5a2b226a69ce50975d95702a948857d1b54f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit d2d8e90e9f218103d60737e1273ab5322834d9ec) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove unused external function declaration in ShaderEffectLaszlo Agocs2020-11-241-2/+0
| | | | | | | Change-Id: I05e3f804af3668235f97cebc54e1904a90092385 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit a10c980b1e4273b357702211148a2f9c4e2ebc2c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Purge renderpass refs from renderer when redirecting via QRhiRtLaszlo Agocs2020-11-242-7/+9
| | | | | | | | | Fixes: QTBUG-88761 Change-Id: Ia5df65a4a09a7554a7d0cca4533f766cb5abe97b Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit bbb6298204b95f049c8a177365125247ba49dba3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't deliver to non-grabbing pointerhandlers if a point is grabbedShawn Rutledge2020-11-231-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In particular, on press when QQuickFlickable::filterPointerEvent() calls captureDelayedPress() and will return true, it also accepts the event to stop propagation. It becomes the grabber as a consequence of that. On a future move event, when the drag threshold is exceeded while the delayed press timer is still running, Flickable already has the grab (but it accepts the event again), and QQuickFlickablePrivate::drag() calls setKeepMouseGrab(true). In this case we still want to prevent any children's DragHandlers from seeing the event, because a DragHandler will also see that the drag threshold was exceeded and try to steal the grab. A DragHandler can steal the grab only if there was no press delay: then it sees the initial press because Flickable does NOT stop event propagation (does not accept the event), so it can take a passive grab and continue to wait for the drag threshold to be exceeded, regardless of what else happens. In case of multiple touchpoints, allPointsGrabbed() returns false if the Flickable has only grabbed one point; but we want to avoid delivering handlers in children just on the basis of that grabbed touchpoint being within their bounds, even though other points may be delivered to various handlers. This fixes tst_FlickableInterop::touchAndDragHandlerOnFlickable. The blacklisting of dragHandlerInSiblingStealingGrabFromMouseAreaViaTouch was bogus (it's in the mousearea_interop test). Task-number: QTBUG-86729 Change-Id: I9f0d42e97de4f4a3b4f7773800a8d59dc34a0553 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit c5c05498a7e79c1868551192921a42236ecbf5f8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickStyledText: Avoid warning about setFontFamilyFabian Kosmale2020-11-231-1/+1
| | | | | | | Change-Id: I3595be758c757998951b24e46cb90bb74c9c45a4 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit c65d72bb81c9860023bc3a7348ad0d5ea65a27b0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use a single code path to load a QShader in QSGRhiShaderEffectNodeLaszlo Agocs2020-11-231-13/+4
| | | | | | | Change-Id: I8fec25df83768883896d195c09489aeb23abdafd Reviewed-by: Christian Strømme <christian.stromme@qt.io> (cherry picked from commit ae1dc052b6b975b8a49d8d71d11d3051acd594c7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove unused 'blob' member in ShaderEffect internalsLaszlo Agocs2020-11-231-1/+0
| | | | | | | Change-Id: I804f019f40dddce43646bf1cf91da26d4c3a4b5c Reviewed-by: Christian Strømme <christian.stromme@qt.io> (cherry picked from commit 9f43ccc112b748ff79e175b7fec94ec60cf311ec) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Re-enable the caching of shader data loaded from filesLaszlo Agocs2020-11-231-8/+8
| | | | | | | | | | | | | There was a mismatch for the cache key: sometimes using the original url as specified in the QML code, sometimes using the resolved url (which has, for example, a relative path expanded to absolute). Change this to be consistent. Fixes: QTBUG-88673 Change-Id: I201750716d3ba6dbe73a4799ac56f26f9b8ec820 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit f95b99902fae6e53a9da5fbccb6e1616299fb3bf) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QML Text doesn't reset lineCount when text is emptyShinichi Okada2020-11-231-0/+2
| | | | | | | | | | | | lineCount is not reset when replacing a multi-line QML Text 'text' property with an "" empty string. Also, the lineCountChanged signal is not emitted Task-number: QTBUG-84458 Change-Id: Ic3c02e6a90e6675eadbaafc6af6ab0356ee98123 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit ae1b9c6d94001411efeef600e22638906e0fa990) Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* QQuickListView: Fix warning about cast from ASCIIFriedemann Kleint2020-11-201-1/+1
| | | | | | | Change-Id: Id7193f64093c20bb798b6bc6fbf87f1ce41364d7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 220cbb6dab74b7ee924b44d89f657cfc86f9e8ec) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Ensure QQuickWindow::transientParent property is documentedTopi Reinio2020-11-201-0/+1
| | | | | | | | | | | | | While the parent class (QWindow) has that property, QDoc does not allow documenting properties from base classes. The documentation for QQuickWindow::transientParent includes QML-specific information, so use QDOC_PROPERTY macro in the header file to make the property documentation visible. Change-Id: Ib281c776717e09e6929420c6173a520613356d91 Reviewed-by: Topi Reiniö <topi.reinio@qt.io> (cherry picked from commit 29a32e17e1a11af8312be269c6b8085385524155) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Make sure we don't modify the incoming event objects when localizingVolker Hilsheimer2020-11-192-4/+9
| | | | | | | | | | | Restore the position of the single event point after event delivery. Where possible, don't make a localized copy which explicitly shares its data with the original anyway. Instead, access the original directly. Change-Id: I5efa44c336eddeef1a1ab00dc91e2d0f223ed31d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix tst_QQuickMouseArea::notPressedAfterStolenGrab againShawn Rutledge2020-11-192-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | Most of the time, QQuickWindowPrivate::deliverMatchingPointsToItem() doesn't need to call item->mouseUngrabEvent() because all grab changes are notified via the connection from signal QPointingDevice::grabChanged to slot QQuickWindowPrivate::onGrabChanged(). But in this case, MouseArea only accepts the event, rather than taking the grab itself. Therefore at the time the grab is "stolen", there was not yet any grabber, because grabbing is done after delivery. But we still need to inform MouseArea that it's not getting the grab it expects to get, so that it can reset its pressed state. But we don't want it to be redundant (other tests are counting events, and we don't want repeated ungrabs to show up in those); so now we have to track whether the item on which we're about to call mouseUngrabEvent() has already gotten it. This illustrates another problem with the tradition of accepting events and being unclear about what it means. Grabbing is one thing, ending delivery is another. Amends a97759a336c597327cb82eebc9f45c793aec32c9 Task-number: QTBUG-55325 Task-number: QTBUG-86729 Change-Id: I8150f901e00e7a71499fc98ab54f0ba75370f3ec Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove QQuickItem::windowDeactivateEvent(); cancel grabs insteadShawn Rutledge2020-11-196-22/+38
| | | | | | | | | | | | | | | | | | | When a QQuickWindow is deactivated, visiting every item in the entire scene to tell them the news isn't very efficient, especially considering that the only item that overrode this virtual function has been QQMouseArea, throughout the lifetime of Qt 5. If it's important to cancel grabs of MouseAreas, then it's equally important to cancel grabs of MultiPointTouchArea, pointer handlers, etc. It should be OK to delete the virtual function since it was never documented, and marked \internal, so hopefully no users are depending on it. The existing tst_QQuickMouseArea::pressedCanceledOnWindowDeactivate() test continues to pass, which proves that the WindowDeactivate event still has the desired effect on MouseArea. Change-Id: I0109370aba14096fb7777a83cf1b6763ac58013f Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use QMutableSinglePointEvent's new default constructorVolker Hilsheimer2020-11-191-6/+6
| | | | | Change-Id: I3b2d1fbc4b62b501aa6ed748a692cb4bba261c5e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Add Qt 6 Qt Quick QML Type changes from qtdocJerome Pasion2020-11-191-1/+99
| | | | | | | | | -changes to Qt Quick QML Types and OpenGL support -content from doc/src/qmlapp/applicationdevelopers.qdoc Task-number: QTBUG-87156 Change-Id: I3384e5bfa070c891015e5aa4af2e2c0b2dae35cf Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Stop ungrabbing due to FocusAboutToChangeShawn Rutledge2020-11-181-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The goal is to un-blacklist the test for QTBUG-60123. To that end: revert 7b2e2117162594a2d0234bb02408f5b5a446488b and its followup 6933b7e8e6dc279a8eb34e1f4c60bc109dfb7d26. There is no detailed bug report explaining exactly why those were done, just the comment on code review: "This fixes the desktop components' combo box on linux re-opening at random times", probably referring to a combobox popup window in Controls 1. But when using QWidget::createWindowContainer() in two different windows and clicking MouseAreas in each of them, it turns out that this change of focus is causing the mouse grab to be canceled. The grab should be naturally given up after mouse release; canceling prematurely doesn't make sense. The Qt 5 fix for this bug was e0c30279ec1fad88346ed3fb483bc3c672fdd01b which tracked the grab on a per-window basis. It would be difficult to do that again now (change QPointingDevicePrivate::setExclusiveGrabber() to store a separate grabber for each window in which a grab occurred? what could go wrong...) It seems odd to have the same QEventPoint grabbed in two different windows at the same time, but popups need event forwarding so maybe that was why (if a MouseArea triggers the popup, should it stay pressed and keep its grab? the subsequent mouse moves and the release need to be forwarded to the popup, so maybe something inside the popup needs a grab, simultaneously or not). Anyway we don't have actual popup windows in Controls 2 right now; and we know that event forwarding for popups needs work in QtGui so that it will be easier when we try again to have them in Qt Quick (QTBUG-68080). So perhaps the original workaround has outlived its usefulness: popup event forwarding needs to be handled at the lower layer, not in Qt Quick. Task-number: QTBUG-57253 Task-number: QTBUG-60123 Task-number: QTBUG-86729 Change-Id: I56dbc3bb94f66a7f26f79a97bcb2f2bbc0b7aa92 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Remove extra \endlist commandJerome Pasion2020-11-181-1/+0
| | | | | | | | -fixes qdoc warnings Task-number: QTBUG-86102 Change-Id: I2e2a2f98d7127629bedc06612d6c6b4f7e57fb52 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use QMutable*Event classes to copy and synthesize eventsVolker Hilsheimer2020-11-187-46/+45
| | | | | | | | | | QMutableTouch/SinglePointEvent can be publicly copy constructed from their non-mutable counterparts, make use of that. Change-Id: I7f56a9f9649bb7726cca1eaddccfdc3f21d47554 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* pixmapcache: avoid deadlock when canceling async image loadNick Shaforostov2020-11-181-2/+2
| | | | | | | | was only possible if qml_network is disabled Pick-to: 5.15 Change-Id: If8a8addc0aa5c4c768dd7df3aa4d627f82a78059 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Fix potentially missing endFrame() in threaded render loopLaszlo Agocs2020-11-171-0/+5
| | | | | | | | | | | | | | | | | Upon a QWindow destroy() and show() we can get to syncAndRenderer with sync not requested. It will be followed by a full sync+render request afterwards, but first we need to gracefully survive that somewhat obscure initial round (obscure because the window is fully usable, so we get a swapchain, but then we do not sync, so there is no QSGRenderer created) Exhibited by tst_qquickwindow::headless. It correctly showed a warning on all platforms and rhi backends, but was only fatal on macOS and Metal for some reason. Fixes: QTBUG-88513 Change-Id: I0396b648af0fd2bef2964b79a28359a7f806530d Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Remove scene graph section that has only a dead linkVolker Hilsheimer2020-11-171-5/+0
| | | | | | | | Scene graph changes are documented in the section further down. Task-number: QTBUG-88152 Change-Id: I6362999e6830e05981e95af78b3d2f00b5e398e3 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* When Flickable filters UngrabMouse, react as if it was ungrabbed itselfShawn Rutledge2020-11-172-6/+9
| | | | | | | | | | | | | | | | | | | | | Fixes tst_QQuickListView::touchCancel again. In this scenario, a TouchCancel is sent, but gets turned into an UngrabMouse for delivery to the MouseArea which is the current grabber. We try to avoid calling QQuickWindow::mouseGrabberItem() because it's too vague a question to ask (which mouse? or did you mean the synth-mouse during synthesis from a touch or tablet event?); and now it acts different anyway, because eventsInDelivery.top() is an UngrabMouse, which did not include a pointer to the QPointingDevice until now. So now we turn the UngrabMouse event into a QSinglePointEvent so that it's possible to get exclusiveGrabber() and check that the grabber is not the same Flickable. (Otherwise, the grabber that's getting ungrabbed is usually the child receiver item sent to childMouseEventFilter().) Task-number: QTBUG-86729 Task-number: QTBUG-74679 Change-Id: I6dfd96686bdfb54723bbe093406b6ab1f75de855 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Avoid calling QQuickItemPrivate's methods if QQIP is incompleteFabian Kosmale2020-11-173-4/+27
| | | | | | | | | | | | | | | | In QQuickWindow, we instantiate QQuickPaletteProviderPrivateBase, which in turn instantiates its updateChildrenPalettes method, which then calls QQuickItemPrivate::inheritPalette. However, QQIP is an incomplete type at this point. Including qquickitemprivate_p.h would currently create a cyclic dependency, and breaking that dependency might mean outlining performance sensitive code. Thus we instead (ab)use the fact that updateChildrenPalettes is virtual, do nothing in the specialization for QQuickWindow and instead implement the method in the same way as an override in QQuickWindowPrivate. Task-number: QTBUG-88457 Change-Id: I49b357d7a67f1945a4d3c25e8cabd428d1454aa7 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Don't synthesize mouse from touch for items that accept touchShawn Rutledge2020-11-173-17/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Followup to 1457df74f4c1d770e1e820de8cd082be1bd2489e : if an item that has acceptTouchEvents() == true merely fails to accept one touch event, that does not mean a mouse event should be sent. Finish changing the default to false: handling touch events is opt-in, just like handling mouse events; most items don't. And if you opt in, then you MUST handle touch events, because you will NOT receive mouse events as a fall-back. Now that Flickable handles touch, filtering multi-touch events becomes relevant. There was a failure in tst_touchmouse::mouseOnFlickableOnPinch when Flickable grabs a stationary touchpoint at the same time as another touchpoint is pressed, preventing a child PinchArea from reacting. So there's a new rule: just as we start over with event delivery when a new point is pressed, QQuickFlickable::filterPointerEvent() should also not immediately grab when any point is newly pressed; it can afford to wait, because it's filtering, so it will be able to see if one point is dragged past the drag threshold later on. When a parent (such as Flickable) contains only mouse-handling items (such as MouseArea), the parent should filter the touch event if it is able (if acceptTouchEvents() returns true). Flickable is now able to. Filtering parents that are not able to filter touch events can still filter a synth-mouse event as before. But filtering both must be avoided: then we would have the problem that Flickable filters a touch move, sees that it's being dragged past the drag threshold, and sets d->stealMouse to true to indicate that it wants to steal the _next_ event; then it filters a synth-mouse move, and that's perceived as being the next event even though it's just a different view of the same event, so it steals it. In tst_qquickflickable::nestedMouseAreaUsingTouch we rely on the delay caused by waiting for the next event: the MouseArea is trying to drag an item and the Flickable wants to flick; both of them decide on the same event that the drag threshold is exceeded. But MouseArea calls setKeepMouseGrab() immediately, whereas Flickable doesn't try to steal the grab until the next event, and then it sees the keepMouseGrab flag has been set, so it doesn't do it. If Flickable could filter the same event twice (once as touch, once as synth-mouse), this logic doesn't work, so it's effectively "more grabby" than intended. So it works better to have it filter only the actual touch event, not the synth-mouse that comes after. When the child has pointer handlers, we need to visit them, and therefore we should let Flickable filter a touch event on the way. tst_FlickableInterop::touchDragFlickableBehindButton() depends on this. [ChangeLog][QtQuick][QQuickWindow] In Qt 6, a QQuickItem subclass must explicitly call setAcceptTouchEvents(true) to receive QTouchEvents, and then it must handle them: we no longer fall back to sending a QMouseEvent if the touch event is not accepted. If it has additionally called setFiltersChildMouseEvents(true), then it will filter touch events, not any synthetic mouse events that may be needed for some children. Task-number: QTBUG-87018 Fixes: QTBUG-88169 Change-Id: I8784fe097198c99c754c4ebe205bef8fe490f6f4 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Don't copy QKeyEvent instances, store the data explicitlyVolker Hilsheimer2020-11-162-17/+45
| | | | | | | | | | QEvent is a polymorph type, and even though it has a copy constructor, we shouldn't use it. Use the pattern as in QQuickMouse/WheelEvent. Change-Id: I26ab7b831e1e8dd156c32417f74bc7d800bcf71c Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Add logging category qt.quick.pinchareaShawn Rutledge2020-11-131-2/+10
| | | | | Change-Id: Iacfffdc774d5ea6980af7a29da07a82f17799e33 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QQuickWindow: better hover debug, and a reminderShawn Rutledge2020-11-131-1/+7
| | | | | | | | | | | | | In the qt.quick.hover.trace category, the position is the most important thing for now. The output for "q" is verbose and usually there's only one window anyway, so just put the title last, in case we need to debug a multi-window scenario. Dealing with hover in multi-device scenarios is going to be interesting one of these days. Change-Id: I2b687085432ce2e02ca764b8b4669282e0180c54 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* CMake: Change Quick.Window into a pure Qml moduleAlexandru Croitor2020-11-121-7/+0
| | | | | | | | | | | This fixes apps using Qt.Window with static Qt builds when deployed to a machine that doesn't have Qt installed. This will need a counterpart fix in qmake land. Change-Id: Ife11f9d1f1826e1188ef3dc3933af2f243860b6f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QQuickView docs: show correct usage of setInitialPropertiesFabian Kosmale2020-11-122-0/+13
| | | | | | Pick-to: 5.15 Change-Id: If63f4c59f18bc0754ce2e68e424f6efd0f512d30 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix QQWinPriv::deliverSinglePointEventUntilAccepted for wheel, gesturesShawn Rutledge2020-11-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | WheelHandler was only reacting to one wheel event between mouse moves, because it got added to the QQPointerHandlerPriv::deviceDeliveryTargets() vector, and was not removed at the beginning of delivery of subsequent events, as QQuickWindowPrivate::deliverPointerEvent() does. (In Qt 5 the equivalent vector was cleared in QQuickPointerMouseEvent::reset().) Wheel events are delivered via deliverSinglePointEventUntilAccepted() (grabbing the wheel is still not implemented). Native gesture events are delivered that way too; and sure enough, the same bug happens on the macOS trackpad, whether you are attempting to do pinch zoom or just two-finger-flick. tst_QQuickWheelHandler::nestedHandler() sends multiple wheel events in a row, so we do have some test coverage, and hopefully this issue explains why it needed to be blacklisted. Fixes: QTBUG-88428 Task-number: QTBUG-86729 Change-Id: Id1ed4a38dfa3eb2253c4a60f09f80aea0f69707e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Pass QWheelEvent by reference, not by copyVolker Hilsheimer2020-11-121-1/+1
| | | | | | | | It's bad enough that we have a copy constructor for QEvent, but passing a rather heavy type like QWheelEvent by value is inefficient anyway. Change-Id: I0d1736a272c941f17f4290d37e0ae1d2ddc610c8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add Qt 6 API changes doc from qtdocJerome Pasion2020-11-111-1/+162
| | | | | | | | | | -changes to QQuickItem and QQuickWidget -changes to scenegraph's QSG* and QQuick* APIs -content from qtdoc/doc/src/source-breaks.qdoc Task-number: QTBUG-87156 Change-Id: I5d75791b888573a4ad9a9103de56a6c3f7445c7a Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Teach flickable to handle and replay touch as it does mouseShawn Rutledge2020-11-116-113/+241
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QQuickWindowPrivate::cloneMouseEvent() renamed to clonePointerEvent() and generalized to be able to clone any of the kinds of QPointerEvent that we're interested in replaying. Now it is used only in QQuickFlickablePrivate::captureDelayedPress(). Reverts f278bb7c66bb00c9f81b7a3aceeb94cb9b3a1b66 and 012a4528a515af8d7ec7dbc05a38d8fd0d6d4d1b (don't skip tst_TouchMouse::buttonOnDelayedPressFlickable). Some test changes from f128b5dee8a2a03ebc55ed0cd1e749a6599282c3 also get reverted. QEventPoint should always have valid velocity now, so Flickable no longer has to calculate it for itself. Removing that became necessary to fix the movingAndFlicking test. Adds logging categories qt.quick.flickable.filter and .replay. Fixes: QTBUG-85607 Task-number: QTBUG-83437 Task-number: QTBUG-78818 Task-number: QTBUG-61144 Task-number: QTBUG-88038 Task-number: QTBUG-88138 Change-Id: I0ed6802dff5e5d1595adddc389642925f1f2c93d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Silence unused warning in QSGRhiSupport in uncommon build configsLaszlo Agocs2020-11-091-4/+8
| | | | | | Fixes: QTBUG-88235 Change-Id: I47c20f46c77630c47a8bda7dfe6b080eafa8f4d7 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* QML: Rewrite Qt object in actual C++Ulf Hermann2020-11-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Quite obviously, the Qt object is a singleton, extended with a namespace, backed by a member of the JavaScript global object. Defining all the methods as JavaScript functions is unnecessary and duplicates the general type transformation code. Also, it makes it hard to use those same methods from a C++ context as we cannot properly set up the arguments outside the JS engine. Rewriting the Qt object reveals some deficiencies in the old implementation that we need to fix now: 1. The enums of the Qt type were listed as properties of the Qt object, which means you could iterate them with a for..in loop in in JavaScript. This is just wrong. Enums are not properties. This functionality is deleted and the test adapted to check for each enum value separately. The commit message for the change that introduced the iterability already mentioned that the author had failed to find any occurrence of this in the real world. 2. Parsing time objects from strings was done by parsing the string as a date/time and then picking the time from that. We still support that for now, but output a (categorized) warning. Parsing the time directly is preferred where possible. 3. Previously you could create (invalid) dates and times from various kinds of QML types, like int and color. This does not work anymore as we now validate the types before calling the functions. 4. Passing more arguments to a function than the function accepted was unconditionally ignored before. Now, a Q_CLASSINFO on the surrounding class can specify that the arguments should be checked, in which case a JavaScript error is thrown if too many arguments are passed. In order for this to work correctly we also have to ignore JS undefined values as trailing arguments for overload resolution. This way, if a method matching the defined arguments exists, it will be preferred over a method that matches the full argument count, but possibly cannot accept undefined as parameter. Consequently a number of error messages change, which is reflected in the qqmlqt test. [ChangeLog][QtQMl][Important Behavior Changes] You can not iterate the enumerations of the Qt object in JavaScript anymore. This does not work with any other enumeration type either. You can of course still access them by name, for example as Qt.LeftButton or similar. [ChangeLog][QtQMl][Important Behavior Changes] The time formatting functions of the Qt object in QML now allow you to pass an actual time string, rather than a date/time string as argument. Passing a date/time string results in a warning now. [ChangeLog][QtQml][Important Behavior Changes] Functions in the Qt object for formatting date and time will now throw a JavaScript error when presented with a value of an incompatible type, such as int or color. [ChangeLog][QtQml][Important Behavior Changes] The Qt.resolvedUrl() function now returns a URL rather than a string. This follows the documentation. [ChangeLog][QtQml][Important Behavior Changes] The GlobalColor enum of the Qt namespace is not exposed to QML anymore. It did not make any sense before as the enum values could not be used as colors. Change-Id: I7fc2f24377eb2fde8f63a1ffac5548d652de7b12 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQmlListProperty: Use qsizetype rather than int for sizesUlf Hermann2020-11-0917-74/+74
| | | | | | | | | | [ChangeLog][QtQml] The QQmlListProperty callback functions use qsizetype now as type for the size of a list. This is in line with the containers that you might use to back the list. Fixes: QTBUG-88269 Change-Id: Ia38403cb32f241e6c70e1a580dbeff1d6d694331 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Rename "Porting" pages to "Changes"Jerome Pasion2020-11-091-2/+2
| | | | | | | | | | | | | | The content in the porting guides are closer to a changelog than a porting guide. At this point, it is easier for maintainers and contributors to write in a changelog than a guide. This change should help with readability and is closer to the usage of "Changes" in documentation. Part of a rename in other submodules. Task-number: QTBUG-87156 Change-Id: Ibb58a3cba5394962a5709aeb08e3701e16c7775d Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* qquicktextinput: compile with explicit QChar(int) constructorDavid Faure2020-11-092-12/+12
| | | | | Change-Id: I78fe89cd97b462299969d57cda099ce54fa8078a Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QQuickWindow: Check if QQuickItem was not deletedBartlomiej Moskal2020-11-091-0/+8
| | | | | | | | | | | | | | Added check into deliverMatchingPointsToItem method for Android device. In QT_VERSION below 6.0.0 touchEnabled for QtQuickItems is set by default to true It causes delivering touch events to Items which are not interested In some cases it may cause a crash. For example using Material Style in Android. QQuickShaderEffectSource may be deleted and then try to handle touch Fixes: QTBUG-85379 Pick-to: 5.15 Change-Id: Ia2c4e016db57ef9c86fcc31d4cfba6154068a546 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Clear up Canvas docs wrt the unsupported FBO render modeLaszlo Agocs2020-11-061-17/+2
| | | | | Change-Id: I32f34979a45fea6ee1dfc163fa85f340eb7ca1e3 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Promote suffixless graphics api enum values in GraphicsInfoLaszlo Agocs2020-11-062-7/+11
| | | | | | | | | Amends 23dbe3d6e0d3338812ad9f614028a6fdc5a54090. A similar change was done to QSGRendererInterface. Therefore the QML API should follow suit. Change-Id: I2f6d1aeefc17bf3b58b7683f46511d4433194e1c Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Do not assert with OpenGL in qquickcanvasitem testLaszlo Agocs2020-11-061-8/+5
| | | | | | | | | | This is due to not fixing the graphicsApi() check: OpenGL and OpenGLRhi are now the same. The condition should have been removed anyway since it makes no sense in Qt 6. Fixes: QTBUG-88208 Change-Id: I60db54121a0a74bfa3ca1650f90244f36fc7010f Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Use suffixless enum value in graphicsApi check in QQuickFboLaszlo Agocs2020-11-061-2/+1
| | | | | | | ::OpenGL and ::OpenGLRhi are the same thing now. Change-Id: Ic905eb868a7a62d32261bdc025b20e182ed6db7c Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Better describe the Quick 3D use case in QQuickGraphicsConfigLaszlo Agocs2020-11-051-7/+13
| | | | | Change-Id: Iae4a82af31bbefbe34ceef7e68c411e67b41dcd8 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Doc: Fix documentation warnings for Qt QuickTopi Reinio2020-11-0532-131/+116
| | | | | | | | | | | - Remove links to modules and examples that are not part of Qt 6. - Remove links to entities marked as \internal - Add missing enum value and QML property docs where it's trivial to do so. Task-number: QTBUG-88156 Change-Id: I10a1c7bcc5fe0e2354ea69eaf24930362edb7415 Reviewed-by: Paul Wicking <paul.wicking@qt.io>