aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Fix some spelling errors in translated messages and commentsFriedemann Kleint2021-06-191-3/+3
| | | | | | | | Change-Id: I34869a9f6aa8cf0e4eadbd2fbeb6d6aca52f9ca7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 47b7bb33463cd45f6c67020d0c64f309010db1bb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qmlcompiler: Fully support required propertiesMaximilian Goldstein2021-06-175-2/+85
| | | | | | | | | | | | Previously support of required properties was limited to detecting whether a property that was required actually exists. Now it also enables us to determine whether or not the required property was ever bound to. Still limited by the fact we do not fully support script bindings yet. Fixes: QTBUG-86755 Change-Id: I1abb921d3b4f86a7929f0f829b541088e0c2bf60 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 803a5fda05832b139cc1d76b666777491c708a96) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix conversion of entries to be added to QVariantListsUlf Hermann2021-06-174-0/+77
| | | | | | | | | We should pass the variants themselves, not their constData(). Fixes: QTBUG-94502 Change-Id: I92688348d7b46d74935dc11080b26290f5e8be86 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit dbe34dfa0d42510b804c898b77d6fe145473c31b)
* Add missing palette property to QQuickWindowMitch Curtis2021-06-176-8/+338
| | | | | | | | | | This was forgotten in 1875ad7f92cad270cc5857d71096a4b46c27c562. Fixes: QTBUG-91365 Change-Id: I8dabf0e2a5a13f0db5feac5c03e3494948393cb7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 249db12b6020cc3a8f04841b1e28cd529f4929d9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid unnecessary palette allocationsVolker Hilsheimer2021-06-162-0/+76
| | | | | | | | | | | | | | | | | The palette provider allocates QQuickPalette instances lazily in the palette() implementation. Since we only only test here whether a palette is present, uses the non-mutating providesPalette instead. As a drive-by, remove the paletteData() check from setCurrentColorGroup; paletteData() asserts if it would return nullptr, so this check is wrong and misleading. Amends 3675f2b235f32e05cf6d754e81e0e8f8ddd59752. Change-Id: I9701b3520998ec538ef560106a6c6078e7f1c4d8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 7b5c1063de0034d4b9e4345b9493aa3beba62a89) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add active/inactive transition to color group testVolker Hilsheimer2021-06-161-0/+10
| | | | | | | | | | | | Amends 3675f2b235f32e05cf6d754e81e0e8f8ddd59752 by testing that window (de)activation changes the current color group. Task-number: QTBUG-93752 Change-Id: I031956c68c806b169ad02f2877581571aa3ff3f1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 23b2767f66b824341085cd1e7d5bb2b36c34592d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Make tst_qquickshadereffect::testConnection() more robustEskil Abrahamsen Blomfeldt2021-06-151-2/+9
| | | | | | | | | | | | | | | | | The test is there to verify that the sourceChanged property notifier gets a connection, but it also counted all other connections. Since b65159a5ea8db05165b2eaab8e180a12f30063e4 in qtbase the parentChanged, windowChanged and enabledChanged signals are also connected to something so this broke the test. Fix is to make the test explicitly look for the sourceChanged signal and ignore all others. Change-Id: Ia188384b37c9c078e78d09670bd955a69d10c7de Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> (cherry picked from commit 538d81bc69c4fb6eed17bc23c992bcee0c5fa393) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use Inactive color group in inactive windowsVolker Hilsheimer2021-06-112-0/+78
| | | | | | | | | | | | | | | | | | | | A palette has three color groups (Active, Inactive, Disabled), but we only listened to changes of the enabled state, and always used the Active color group for an enabled item. In order for the Inactive color group to take effect, we need to also trigger the update when the "active" property changes. Instead of connecting yet another signal, deliver WindowActivate/Deactivate to as well, and forward from contentItem to all children which can then update the current color group. Add a test case. Fixes: QTBUG-93752 Change-Id: I4f2b6121e822115aaa5c4faaa5d402932dacc67b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 3675f2b235f32e05cf6d754e81e0e8f8ddd59752) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qmlcompiler: Process properties only once parsing is completedMaximilian Goldstein2021-06-113-1/+20
| | | | | | | | | | | Now we do most properties after the fact which eliminates false positives on unknown types that are not known at the time of traversing the AST. It also allows for chaining inline components. This effectively introduces a two pass system but there are some exceptions (i.e. signals) where some deduction that should be run after the fact still runs during parsing. Fixes: QTBUG-93652 Change-Id: Ic1ac0e8ce2d5d5dfbe80c16a341b10cf2b078d81 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit a991d3c1ec5b679f37ea19d7cbef576f3fc1029e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add the 'Private' suffix to the internal module namesAlexey Edelev2021-06-101-1/+1
| | | | | | | | | | | Rename internal modules to adjust their name to the internal module policy. Task-number: QTBUG-87775 Change-Id: I99cbc1214c6f0a9085e921df6225768fd55f5b89 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 7b41628d23308a7cda09df3db5346a6e02bbcdb4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add missing Quick autotests to CMakeListsLaszlo Agocs2021-06-084-15/+26
| | | | | | | | | | | | | | | | | | | | | | | Restore autotests that went missing in the tests/auto/quick project file during the qmake->CMake conversion. Adjust the conditions as relevant for Qt 6, e.g. the qmake project still had some now-unnecessary OpenGL and Widgets conditions. The rendernode test has not been fully migrated to Qt 6 and it's pretty much just QSKIPs for now. This is to be remedied at a later point. The drawingmodes test gets one test disabled for macOS due to unexpected results in the Apple M1 CI configuration (which now has Metal, unlike other the Intel macOS VMs), to be checked later. Do some necessary source code changes as well. Some of these tests did not even compile since they were not exercised in the CI for some time now. Change-Id: Ibcdd7d61f72165ce1c11847d02635340be0c44b1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Allow property observers on readonly propertiesUlf Hermann2021-06-083-0/+31
| | | | | | | | | This makes it necessary to tolerate evaluate() calls after the engine is gone. With non-QProperty properties this can't happen as the engine controls the observers. Change-Id: Ia700a10ad847b8a174b2346a4ad7a4de7afb0c83 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmltyperegistrar: Do not generate namespace metatypes for non-namespacesUlf Hermann2021-06-082-0/+115
| | | | | | | | | | If the target type of a QML_FOREIGN_NAMESPACE is not a namespace, we must not generate another metatype for it because otherwise we get two metatypes with the same name and ID. Change-Id: I0111e995a227c4a5d4c99e47662b7f86767e0da1 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmlformat: use QmlDomFawzi Mohamed2021-06-0522-196/+267
| | | | | | | | Replace qmlformat with the formatter using qml dom Change-Id: Ie90814260f2d3b9e589ce04381d5ad1880c5b519 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmldom: writeOut, write reformatted QmlFawzi Mohamed2021-06-0525-0/+962
| | | | | | | | | | | | Adding writeOut: support for reformatted Qml - linewriter: write line by line with caching, callbacks, SourceLoaction updating - outwriter: write to line writer, and keep track of updated file locations and reformatted ScriptExpressions - reformatter: reformat javascript Change-Id: I4bdc393fb2d9b5a3db944a850719c24ef8726d15 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmldom: compare and dump to file, domtoolFawzi Mohamed2021-06-057-1/+231
| | | | | | | | | | | * qqmldomfieldfilter: ignore fields or types in dump or comparison * qqmldomcompare: compare DomItem * qqmldomfilewriter: safely write to a file (keep backups, avoid overwrite before success is confirmed, avoid overwrite if equal) * qmldomtool: command line tool to dump dom Change-Id: If4fbff7dff70d3a780293ac8b458f674e8f91591 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmldom: representation and load of Qml FilesFawzi Mohamed2021-06-059-152/+706
| | | | | | | | | | | | | | - qqmldomitem: main API for generic access to the Dom - qqmldomtop: represent top level elements: DomEnvironment and Universe - qqmldomelements: definition of the classes representing Qml - qqmldomastcreator: instatiate Dom elements from AST - qqmldomcomments: represent comments in Qml - qqmldomexternalitems: represent files - qqmldommoduleindex: represent types in a module - tst_dom_all: combined test running all dom tests Change-Id: If2320722bc3e6eaab9669ecec6962d5473184f29 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add DragHandler.activeTranslation and persistentTranslationShawn Rutledge2021-06-044-23/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you want to set target: null and then bind translation to some object's x and y properties directly (perhaps an Item, a Qt Quick 3D Model object, etc.), it's a lot less trouble to use a translation property that does not keep changing back to 0,0 every time a gesture begins. In hindsight, the translation property should have been the persistent one (for consistency with the fix for QTBUG-68941, in which we made PinchHandler.scale persistent and added activeScale: b4d31c9ff5f0c5821ea127c663532d9fc2cae43e). But for several years, the translation property has been restarting with each gesture; so now we add a persistentTranslation property. The new activeTranslation property has the same value as the translation property (which is deprecated). Also, the persistentTranslation property is settable, because in some UIs there may be multiple ways to move the same object, and there needs to be a way to sync them up. Also fixed a bug: when minimumPointCount == 2, QQuickMultiPointHandler::wantsPointerEvent() doesn't initialize d->currentPoints until two points are pressed. But often, one point is pressed, and in the next event, the second point is pressed while the first is held Stationary. So QQuickHandlerPoint::reset() needs to set pressPosition and scenePressPosition on both points at the same time, because it is called on each HandlerPoint in d->currentPoints at that time when both points are pressed. So if any point is pressed, act as if they all were freshly pressed. Without this fix, the centroid's scenePressPosition is wrong (based on the average of 0,0 and the second point), therefore a "jump" was occurring when persistentTranslation is used to directly drive a binding (like the tilt in map.qml). [ChangeLog][QtQuick][Event Handlers] DragHandler.activeTranslation now holds the amount of movement since the drag gesture began. DragHandler.persistentTranslation holds the accumulated sum of movement that has occurred during subsequent drag gestures, and can be set to arbitrary values between gestures. Task-number: QTBUG-94168 Change-Id: I1b2f8ea31d0f6ff55ccffe393bc9ba28c1a71d09 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Add support for hyperlinks in Text itemsJan Arve Sæther2021-06-042-1/+36
| | | | | | Task-number: QTBUG-67878 Change-Id: I1e990a5db8f0cf78e5cdcec7359e5aabffe42e3d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Refactor and update qml CMake APICraig Scott2021-06-043-12/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing CMake API for qml modules had a number of shortcomings. Refactor it to achieve the following: - Clearly separate public and internal aspects. - Re-use code from qtbase for adding plugins and module targets rather than reimplementing close variations. - Provide more robust and complete support for qmllint, qmlcachegen and automatic generation of qmldir files. - Reduce the steps needed for more common scenarios. - Encourage the use of separate backing library and plugin targets. - Automatically generate the plugin class .cpp file where possible. - Specify .qml files directly through qml-specific API elements rather than assuming they can be extracted out of a set of resources. [ChangeLog][QtQml] The qml CMake API has changed from 6.1 and is now out of Technical Preview status. The most notable change is that .qml files should no longer be specified as resources, there is dedicated handling for them in the qt6_add_qml_module(). A related change is that the qt6_target_qml_files() command has been replaced by qt6_target_qml_sources(). More complete integration with qmlcachegen, qmllint and qmldir generation is also part of the CMake API. Fixes: QTBUG-91621 Task-number: QTBUG-82598 Task-number: QTBUG-88763 Task-number: QTBUG-89274 Task-number: QTBUG-91444 Change-Id: I25aae1b0e89890394dfe2ba2824008164b2ca8d9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QQuickItem: Make x/y/width/height bindableFabian Kosmale2021-06-035-10/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This ports the four properties properties to Q_OBJECT_COMPAT_PROPERTY. It is not possible to use Q_OBJECT_BINDABLE_PROPERTY, not even for the simpler x and y properties, as QQuickItem calls the virtual geometryChange method in the setters, making them non-trivial. For width/height, we use the new property system to improve the width/heightValid check: We return not only valid if the property has explictily been set (either via a direct setter call, or because the setter has been called when a binding evaluated), but also when a binding is set. This matches the fact that implicitWidth/Height should only be used when width/height is not specified. In theory, this could help in cases where one sets both implicit and explicit properties for Text, skipping one initial layout calculation. As the setters now remove the binding (this aligns with the behavior of writing through the meta-object system), a few test cases had to be adjusted, which relied on the setter not removing it. Further test changes were necessary because the location of a few warnings changed, due to differences in binding order evaluation and error reporting. [ChangeLog][QtQuick][QQuickItem] The x, y, width and height properties of QQuickItem are now bindable. This enables modifying their bindings from C++. One could for instance swap the width of two items, preserving the bindings: // QML Item { Rectangle { id: a; width: parent.width / 2 } Rectangle { id: b; width: parent.width / 3; anchors.right: a.left } } // C++ auto rootCtxt = engine.rootContext(); auto a = qobject_cast<QQuickItem*>(rootCtxt->objectForName(u"a"_qs)); auto b = qobject_cast<QQuickItem*>(rootCtxt->objectForName(u"b"_qs)); auto aBinding = a->bindableWidth().takeBinding(); auto bBinding = b->bindableWidth().takeBinding(); a->bindableWidth()->setBinding(bBinding); b->bindableWidth()->setBinding(aBinding); Afterwards, if the root item gets resized, the width of the rectangles will still be adjusted. [ChangeLog][QtQuick][QQuickItem][Important Behavior Changes] Calling the setWidth, setHeight, setX and setY properties now removes any existing binding from the corresponding property. Change-Id: I5e1553611cb92b033247ada715cea48c962395bc Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Pass property index from MOC to QQmlJSMetaPropertyAndrei Golubev2021-06-033-10/+34
| | | | | | | | This index corresponds to what QMetaObject::indexOfProperty returns for the same property at run time Change-Id: I3868aa8651f75d774026cb27438cea16bca698d7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Selection support: make TableView selectableRichard Moe Gustavsen2021-06-032-2/+199
| | | | | | | | | | | Let QQuickTableView implement the QQuickSelectable interface. The functions implemented from the interface will be used by a SelectionRectangle in Controls to enable selecting cells in the table visually using pointer drag and selection handles. Change-Id: I6e87ffdc63a97a9dd83b8279fa08762772ce4e03 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Allow for accessing QQuickApplication via a singletonMaximilian Goldstein2021-06-031-132/+160
| | | | | | | | | | This is a lot cleaner than Qt.application that can either be a Quick or Qml application type with different properties present. It also helps tooling reason about this sort of code better. [General][QtQuick][New Feature] Qt.application can now be accessed via Application. Change-Id: Ie8f6196384c1736f4c4729b671b105355afdb70e Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qmllint: Add ability to ignore individual warningsMaximilian Goldstein2021-06-032-0/+25
| | | | | | | | | | | Allows users to ignore individual warnings by adding a "// qmllint disable" comment in the line that triggers the warning. This feature is especially useful for use in pre-commit / CI tests as it allows to add exceptions for individual warnings that cannot be fixed immediately. [ChangeLog][qmllint][New Feature] You can now ignore individual warnings by adding "// qmllint disable" in the line causing it. You may also specify one or more warning type to ignore ("// qmllint disable warningtype1 warningtype2...") which is preferable. This can also be done for entire blocks of code by using "// qmllint disable" in an empty line and ending it with "// qmllint enable" Change-Id: Iea6c29132d6b51ecfb5e5d8a19a43446a7286c24 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add QML_EXTRA_VERSION for adding extra QML versionsFabian Kosmale2021-06-025-0/+172
| | | | | | | | Currently internal, as the only user might be qtcharts. Change-Id: I40fc5295de6375c082d82ebeeb73bf4cd6dc7e4a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Reject overrides of final properties (and potentially methods)Ulf Hermann2021-06-022-0/+62
| | | | | | | | | | | | | | | | | | | | | | | If you specify FINAL in Q_PROPERTY you explicitly don't want it to be overridden. Before, we would still accept overrides of such properties. Issue a warning and decline overriding them. For consistency, treat methods the same, even though we cannot declare them final yet. [ChangeLog][QtQml][Important Behavior Changes] C++ properties declared FINAL now refuse to be overridden by other C++ properties. This mirrors the treatment of QML properties trying to override FINAL properties. As we cannot reject the C++ types the way we can reject QML types, the overrides are ignored and a warning is issued. It is also impossible to override final properties with functions now. This used to be possible in the past. Task-number: QTBUG-93662 Change-Id: I244c3e83a33875472bc5bf6786a1e949fe981995 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Selection support: support setting a QItemSelectionModel on TableViewRichard Moe Gustavsen2021-06-023-0/+265
| | | | | | | | | | | | | | | | | | | | Add support for assigning a QItemSelectionModel to TableView. By doing so, delegate items that has a "required property selected" defined will get this updated according to the state of the selection model. It's essential that the property is defined as "required". If not, the property will simply be ignored by TableView. This is done to ensure that existing applications that already has a "selected" property defined, will continue to work as before, unaffected by the new selection API. [ChangeLog][QtQuick] TableView now supports selections by using an ItemSelectionModel. Task-number: QTBUG-74750 Change-Id: I4f4d75e9e65563b9aab0c54f3aa4aad2f6883952 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Allow value type conversion in metaTypeFromJSUlf Hermann2021-06-021-0/+48
| | | | | | | We implicitly do the same when calling toVariant(). Change-Id: I288326125d88bc658dcaf12d3ee623e0e529bb69 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Update sceneGrabPosition in MultiPointHandler's points, on grabShawn Rutledge2021-06-021-1/+12
| | | | | | | | | | We seem to have gotten by without this somehow; but the debug output in QQuickPinchHandler::handlePointerEventImpl() made it clear that it wasn't being done: it would always say the points moved from 0,0 to their present locations. Change-Id: If611adea6ecf0c056ae7d9b34ca86a7530cfc144 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* TapHandler: don't emit tapped() if non-filtering grabber on releaseShawn Rutledge2021-05-312-0/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This comes up for example in qtquick3d/examples/quick3d/dynamictexture: A TapHandler detects clicks on a 3D door model, to trigger the animation to open the door. But onto the door is mapped a subscene containing a TextEdit. If the user clicks in the text to set the cursor position: 1) TapHandler gets the press first (it's a handler, handlers go before items like the View3D), and takes a passive grab. 2) View3D does picking, discovers the subscene on the door surface and begins subscene delivery 3) TextEdit takes the exclusive grab 4) On release, the main DA goes first again; TapHandler gets the event because of its passive grab; but in QQTapHandler::handleEventPoint() we can see that there is another exclusive grabber, which indicates that it (the TextEdit) has taken full responsibility for handling the event sequence. TapHandler cancels the press and doesn't emit tapped(). 5) TextEdit gets the event via the subscene agent because of its exclusive grab; it sees a click and sets cursor position. On the other hand, if we did not check QQuickItem::filtersChildMouseEvents(), we would break some Flickable "interop" tests which expect that handlers can react in spite of Flickable having a grab. Being excessively "grabby" seems to go with the child-filtering concept, so let's continue to let TapHandler react in spite of the grabber in that case. It remains to be seen if we need alternate behavior in other scenarios, which would indicate the need for another enum property or so. Fixes: QTBUG-94012 Task-number: QTBUG-92944 Change-Id: I7d2b03fcb0d286d581547a14e71c27086a9b25f6 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* qmldom: improve PathFawzi Mohamed2021-05-311-2/+10
| | | | | | | | | | | | | | | * PathEls::PathComponent allows heap free handling of a single path component, so make it more public and allow the creation and append to a Path using it. * ensure initialization * use QString in PathEls::Key (will need an extra allocation in fromString, but spares it on key lookups) * make operator bool explicit (it is dangerous to potentially convert to int silently) * consider top==env==universe simplifying path comparisons Change-Id: I293674366a260b61cb7f5a65912714022aff218a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add the possibility of flipping vertically to ImageLaszlo Agocs2021-05-271-0/+41
| | | | | | | | | | | [ChangeLog][QtQuick] Added mirrorVertically to Image to allow vertically mirroring an image. This complements the existing mirror property that performs a horizontal flip. Task-number: QTBUG-93972 Change-Id: Ib571ec27c299d918976d833fb8c8f57d2e385a56 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* qmllint: Add support for loading options from settingsMaximilian Goldstein2021-05-275-15/+46
| | | | | | | | | | | | | | | | | This change adds support for a reading a simple settings file (.qmllint.ini) to set log levels and various other options. The settings file applies on a per-directory basis so linting files in two subdirectories with different settings will use their respective settings files. If the directory of the linted file does not contain any settings we search through all parent directories. This is implemented in a way that qmlformat can also utilize the settings file code. This makes qmllint more useful for larger projects that might want different settings for different parts of their QML code. It also allows for better integration in CI checks and pre-commit hooks. [ChangeLog][General][qmllint] Adds the ability to set linting options via a settings file rather than using command line parameters. Use --write-defaults to generate a template with default values for editing. Use --ignore-settings to disable this feature Change-Id: I94e4a47916b5dfd16c3a69efdba3858235cab738 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fuzzing: Ensure importing minimal plugin into static buildsRobert Löhning2021-05-272-6/+8
| | | | | | Task-number: QTBUG-94030 Change-Id: Idcc4499fbd659e7b55a62e256f22fafa04344530 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Propagate NOTIFY from moc output to qmltypesAndrei Golubev2021-05-272-0/+6
| | | | | | | | This is useful for the object creation compiler when generated aliases should really have a notify which is bound to the origin's notify Change-Id: I805d0d461490da7122e37345914dec4140f342ff Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Emit grabChanged() from DragHandler and PinchHandlerShawn Rutledge2021-05-272-0/+12
| | | | | | | | | | | Followup to ca7cdd71ee33f0d77eb6bf1367d2532e26155cb2 : when overriding a virtual function, it's good practice to call the base class function, in the absence of any reason not to. Pick-to: 5.15 6.1 Fixes: QTBUG-93880 Change-Id: Icbd04faec51d55d8fbf73319bd20f5846761d3d5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* PointerHandler constructor: add to Item parent's list of handlersShawn Rutledge2021-05-262-0/+61
| | | | | | | | | | | | | When a pointer handler is created in C++, a parent Item might be given to the constructor, so QQuickItemPrivate::data_append() might not be called. But to be functional, it needs to be added to ExtraData.pointerHandlers. Task-number: QTBUG-68110 Change-Id: I02f6574f801018b964ecf4167bac65792d9c6094 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Add dynamically-created pointer handlers to parent's resourcesShawn Rutledge2021-05-261-0/+7
| | | | | | Fixes: QTBUG-94005 Change-Id: I609620627682e3e95c284adf897b08007e3e0726 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Evaluate type assertions in QMLUlf Hermann2021-05-264-23/+62
| | | | | | | | | | | | | | | | | | Type assertions actually check whether the expression matches the type, and return null if it doesn't. [ChangeLog][QtQml] You can use TypeScript-like type assertions using "as" now. In contrast to TypeScript, QML's type assertions are enforced at runtime. If the type doesn't match, null is returned for object types. Also, type assertions can only cast to object types. There is no way to create a value type or primitive type reference. As value types and primitives cannot be polymorphic, this doesn't matter, though. There are other ways of converting those. Task-number: QTBUG-93662 Change-Id: I00fce3d4ea7a8c6b4631c580eaf6c113ac485813 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Clean up various QML test-case scriptsEdward Welbourne2021-05-2614-212/+209
| | | | | | | | | End statements in JavsScript functions with semicolon, slightly improve the naming of some variables, only use as many parentheses as actually grant us some benefit. Change-Id: Ib2c68a84366bf74b9bc2ab8145603170dc559ad4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Restrict types from unversioned imports only by major versionUlf Hermann2021-05-262-0/+28
| | | | | | | | | | | | | | | | The versionless import tells us that any version of the type is allowed. We still record the major version because types have to be re-registered for each major version. Any minor version belonging to that major version is allowed, though. Restricting by minor version has the effect of passing the minor version of the "host" type into grouped property accesses. This is certainly unwelcome as the grouped type can have a higher minor version than the host type. Task-number: QTBUG-33179 Pick-to: 6.1 Change-Id: I73f0f4fdaa00ac13cf91a4c21fd705c9dba070ec Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Behavior: intercept bindingsFabian Kosmale2021-05-254-1/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the new API in QQmlPropertyValueInterceptor and QQmlInterceptorMetaObject to acutally intercept bindable properties in Behavior. This works as follows: We intercept the bindable metacall, and construct an untyped proxy property. The proxy property has storage for the property data (currently via constructing a QVariant for it). It also has its own binding data. We install an observer on the proxy binding data which notifies us whenever the proxy changes. That observer is actually the QQuickBehaviorPrivate (which now inherits QPropertyObserver). Whenever the observer triggers, we read the current value of the proxy property and call QQuickBehavior::write with it. That's how Behavior can now track updates. As binding updates end up calling the write method of the Behavior, we get support for toggling enabled for free. The final part of the puzzle is how to get the property system to use the proxy property instead of the real property. This is done when we intercept the Bindable metacall: Instead of returning the source's QUntypedBindable, we construct a custom one. Its functions do the following: - setting/getting values and bindings do not affect the source, but instead operate on the proxy - observers are still installed on the source; that way, they see all writes done by the interceptor, instead of only the direct writes to the source property - makeBinding forwards to the source - We make use of the metatype multiplexing hack in the getter Task-number: QTBUG-90999 Change-Id: Ib91a12b05975f1257026ba4d2b64ec14852d4a14 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* mingw: Skip segfaulting testsOliver Wolff2021-05-251-0/+15
| | | | | | | | | | | | | | QQuickDesignerSupportProperties::registerCustomData segfaults on mingw. Due to these segfaulting tests, mingw is marked insignificant at the moment. In order to get at least some test coverage for this configuration, the tests are skipped for now. Task-number: QTBUG-90869 Pick-to: 6.1 Pick-to: 6.0 Change-Id: I75c61b83c53e038be4dc518bf39955f477d381ee Reviewed-by: Heikki Halmet <heikki.halmet@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* tst_qquickaccessible: Avoid accessing deleted objectsFabian Kosmale2021-05-211-2/+6
| | | | | Change-Id: I851baae8e3dbcb64ad0c34c4c2fa00d89cb77dee Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Use build time shader compilation in lancelot testsEirik Aavitsland2021-05-2190-475/+246
| | | | | | | | | Clean up the remains of Qt 5 shaders, and use the simpler Qt 6 way of adding shaders to the app. Pick-to: 6.1 Change-Id: Ibbdf7ada899507705a2709913410b24d476d25d3 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Use fixed qt_add_resource BASE argumentJoerg Bornemann2021-05-218-331/+85
| | | | | | | | Pick-to: 6.1 Task-number: QTBUG-86726 Change-Id: If6e1033642d98ccd40daeb57a453c0e5bc2985da Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Don't let PointerHandler steal mouse grab from keepMouseGrab layerShawn Rutledge2021-05-202-0/+88
| | | | | | | | | | | | | | | As explained in the comment, the handler can override the keepMouseGrab "veto" if the item is a parent (like a Flickable) that filters events, but not in other cases. The logic was wrong though, apparently. Amends 090f404cf80da35734f712b02cc1543acecd5b62 Pick-to: 5.15 6.1 Fixes: QTBUG-78258 Task-number: QTBUG-79163 Change-Id: I9a473ab3b23743f863cb0be13767fdbc29cd5e1c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Reduce velocity in manual test MomentumAnimationShawn Rutledge2021-05-202-3/+3
| | | | | | | | | | | | In Qt 5 the numbers were smaller, as if units were pixels per millisecond. In Qt 6 it hopefully really is in logical pixels per second; so the animation destination should be divided by 1000 relative to what it was before. Likewise the velocity arrow in flingAnimation.qml should be 1000x shorter. This looks and feels about right currently. Fixes: QTBUG-93886 Change-Id: I7b8039024bff11f1a65a2f02ac5e2d85654cbdd0 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fuzzing: Provide CMake files for fuzz targetsRobert Löhning2021-05-202-21/+57
| | | | | Change-Id: I1121331b3f8c4ed015979f164e12e81183822e2f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>