aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* qqmltypeloader: Fix plugin not loading on MinGWMaximilian Goldstein2020-12-101-1/+1
| | | | | | | | | | | Usually libraries get a lib prefix when using MinGW but plugins are expected to not have a prefix, causing the plugin to not load properly. This change fixes this by using the MODULE keyword. Pick-to: 6.0 Fixes: QTBUG-89187 Change-Id: Icd543015805a8157d59c20e86134421911930ea1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Regenerate projects using pro2cmake one last timeAlexandru Croitor2020-12-1019-23/+202
| | | | | | | | | And fix up some incorrect qmake project files Pick-to: 6.0 Change-Id: Ia6d27ac68195635021fe7c4a5f06386a60f3f323 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Support namespaced QML_ELEMENTMaximilian Goldstein2020-12-102-1/+17
| | | | | | | Fixes: QTBUG-87266 Change-Id: Iad8c7765b339c5498f541702bbf7df64164f5358 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix IC properties in same fileFabian Kosmale2020-12-102-0/+12
| | | | | | | | | | | Also fixes typename and metatype registration for inline components. Done-with: Fabian Kosmale <fabian.kosmale@qt.io> Pick-to: 5.15 Fixes: QTBUG-89173 Change-Id: I97d65d5539b577a8828d5711e5f2e79c8568b441 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Show a tableview even if the syncView has an empty modelAndy Shaw2020-12-091-0/+43
| | | | | | | | | | By showing the tableview, we can be sure that headerviews will be visible even in the syncView has an empty model. Fixes: QTBUG-87526 Change-Id: I68c8b119122a2d2f88c2afbeb2d6c71a83a3ce33 Pick-to: 5.15 6.0 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* qqmlistmodel: Fix crash when modelCache is nullMaximilian Goldstein2020-12-081-0/+22
| | | | | | | Fixes: QTBUG-89173 Pick-to: 5.15 Change-Id: Ife82518808fc5504ec42407e80ed3de89ed4adeb Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Blacklist testTransitionsWithImplicitFrom on openSUSE againLiang Qi2020-12-081-1/+1
| | | | | | | | This amends f87c4c7c2a0866662143fdbb3060e7d6ccaf337c. Task-number: QTBUG-89023 Change-Id: I4d3e03df6071b4fbaef3d1c60605dc68ca37aaad Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
* QJSValue: Add toVariant() overload with conversion behaviorUlf Hermann2020-12-071-14/+69
| | | | | | | | | | | | The QJSValue to QVariant conversion is traditionally messy. The recent addition of a special case for FunctionObject did not make that better. Rather, we now add a way of specifying that the conversion should be lossless, which avoids all conversions of JS objects and arrays. Amends commit 6b08c24297f39f3c67bc5c16f46198b33af66529. Change-Id: I6d4506b52d3175ed2f2984f8a26d560cf6311ab6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Allow checking for and catching errors from QJSEngineUlf Hermann2020-12-071-0/+14
| | | | | | | | | As you can manually throw an error, you should be able to catch it again, too. Change-Id: I82475df1969a1fd76f4cf5fc0a8d921dfafaef89 Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Allow the QML console methods to be called from outside JSUlf Hermann2020-12-072-0/+16
| | | | | | | There may not be a stack frame and that is OK. Change-Id: Iccac4db1530c9a4b316905a3a283d36674c146a8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Pointer manual test: double up flickablesWithHandlers.qmlShawn Rutledge2020-12-054-13/+25
| | | | | | | | It was one Flickable before, with stuff in it; now it's two of the same, side-by-side, so as to test flicking the two in parallel on a touchscreen. Change-Id: Iec1ef935ee1c0a97bed49959b117b85d65fa84af Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* qv4qmlcontext: Fix bounded signal expressions when debuggingMaximilian Goldstein2020-12-041-3/+9
| | | | | | | Fixes: QTBUG-83599 Pick-to: 5.15 Change-Id: I8909f0b2d3eca909512b99c172c8dc5e93e48482 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* tst_qqmlecmascript: Avoid memory leak on failureFabian Kosmale2020-12-031-3/+2
| | | | | | Pick-to: 6.0 Change-Id: Icf31fbe473e5b0659cfe09d5bef8652c22a2b1ce Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QML engine: Fix binding setupFabian Kosmale2020-12-034-0/+33
| | | | | | | | | | | We set QProperty bindings up in the wrong way: Parent components would overwrite their child component's binding. This patch reverses the order, fixing the bug. Task-number: QTBUG-87153 Pick-to: 6.0 Change-Id: I3e90d1d14a41a7c5c337745f1453484d360a3979 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QML engine: Deprecate DefaultMethodFabian Kosmale2020-12-032-2/+6
| | | | | | | | | | | | | | | | | | | | | | Assigning objects to signal handlers can be convenient, as seen in the examples which use it together with ListView.onRemove. However, that convenience makes it hard to reason about what actually happens. Moreover, the only user of that functionality are the Animation classes, and the usage of DefaultMethod is not documented anywhere. [ChangeLog][QtQml] Assigning an object to a signal handler is deprecated. Instead, create the object, give it an id, and call the desired slot from the signal handler. For instance, instead of of ListView.onRemove: SequentialAnimation {...} use SequentialAnimation {id: removeAnimation; ...} ListView.onRemove: removeAnimation.start() A warning will be printed whenever an assignment of an object to a signal handler occurs. The warning can be controlled via the qt.qml.defaultmethod logging category. Change-Id: I001ddf4d7933871977f84a5e012d020fb043cc64 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qmldom: DomItem and common APIFawzi Mohamed2020-12-035-0/+232
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds the main API of the Dom model: The idea of the Dom Model is to expose a simplified an uniform model, while keeping typed objects (as one is used in C++, and ideally using the modern C++ approach with containers, and avoiding manual memory management). In particular this approach avoids reducing everything to an untyped model. The central object in this is the DomItem, it is a value type that keeps a pointer to the actual element. A non empty DomItem always keeps some context (a canonicalPath) and one can explore its containers and its contents. Non existing or missing values simply translate to empty DomItems and one does not need to check at each step for invalid things. See the DomItem documentation for more information. The as() ad ownerAs() templates let one cast back the DomItem to the underlying elements. To expose an element with minimal effort one has to mainly implement the method iterateDirectSubpaths(), and iterate through all elements contained in that element (see the documentation of DomBase for more details). Containers, simple data and references can be wrapped in DomItem elements just when accessed, so the underlying C++ object can use the usual containers/datatypes. A good model should not just be easy to browse, reference and extend with new elements, it should also have a clear parallelizazion/ multithreading policy. This is less relevant for a single pass compiler, but for is relevannt for a code model. The fact that the current code model now somehow works only from the GUI thread show the importance of a clear policy when multiple people can contribute. In the Dom model there is the following idea: - During build time pointers to the elements can change (MutableDomItem should be used) - Access to sub elements normally has no locks, they should be either accessed by a single thread or immutable. - OwningItem are the unit of multithread safe updates, the have a mutex and protect the parts that need protection - A DomEnvironment can refer to a parent Environment, perform several changes (in a separate thread), and commit them all at once (in a sparate commit). This commit contains all the main API, and tests for it. The bulk of the concrete element will be in followup patches. Task-number: QTBUG-74840 Change-Id: I9e14e8560e3b4aa3268a733fed37e9090c18e3ab Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQmlPropertyCache: Remove unused copyAndAppend overloadFabian Kosmale2020-12-031-3/+3
| | | | | | | Original-patch-by: Lars Knoll <lars.knoll@qt.io> Task-number: QTBUG-88765 Change-Id: I85dad61a1c3ade29137be9870ce8af726be81a28 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Use QMetaType instead of metatype-id, take 2Fabian Kosmale2020-12-031-3/+3
| | | | | | | | | This time, the ValueTypeFactory gets converted. As a consequence, many callers get touched again. Task-number: QTBUG-88766 Change-Id: I3a8b7d5cfeb7fac85daf1702febba205971d4256 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Mark url as builtin typeUlf Hermann2020-12-022-0/+20
| | | | | | | | | Also, allow conversion from UrlObject and String. We allow the string conversion because we treat string and url as interchangeable in various places. Change-Id: Ib229c6d190e1c5d849ea18798925965b8dbeef7e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Un-blacklist tst_TouchMouse::hoverEnabledShawn Rutledge2020-12-011-3/+0
| | | | | | | Task-number: QTBUG-86729 Task-number: QTBUG-40856 Change-Id: I6936833236b584d9f91cca1583434fa9982ec569 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* qmldom: Add Path and ErrorMessage to DomFawzi Mohamed2020-12-018-0/+409
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds more groundwork for the Dom library. QQml::Dom::Path represents a path in the Dom model. It goes from an element of the Dom model (DomItem) to another. It can be created either from a string, with the path static functions or by modifying an existing path Path qmlFilePath = Path::fromString(u"$env.qmlFilesByPath[\"/path/to/file\"]"); Path imports = qmlFilePath.subField(u"imports") Path currentComponentImports = Path::current(u"component") .subField(u"imports"); This is a way to refer to elements in the Dom models that is not dependent from the source location, and thus can be used also be used in visual tools. A Path is quite stable toward reallocations or changes in the Dom model, and accessing it is safe even when "dangling", thus it is a good long term reference to an element in the Dom model. In this commit the element of the Dom Model (DomItem) is represented just by a stub object, it will be added in a subsequent commit. This commit also introduces the ErrorMessage object. ErrorMessage is an object used to represent error, warning and other messages in the Dom model. Errors are grouped by tags (ErrorGroups). ErrorMessages might have a unique identifying string (using a number in a base library that cannot have a list of all possible errors does not work well. ErrorMessages should be localized and *can* be pre-registered, but do not have to be. ErrorMessages can be associated with a QQml::Dom::Path, a file and a Sourcelocation. The path (if present) might allows one to show errors also in more visual tools. Task-number: QTBUG-74840 Change-Id: I77fb4b78e15ba3674d74937106d40dba4076cedc Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Blacklist testTransitionsWithImplicitFrom on openSUSELiang Qi2020-12-011-0/+1
| | | | | | Task-number: QTBUG-89023 Change-Id: I620d47ef6f519d59436fe096ccaa78216b23d98a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Blacklist testTransitionsWithImplicitFrom on Ubuntu 20.04Fabian Kosmale2020-12-011-0/+3
| | | | | | Task-number: QTBUG-89023 Change-Id: I76b3920de3cd933f573f1a800fe800a8d5413798 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Adjust toolsupport test to qtbase changeFabian Kosmale2020-12-011-1/+1
| | | | | | | Change-Id: Id12b484634d66d3f46c7905e233beb6cd5897979 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 468888cf08c181366df94627522b9e282d364b81) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Relax the timings on the new testTransitionWithImplicitFrom testRobert Griebl2020-11-301-6/+6
| | | | | Change-Id: Ie9fae8a7edb07c6df499a06fdc9d539e114b789e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Allow parent to filter out-of-bounds synth-mouse for grabbing handlerShawn Rutledge2020-11-305-40/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider Flickable { Text { TapHandler { gesturePolicy: TapHandler.ReleaseWithinBounds } } } On press, TapHandler gets the exclusive grab. Now drag vertically. The Text is short in stature, so your finger soon strays out of bounds of the Text, likely before you have dragged past the drag threshold. In this case, we want Flickable to continue to filter the move events because of the fact that TapHandler is the grabber. If it was a MouseArea instead of a TapHandler, it already worked that way; so this makes behavior of handlers more consistent with that. More specifically: QQuickPointerTouchEvent::touchEventForItem() now generates a touch event even if the touchpoint is not within the bounds of the given item, but is grabbed by one of that item's handlers. Until now, we had that exception only if it was grabbed by the item itself. tst_FlickableInterop::touchAndDragHandlerOnFlickable now always drags the delegate at index 2 (the third one) from its upper-right corner, upwards and to the left. The first drag goes outside the delegate's bounds, but the Flickable/ListView/TableView filters and takes over anyway (on the next drag), to prove that it is correctly depending on the grab that the TapHandler (or DragHandler) took on press. Pick-to: 5.15 Pick-to: 6.0 Fixes: QTBUG-75223 Change-Id: Ie4e22c87be0af9aa3ff0146067b7705949b15c40 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Replace some more foreach with ranged forVolker Hilsheimer2020-11-301-1/+1
| | | | | | | | Fix coding style as a drive-by. No need for qAsConst as QVarLenghArray is not an implicitly shared class. Change-Id: I8a9ec3c76f8f6459a1605b02f4682ab3ce091d1a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Speed up tst_FlickableInterop::touchAndDragHandlerOnFlickableShawn Rutledge2020-11-296-0/+54
| | | | | Change-Id: I9d01dc00c68979aa9288820fddaaa7b0208bec9b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix Animators requiring an explicit from valueRobert Griebl2020-11-284-4/+142
| | | | | | | | | | | | | | | | | | | Contrary to the documentation, Animators have always had the requirement that an explicit from value was specified, which isn't very convenient e.g. in Transitions. This patch was tested against a (quite big) real world customer application using Qt 5.12 and Qt 5.15. Also a new unit test was added to test this feature. I couldn't find another way to access the actual AnimatorJob besides querying the window's AnimatorController, so I had to add an auto-test only export on that class. Task-number: QTBUG-66475 Pick-to: 6.0 6.0.0 Change-Id: Icc2a220a13f587d69594a4b2ed345abf0438e29e Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Modernize the Animators auto test buildRobert Griebl2020-11-282-10/+12
| | | | | | | | | The pro file was adapted to the state of the qquickanimations one and the cmake part regenerated. Pick-to: 6.0 6.0.0 Change-Id: I5dbc2c985a84019e42c974468db4b8dc0fa3d210 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Correct height properties for QQuickText with reducing lineHeightReinhard Raschbauer2020-11-261-2/+16
| | | | | | | | | | | | | | | If the property lineHeight is used to reduce the line height, either by setting a proportional factor smaller 1.0 or a pixel size smaller than the font size, the offset calculated in lineHeightOffset is not taken in to account to calculate the height properties. But the offset is used to position the the rendered text. In the current implementation the property lineHeight does not have an effect on single line texts. This change takes that into account and adds lineHeightOffset to all height properties. Fixes: QTBUG-88229 Change-Id: Iab7d9b39a4c7876c7c95e43be6846623c10b0607 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QML engine: Use QMetaType instead of metatype-id in propertydataFabian Kosmale2020-11-261-1/+1
| | | | | | | | | | | | | | We don't want to convert back and forth between QMetaTypes and ids. This change is the first step towards using QMetaType directly everywhere. By reordering the members of QQmlPropertyData to avoid a gap caused by alignment, we can replace the typeid int with a QMetaType without requiring more space. There are still a few places left using metatype ids, notably the value type logic. Task-number: QTBUG-82931 Change-Id: Ic38f38d10c71ed20655877976c9cb5ee3cbe2d77 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QJSValue: On toVariant() don't try to unwrap function objectsUlf Hermann2020-11-261-0/+15
| | | | | | | | We cannot retrieve anything sensible from those. Therefore, just wrap the QJSValue into a variant. Change-Id: I8acd9fb59a8859c8b2c389efb7934b597a2e479f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Improve stability of animated lancelot test sceneEirik Aavitsland2020-11-261-1/+1
| | | | | | | | | The lancelot test has shown sensitivity to timing on some platforms; this change improves stability there. Pick-to: 6.0 Change-Id: I9c8519423635fc22724d96e0a09bcdd1dd0a0102 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Allow retrieving an imported script from a QML contextUlf Hermann2020-11-251-0/+11
| | | | | | | | | This way you can access the properties or call functions provided by the imported script from C++. Previously there was no way to get to them via public API from outside of QML/JS. Change-Id: Ia7813ef6fbec81898c302809118c31f9dcf0f95e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix crash when calling hasOwnProperty() on proxy objectRichard Weickelt2020-11-241-1/+30
| | | | | | | | | | | Property pointer p needs to be checked for nullptr value in QV4::ProxyObject::virtualGetOwnProperty(). This can happen when calling hasOwnProperty() or propertyIsEnumerable(). Fixes: QTBUG-88786 Pick-to: 6.0 5.15 Change-Id: I43da58fed4d8656f9187213f7317f17398739e34 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Purge renderpass refs from renderer when redirecting via QRhiRtLaszlo Agocs2020-11-241-1/+32
| | | | | | | | Pick-to: 6.0 Fixes: QTBUG-88761 Change-Id: Ia5df65a4a09a7554a7d0cca4533f766cb5abe97b Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* qmlformat: Add indent optionsMaximilian Goldstein2020-11-243-39/+343
| | | | | | | | | | | | Adds the ability to use tabs or any amount of spaces for indentation instead of the default of 4 spaces. [ChangeLog][QML][qmlformat] Added option to customize indentation. Fixes: QTBUG-86413 Change-Id: I3c370dda2d0069ef61202a2d862ce15bc513e55e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Attempt to stabilize tst_QQuickListView::sectionsSnapShawn Rutledge2020-11-242-4/+2
| | | | | | | | | | It only failed due to being in a "bad" sequence with other tests somehow. Fixing by reordering is lame, but I can't find the actual reason that it fails, so far. Task-number: QTBUG-86729 Change-Id: I8450c2e4b3119326c8518a526801cd10e933dca0 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix qmake build of tst_qquickview_extraAndrei Golubev2020-11-242-0/+4
| | | | | | | | | | While dev/6.0 uses CMake as a main build system, just in case we will run qmake tests in CI, make sure it works Leftover of 3a5617dc45e281552b9c1f7a04f0561b8fa14d94 Pick-to: 6.0 Change-Id: I32efba9140206f0dfb2e8458fe5c6a2d4d51dbc7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Don't deliver to non-grabbing pointerhandlers if a point is grabbedShawn Rutledge2020-11-231-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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). Pick-to: 6.0 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>
* Fix QML property cache leaks of delegate itemsAndrei Golubev2020-11-235-0/+156
| | | | | | | | | | | | | | | | | | | | | The delegate items are destroyed through an event loop by a call to a deleteLater(). This, however, doesn't work when the application is in the process of exiting and the event loop is already closed (i.e. we're in a stack unwinding part that starts after app.exec()) Combat this situation by setting a parent of the to-be-deleted object to some QObject that will be destroyed e.g. QCoreApplication::instance() before the program finishes. As QObjects clean their children on destruction, this will make sure that we cleanup the previously leaking thing regardless of the event loop Added a test to check that delegates are destroyed (as a separate binary due to differences in main() function) Fixes: QTBUG-87228 Pick-to: 6.0 5.15 Change-Id: I59066603b77497fe4fd8d051798c3e4b47c119f0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmldom: Start of the Qml Dom libraryFawzi Mohamed2020-11-238-0/+171
| | | | | | | | | | | | | | | The goal of the Dom library is to provide a nicer to use basis for the Qml Code model, to be used by the various QML tools, the designer and the new compiler. This commit just adds some common utilities used by the library, to output strings to a Sink, i.e. a function<void(QStringView). This allows writing without allocations of extra temporary strings. The more interesting parts are added in subsequent commits Task-number: QTBUG-74840 Change-Id: I8fa43d5b622f59c8761b2469551127c0508c23c3 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix multipointtoucharea_interop testsShawn Rutledge2020-11-232-19/+15
| | | | | | | | | | | | | | | | | | | | | | In several places these were doing stuff like touch.press(1, p1).commit(); QTRY_VERIFY(devPriv->pointById(0)->passiveGrabbers.contains(drag)); The point ID is really the key in activePoints, it doesn't necessarily start from 0; so pointById() has to be given the same point ID that was used in the event, otherwise it will construct a new point(0). But now tst_MptaInterop::touchesThenPinch fails further down: after the complicated series of events, when only one point is still being dragged, DragHandler fails to grab it and start dragging for some reason. dragHandlerInParentStealingGrabFromItem() uses mouse not touch. Pick-to: 6.0 Task-number: QTBUG-86729 Change-Id: I7ad0d3f30cb5fee15fe83183d62ee10a020c14df Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix tst_TapHandler::componentUserBehavioralOverrideShawn Rutledge2020-11-232-4/+2
| | | | | | | | | | | | | The QQuickPointerHandler::grabChanged() signal now has QEventPoint by value rather than by pointer (because it's a value type, whereas in Qt 5 it was a QObject). Amends a97759a336c597327cb82eebc9f45c793aec32c9 Pick-to: 6.0 Task-number: QTBUG-86729 Change-Id: I5514dc1b49a0b47276c41264e18f6a541bc2a3f0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix tst_PointHandler::pressedMultipleButtonsShawn Rutledge2020-11-232-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | QQuickWindowPrivate::deliverPressOrReleaseEvent() calls QPointerEvent::clearPassiveGrabbers() for every QEventPoint that has the Pressed state. This is consistent with the idea that for every press (a different mouse button or a different touchpoint), we start over with event delivery so that different items and handlers can see what's going on and decide whether it's relevant for them. But QQuickPointerHandler::onGrabChanged() reacts with setActive(false). So for example if we press left mouse button, then keep holding it and press right mouse button, PointHandler changes its active state twice, because its passive grab was cleared and then we visit it again; it's still interested in tracking the mouse, so it takes another passive grab and becomes active again. Avoiding emitting activeStateChanged in this case would seem a bit contrived. As long as the release of one button doesn't make PointHandler completely lose interest prematurely, QTBUG-66360 can still be considered fixed, I think. Pick-to: 6.0 Task-number: QTBUG-66360 Task-number: QTBUG-86729 Change-Id: I132a8c5d1878769481b8afcc62ba237b4498b069 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix compiler warningsVolker Hilsheimer2020-11-231-15/+15
| | | | | | | | | | The bit flags in QAccessible::State are unsigned, numeric literals are signed, resulting in compiler warnings when comparing. Instead of QCOMPARE'ing bitflags that are used for booleans, use QVERIFY. Pick-to: 6.0 Change-Id: I9fd6906a8c1c1e356f8e6c5b36d40f6c41590ee8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* tst_qquicktextinput: Do not construct illegal QCharFabian Kosmale2020-11-231-4/+17
| | | | | | | | | | | This change does the minimal amount of work to get the test to run without crashing due to triggering a QChar assert. Note that Key::toString does not check whether the QChar value it tries to construct is actually valid; but all values in the test case are. Fixes: QTBUG-88712 Change-Id: Ie484e66de46ad1d78573c31d90d40c99b8fd7caa Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* qmltyperegistrar: Expose interface informationMaximilian Goldstein2020-11-232-0/+30
| | | | | Change-Id: Ica3f5c6696542921bc8d399cd46d901ba06f6d83 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qqml.h: Add QML_IMPLEMENTS_INTERFACESMaximilian Goldstein2020-11-232-15/+4
| | | | | | | | | | Needed in order to allow for the declarative registration of classes implementing interfaces. Fixes: QTBUG-88623 Pick-to: 6.0 Change-Id: Id9c1ae92774dd9c316ceaa737cb48ef28f56545c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>