Commit Graph

11947 Commits

Author SHA1 Message Date
Olivier De Cannière 6a2308e500 Compiler: Don't stop after first diagnostic
The type propagator currently skips all subsequent instructions as soon
as an error occurs. We want to be able to provide more than one warning
at the time within the same binding/function.

Therefore, stop skipping all instructions on the first error. The output
accumulator is set to a var after an error to avoid leaving it in an
invalid state and to be able to reuse later code. Some extra checks were
also added to avoid crashes.

Fixes: QTBUG-127624
Change-Id: Ifc0389767a067181c6e3ba4d5c3fc1a0597c29ef
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2024-08-23 07:56:20 +02:00
Oliver Eftevaag 643eefc5ae Explicitly use popupType: Popup.Item in tst_qquickapplicationwindow
The test focusAfterPopupClosed(), checks to see that the delivery agent
causes correct updates to which item has active focus in a given scene.
However, when using popup windows, a popup's popupItem is moved into a
different scene, and the delivery agent won't respond the same.

We already have tests in tst_qquickpopup, to verify similar behavior
with popup windows.

Set the value to be explicitly Popup.Item, in case we change the default
value in the future.

Task-number: QTBUG-126553
Pick-to: 6.8
Change-Id: Ie1b2319adafc2b1a616d6b153fee49ac472a972c
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-08-22 21:35:38 +02:00
Oliver Eftevaag 5c93e54b2e Explicitly use `popupType: Popup.Item` in tst_QQuickDrawer::multiTouch
The test isn't designed to work with popup windows.
In case we change the default popupType to be Popup.Window, in the
future, we'll need the value to be explicit for this test.

Task-number: QTBUG-126553
Pick-to: 6.8
Change-Id: I97c8258889b3d283b7871c5711a2be3e458a03d0
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-08-22 21:35:37 +02:00
Ulf Hermann 9a936d1740 QQmlObjectModel: Guard against spontaneous deletion of objects
Since QQmlObjectModel does not own its elements, we cannot assume
anything about their life cycle. Observe the elements using QPointer and
do not access them anymore when they are dead.

Pick-to: 6.8
Task-number: QTBUG-124345
Change-Id: I3ba806ae2bbc6ec0b0d97ae6c51cea32e25d4508
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-08-22 16:08:24 +02:00
Oliver Eftevaag ba5ab676bd fix small typo in tst_qquickpopup
Pick-to: 6.8
Change-Id: I7e3603270a6545fda3b108ff6676810047e1d2d2
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2024-08-22 15:59:31 +02:00
Ed Cooke 3eff6a639f Modify tst_popup.qml::test_anchors() to accommodate PopupWindow popups
The test test_anchors() in tst_popup.qml checks the success of centering
a popup by querying its local position. This does not work for top level
windows and so an extra calculation has to be added using the global
co-ordinates of the popup to find its local position. There is also a
bug when centering the popup in the overlay, and the overlay is not the
parent. This bug is a result of not translating the expected results to
the co-ordinate system of the parent.

Task-number: QTBUG-126553
Pick-to: 6.8
Change-Id: I9605b6fd290180f777afd35573163fd3c9eff95f
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2024-08-22 10:24:52 +02:00
Ed Cooke b5d379d28b Request window activate after show in tst_qquickapplicationwindow
The qquickapplicationwindow tests are failing when run locally because
the window is not activated after it is shown.

Task-number: QTBUG-126553
Pick-to: 6.8
Change-Id: I6c429016a0271b03581d3077f052ad46afbe5b09
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2024-08-22 10:24:23 +02:00
Ulf Hermann 456fd5b506 qmltyperegistrar: Guard generated includes by __has_include
We may not need all the includes we generate since we may be able to
rely on transitive includes in some cases. At the same time, not all
includes may be available since people don't always add all the include
paths. Where both of those conditions hold, we can still compile.

Pick-to: 6.8
Task-number: QTBUG-127442
Change-Id: I8a223ab62ee3bef777230d85074363f575c592bd
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
2024-08-21 23:54:14 +02:00
Ulf Hermann b870d14abf qmltyperegistrar: Omit some includes for base types
If a header contains only types that are used as base types we don't
need to include it in the generated code, since those have to be fully
defined.

Pick-to: 6.8
Task-number: QTBUG-127442
Change-Id: I4fda16f60dab014fcf4a2a8ba51e120e6fb767fc
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
2024-08-21 23:54:05 +02:00
Mikko Hallamaa 98778f00b9 Flickable: Don't consume wheel events towards adjacent bound
When using nested Flickables, inner Flickable consumed wheel events even
when it didn't move the view. Touch input and touchpad scrolling
correctly propagated the events to the outer Flickable.

This patch adds additional logic to the code path handling wheel events
for view movement to not accept the event if the view doesn't move.

Additionally a test for this is added that checks that the outer
Flickable moves in this case.

Fixes: QTBUG-126514
Pick-to: 6.8 6.7
Change-Id: Ia03bd1d0cda1ce417baa479dceddb4a16eafead9
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2024-08-21 19:57:59 +02:00
Ulf Hermann aeabdb9388 QML: Type-check objects passed to QmlListWrapper
So far we could assign QObjects of any type into any QmlListWrapper of
another type. This is UB, since you may be holding the underlying
QQmlListProperty in C++, and it's also not very consistent.

Assign null instead if the type doesn't match and emit a warning.
Likewise, also warn when initializing a list with mismatched elements.

[ChangeLog][QtQml][Important Behavior Changes] Assignments to list
properties in QML are now type-checked. Before you could, for example,
insert a plain QObject into list<Item>, producing undefined behavior.
Now it instead inserts null and warns. In particular, if you assign a
JavaScript array of random objects to a list property, QML will check
each individual element, and insert null as well as warn when
encountering type incompatibilities.

Pick-to: 6.8 6.7 6.5
Fixes: QTBUG-127343
Change-Id: I9b78afcd3ed40c80175a99861373588f56683954
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-08-21 19:57:58 +02:00
Soheil Armin 3e8abcecdf Android: Remove QtAIM tests to be moved to qtcore
Pick-to: 6.8
Task-number: QTBUG-126976
Task-number: QTBUG-127088
Change-Id: Id421bb3699d1aa1fd6522cf00dbd86c89bf7db59
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-08-21 20:57:57 +03:00
Sami Shalayel e925d48d40 qmlls: ignore duplicates and missing files when watching files
Sort the results from QQmlCodeModel::fileNamesToWatch and remove
duplicates to avoid searching for the same files multiple times.

Track files that do not exist in the source paths (for example the
headers from Qt Quick) and ignore them for the next run of
findFilePathsFromFileNames().

This allows qmlls to be much faster, for example when using completions
on the todo qtdoc demo where qmlls tried to search 600 non-existing
files, including files with empty file names and duplicates) in the
source folder.

Pick-to: 6.8
Fixes: QTBUG-126576
Change-Id: I67a0aa84fb4e9286760a68ae9766823ec165936a
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2024-08-21 16:29:47 +02:00
Ari Parkkila cef6aa994d tests: Skip tst_qmlbasicapp when builtin data
Task-number: QTBUG-118680
Change-Id: Ie9a148b6a569e0f8022b141fd4beefb389db7df1
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2024-08-19 09:50:51 +03:00
Mitch Curtis 477c15def8 Container: cull items when our size is zero and contentItem is a view
The typical use case for SwipeView is that the user declares items
directly as children. Those children are added to its QQmlObjectModel,
which are then used as the delegates for its ListView. ListView culls
the items it manages, but in the case of a zero-sized view, those that
are outside the view - and hence not in its visibleItems list - are not
its responsibility. That responsibility instead falls to
QQuickContainer.

It's also necessary to clear and return early in
QQuickItemViewPrivate::layout if the size of the view is zero,
otherwise the tests that check if a valid-sized view is made
zero-sized fail.

Add a new C++-based test for Container which is only run with the Basic
style (similar to e.g. tst_qquickmenubar) so that we can check the
culled member of QQuickItemPrivate. tst_container.qml is run
with all styles (even though it probably doesn't need to be, but it
would also be difficult to rewrite in C++, even though it's fairly
small).

Fix some tests that were using zero-sized views.

Fixes: QTBUG-125416
Pick-to: 6.5 6.7 6.8
Change-Id: Ia05791b69568d51bea310e4f09266645ca2f1829
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-08-19 12:02:11 +08:00
Eirik Aavitsland 0de80446f7 Baseline test: Improve the scene grabber's animation handling
Changes to avoid false timeout failures on slow hardware:
- Avoid doing grabs while the scene has not yet stabilized.
- Make the timeout for scene stabilization settable, copying the setup
from the Quick3d scene grabber.

Pick-to: 6.8
Change-Id: I2f65ffdf3b52a6cd5833dad739e806932ea205a1
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2024-08-17 07:57:58 +02:00
Richard Moe Gustavsen 25348bc0e6 QQuickTableView: detect if sync view and sync child is out of sync
When syncView is requested to do a relayout, it will tell
the sync children to do relayout as well. A relayout alone
will not change the top-left delegate item in the viewport,
only layout the existing delegate items.

But as it turns out, it can happen that the relayout leaves
empty space in the viewport that needs to be refilled with
new rows and columns. This is typically the case if some of
the columns were resized smaller than what they used to be.
And this can change which cell ends up as top-left, or
move it to a different position.

We therefore need to extend the check in syncSyncView to also
include the _position_ of the top-left cell, and not only if
the top-left cell itself has changed.

As it stood, we also did a viewportOnly rebuild every time a
new row or column was flicked into the viewport. This is very
unnecessary, and slows down performance. Instead, we only need
to do this when if the sync child is told to do (at least)
a LayoutOnly. Only then can any of the visible rows or columns
have been resized.

Fixes: QTBUG-127809
Pick-to: 6.8 6.7 6.5 6.2
Change-Id: I815a47e9d6453871172ff7136f8cfbd51a5bc789
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
2024-08-16 11:17:22 +02:00
Kaj Grönholm e953ea4bc6 Support ListView sections with Q_GADGET model
Previously ListView models containing Q_GADGETs did not support
sections, as those expected a QObject. Add support also for getting the
properties from Q_GADGET. Includes autotest.

Task-number: QTBUG-124175
Change-Id: I91878304bdd45ac8d3c6695f0e734a252c69f302
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-08-15 21:29:26 +03:00
Paul Olav Tvete aac4168a7d Accept hue == -1 in Qt.hsla() and Qt.hslv()
The documentation says that acromatic colors have a hue value of -1.
QColor does already accept -1 in the fromHsv/Hsl functions.

Fixes: QTBUG-127034
Pick-to: 6.8
Change-Id: I62928e4fe4b9ca569df13c5b82e9de028a7c09ff
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2024-08-14 13:12:10 +02:00
Vladimir Belyavsky 547afac0db tst_combobox: fail on warnings
Enable fail on warnings for all tests in init() method.
Also, as a drive-by change, replace 'var' with 'let'

Task-number: QTBUG-98718
Change-Id: I5d9158e2834a5c04f21e47377478fa56267dcb59
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2024-08-14 11:12:10 +00:00
Santhosh Kumar 2cfffb7088 Check qml context object state in the table instance model only needed
It's better to have the assert condition w.r.t to the context object
within the model where we access the respective data. This patch
removes the existing assert in the QQmlTableInstanceModel::object() and
uses a similar validation inside the
QQmlTableInstanceModel::incubateModelItem() before accessing the
context-specific data.

Fixes: QTBUG-126981
Pick-to: 6.8 6.7 6.5 6.2 5.15
Change-Id: I799476434afc4c22c8b39544bc994232d6bf8ef2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2024-08-14 06:31:29 +02:00
Mitch Curtis cde11110f3 Fix shader warnings in ComboBox::test_comboBoxWithShaderEffect
Use the build system to generate the qsb file.

Fixes: QTBUG-125580
Pick-to: 6.5 6.7 6.8
Change-Id: Iefc910356a931109b9c4b60eda1ca145bc3c5079
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-08-14 08:46:53 +08:00
Sami Shalayel c5da722515 qmltyperegistrar: test for missing Component in qmltypes
qmllint was wrongly complaining about missing types because
qmltyperegistrar was not including all required types in the qmltypes
files.
Add a regression test to make sure that we don't run into the problem
mentioned by Mario Emmenlauer in the linked task at QTBUG-118112.

Task-number: QTBUG-118112
Pick-to: 6.8
Change-Id: Id67e9f9927e94ad5aa900c7bf30e85fc977e3e45
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-08-13 11:03:15 +00:00
Sami Shalayel b0fd8ef05e quicklint: disable controls-attached-property-reuse category by default
It seems that this category is just not ready to be enabled by default,
so disable it.

Tracking the work to re-enable it at QTBUG-127812.

Fix a test to enable the category before testing for the warning.

Pick-to: 6.8 6.7
Fixes: QTBUG-127650
Change-Id: I6144e4b55e3bea803b14d82f6f0d291676d4394e
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-08-13 13:03:15 +02:00
Sami Shalayel 8a8bfb410a qmlls: do not endless loop on _deps build folder
Add a missing NoDotAndDotdot flag to the entryInfoList() call to avoid
infinite looping on _deps folder.

Pick-to: 6.7 6.8 6.5
Task-number: QTBUG-123491
Change-Id: I3920ea67f49f51b612e4937403af2e5bec5eaad0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Knud Dollereder <knud.dollereder@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2024-08-13 13:03:15 +02:00
Oliver Eftevaag d02f3adadc PopupWindow: Don't consume keyboard events when focus: false
If the QGuiApplication forwards a key event to an active popup, and the
popup consumes the event, it will not be sent to the active focus window.

The ComboBox relies on the popup not getting focus, when dealing with
key events, and won't work as long as the PopupWindow gets and consumes
the keyboard events.

It makes sense to only have popups consume events when it has explicitly
been given keyboard focus.

In addition, unblacklist popupWindowFocus after some tweaks. It's an
important test which verifies various things related to focus.
Unfortunately, due to unknown reasons, it still doesn't pass on QNX.

Task-number: QTBUG-121363
Pick-to: 6.8
Change-Id: I459c91c5db5c392e997aa996f03ecdda093a544a
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2024-08-12 19:31:55 +02:00
Lucie Gérard 010516d71c Correct license in test directory
According to QUIP-18 [1], all test files should be
LicenseRef-Qt-Commercial OR GPL-3.0-only and all
build system should be BSD-3-Clause.

[1]: https://contribute.qt-project.org/quips/18

Pick-to: 6.8
Task-number: QTBUG-121787
Change-Id: I9da6b82b6d620e72d5c6700e3d5901f9049f89e9
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
2024-08-12 19:31:55 +02:00
Ulf Hermann 9f554ef8cf QmlCompiler: Do not choose unstorable stored types
In order to pass the argument to a value type ctor we need to store it
in something we can rely on.

Amends commmit dd731b880b

Change-Id: I5d1ef6b4611aad9b595235f4f874ef4a063f04c6
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-08-12 16:19:40 +02:00
Mitch Curtis 4b996eda57 Fix warnings in ListView delegate width bindings in manual tests
Bind width to the ListView's width, not the parent, which may be null.

Pick-to: 6.5 6.7 6.8
Change-Id: I020d23bb0c98b3da00db9ffd3400a89cfdeb1810
Reviewed-by: Doris Verria <doris.verria@qt.io>
2024-08-12 10:25:25 +08:00
Mitch Curtis 199185ff53 Fix assertion failure in screenshots manual test
SNIPPETS_DIR needs to be updated after the merge of qtquickcontrols2
into qtdeclarative.

Pick-to: 6.5 6.7 6.8
Change-Id: Ic2ceabd34b35a64868e6b7e261dca19b46c7f195
Reviewed-by: Doris Verria <doris.verria@qt.io>
2024-08-12 10:25:21 +08:00
Daniel Smith 48aedc5c9e Blacklist flaky tests for Bugfix week 2024/H2
Task-number: QTQAINFRA-6482
Change-Id: I642c9fe04b90bb6ecd3ac2f64136d9a299ed0a65
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-08-09 18:22:32 +00:00
Santhosh Kumar 6c36d341e0 Fix crash when dragging an invalid item in the header view
Dragging an invalid item in the header view leads to a crash. It's
better to safeguard before operating anything w.r.t. to the dragged
item.

This patch fixes that issue by validating the invalid item before
performing drag operation. Also added an test case to verify the same.

Fixes: QTBUG-127782
Pick-to: 6.8
Change-Id: I95398c7410d6fb6427ec06ff4b7da42472bc6d18
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: MohammadHossein Qanbari <mohammad.qanbari@qt.io>
2024-08-09 20:22:32 +02:00
Ulf Hermann b77d2f7f09 QML: Allow type annotations for all functions in QML mode
Fixes: QTBUG-112638
Change-Id: Ib41c372aca3f9bb124ca92eeaa41f8e770f2a800
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
2024-08-09 10:27:05 +02:00
Ulf Hermann 90c55e859e QQmlListModel: Invalidate ModelObject when necessary
Both the object and the listmodel may be deleted during the life time of
ModelObject. Don't crash when that happens.

Also, fix QV4QPointer to actually name the type of the pointer it
stores. Apparently this is the first time we add a QV4QPointer of
something that's not a plain QObject.

Pick-to: 6.8 6.7 6.5 6.2 5.15
Task-number: QTBUG-118024
Change-Id: I208d8749bcd67970f7bfbe569eed7a472f909508
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-08-09 10:27:05 +02:00
Doris Verria 84a0da1bd4 FluentWinUI3 Style: Add documentation
Task-number: QTBUG-125748
Pick-to: 6.8
Change-Id: Iaeedd4044c686d1dce4ef611a4cf9a7ea8060f83
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2024-08-09 10:27:05 +02:00
Vladimir Belyavsky 7ac8ac24b8 tst_qquickmaterialstyle: fix build with no material style
Fix tst_qquickmaterialstyle which fails to configure when Qt is
built with -DFEATURE_quickcontrols2_material=OFF. So we just add
an appropriate check to handle this.

Pick-to: 6.8 6.7 6.5
Change-Id: Ifdf3f22e515d1439364f12ec4a3bdad5c85acd85
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2024-08-09 05:35:58 +00:00
Vladimir Belyavsky 8c7f91ed65 tst_qqmlecmascript: fix build with no widgets
Fix tst_qqmlecmascript which fails to build when Qt is built
with -DFEATURE_widgets=OFF. Simply use QCoreApplication instead
of QAplication where appropriate.

Pick-to: 6.8
Change-Id: I8b1a5c162e7fef02c876e8981d9810035770f2b4
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2024-08-08 22:22:39 +03:00
Sami Shalayel 66025b65b2 qmlls: fix qualified module completion
Fix the use of module qualifiers when generating snippets for all
three completion cases.
Let `import QtQuick as QQ` be an example, where the user wants to
complete a State snippet:
1. `QQ` -> insert `QQ.State { ... QQ.PropertyChanges { ... } ... }`
2. `QQ.` -> insert `State { ... QQ.PropertyChanges { ... } ... }`

The third case arises when there QtQuick is imported without qualifier:
3. `Sta` -> insert `State { ... PropertyChanges { ... } ... }`

Add tests for all three cases, and a method that creates the snippets
with the correct qualifiers. This avoids:
* getting `QQ.QQ.State ...` completions with duplicate qualifier
* getting `QQ.State ... PropertyChanges ...` completions with
  unqualified PropertyChanges

Also fix the snippet completion to avoid suggesting the wrong snippets
inside of bindings, like
`someProperty: stat` -> `someProperty: states: [...]`
for example.

Also fix the indexes in the tests to reflect the new policy for
completion on `.`.

Pick-to: 6.8 6.7
Fixes: QTBUG-127609
Change-Id: I1c70c661a15961b99157d9dc9e8de5e3320433c3
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
2024-08-08 18:39:51 +02:00
Sami Shalayel 8f26cd2842 qmlls: fix completion on field member expressions
Do not confuse completion requests on dots with completion requests on
identifiers.

Fix itemsFromTextLocation to return the binary expression instead of
the right hand side of the fieldmemberexpression for the location of
the dot: for example, if you try to get the DomItem for the `.` in
`object.member`, then you would previously get the DomItem for the
ScriptIdentifierExpression `object`. With this patch, it will return
the BinaryExpression `object.member`.

We usually assume that sourcelocations have inclusive ends, for example
we assume that auto-completion on `\n` in `someName\n` wants suggestions
for `someName`, even if its technically one position "outside" the
sourcelocation of `someName`. This is not true for
ScriptBinaryExpressions, where auto-completion on `.` in `someName.` should
not return suggestions for `someName`.
The same also applies to probably all binary expressions `+`, `-`, and
so on. Therefore exclude the position behind the sourcelocations when searching
for items inside ScriptBinaryExpressions in itemsFromTextLocation.

This requires adapting qmllsutils to the "new fieldmemberexpressions" as:
* ScriptIdentifierExpressions for completion inside of them, for example
  `member` in `someObject.member`. isFieldMemberAccess() returns true on
  those.
* ScriptBinaryExpressions for completion on `.`.
  isFieldMemberExpression() returns true on those.

Adapt the offsets of the tests on completion on `.`.

This breaks some tests on qualified module identifiers, so QEXPECT_FAIL
them and track their resolution via QTBUG-127609.

Pick-to: 6.8 6.7
Fixes: QTBUG-127586
Change-Id: I82726205c7401e43174cc7749372e0776063bcbb
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
2024-08-08 18:39:51 +02:00
Sami Shalayel 468fe40071 qmlls: resolve types of signal handler parameters + suggest them
Extend qqmllsutils's resolveExpressionType to resolve signal handler
parameters: they have the specificity that their type has to be searched
from the signal's definition, and can't be added via type annotations.

Implement the special signal handler parameter type resolution in
separate static resolveSignalHandlerParameterType() method.

Add tests for signal handler parameters in
tst_qmlls_utils::resolveExpressionType and tst_qmlls_utils::completions.

Note that implementing the signal handler parameter type resolution is
enough for the completions to work on those types.

Also fix resolveSignalOrPropertyExpressionType() to properly recognize
autogenerated property changed signals (to avoid mismatches with
QQuickWindow's colorChanged signal, for example).

Pick-to: 6.8 6.7
Fixes: QTBUG-127458
Change-Id: I7fc9d198564320485bb8e3527943c4994c02d90f
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
2024-08-08 18:39:50 +02:00
Ulf Hermann c9d7620bc2 QQmlProperty: Reset the binding bit when removing a null binding
If we remove a binding we don't want any later code to restore it. This
works quite well if the binding we remove already exists.
removeFromObject() resets the binding bit and that settles it. However,
if the binding doesn't exist yet, we so far didn't reset the bit and
when the binding appeared we would still add it to the object. That was
quite wrong.

Pick-to: 6.8 6.7 6.5 6.2
Fixes: QTBUG-124553
Change-Id: I58c115d78b3701ad4e8837772261a9154b971dbb
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-08-08 18:39:50 +02:00
Semih Yavuz 7a064486ff qmlls: fix enumeration name highlighiting
Fix the highlighting of the enumvalues in the form of
ComponentName.EnumName.EnumValue. To access the external qmlfiles in the
same directory, change the dependency option to default in the
highlighting test.

Pick-to: 6.8
Change-Id: I5dbd94aa6bbb80af9edc50f54fe95ed8cdd6c3cd
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2024-08-08 18:39:50 +02:00
Semih Yavuz 8d945db7df qqmljsimportvisitor: fix module qualifiers
Append to m_seenModuleQualifiers right after the prefix check.
Otherwise, the method can early return before having chance to
insert prefix to m_seenModuleQualifiers.

Amends c126ac9a08

Pick-to: 6.8
Change-Id: I11de1dadfae55dd5a2f826c6b3ee8bcbaf58df7d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
2024-08-08 18:39:50 +02:00
Oliver Eftevaag 92eff047d6 Slider: use axis with the largest delta, when sliding via wheelEvent
The slider naively assumed that all wheelEvents would have either
angleDelta().x(), or angleDelta().y() set to 0, when in reality those
numbers can be any floating point value.

Choosing the largest of the two deltas, is a more robust solution.

Pick-to: 6.8
Change-Id: I1fb75eb5121c99c9b354e53732ec6981f477e283
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2024-08-08 18:39:50 +02:00
Olivier De Cannière 92e57874ed QmlEngine: Add support for sequences to CallArgument::fromValue
Fixes: QTBUG-127704
Pick-to: 6.7 6.8
Change-Id: Ifb6aad0feb26fadee2838b74a3a7c29949be05a6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-08-08 18:39:49 +02:00
Eskil Abrahamsen Blomfeldt c8a859655d Add missing properties to QQuickFontValueType::create()
A few recently added font properties were missing from the
QQuickFontValueType::create() function, meaning that they could
not be added to the object created with Qt.font().

Pick-to: 6.7 6.8
Change-Id: I511e8f1e3a3804d8e48943e734e42019941b0452
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2024-08-08 12:03:56 +02:00
Sami Shalayel dfc7521a82 qmllint: disable the tumbler warning in qmllint
The tumbler warning in qmllint does deliver false positives, even on the
code used by the documentation. Disable the warning for now, and use
QTBUG-127562 to track work on fixing the tumbler warning.

Add a test for the tumbler where the warning should not be received.

Pick-to: 6.8 6.7
Task-number: QTBUG-127562
Change-Id: Ia403b2d3aec0991613bf444d0047aa040db2bf65
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-08-08 11:39:36 +02:00
Sami Shalayel 45c21c39f0 qmllint/quick: rename attached type warnings to be uniform
Rename runtime warnings and qmllint warnings to be uniform, instead of
having many different formulations for the same problem.
This makes it easier to document them, at least for the qmllint warning
documentation.

Pick-to: 6.7 6.8
Task-number: QTBUG-118112
Change-Id: Iabb3a5fb0679523764b9f2fe2d99f4eb93a13c88
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-08-08 11:39:33 +02:00
Sami Shalayel ac309fdee0 tst_qmllint: test for duplicate warning messages
Add some duplicate checking into tst_qmllint, and QEXPECT_FAIL all the
other tests that print duplicate warnings (those are tracked via
QTBUG-127691!).

Task-number: QTBUG-127650
Task-number: QTBUG-127691
Change-Id: I66c3ce96db0543244351cd443a637b9a47fefe43
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-08-08 11:24:14 +02:00
Sami Shalayel 1e4658cc08 qmllint: Remove duplicate warning in quicklintplugin
Add a return where missing to avoid complaining multiple times about the
same issue.

Pick-to: 6.7 6.8
Task-number: QTBUG-127650
Task-number: QTBUG-127691
Change-Id: I14e8d12f1e5b4dfd9a7453a2f8206502f5858a85
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-08-08 11:24:02 +02:00