This change includes code snippet markers, some minimal code changes
(moving code around for snippet clarity), a screenshot of the example
and the main documentation page for the example.
Task-number: QTBUG-126841
Pick-to: 6.8
Change-Id: I2a10571f37a70a55b8411f1b7989b47810639386
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
Fixes the qdoc link warnings in
qtabstractitemmodel_in_android_studio_projects.qdoc
Pick-to: 6.8
Change-Id: I8466c50124ca7df7b8f2c6116a4444924a8d75b5
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
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>
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>
There is some support for SVG's switch in Qt Svg, so we support
the same in VectorImage and svgtoqml.
Pick-to: 6.8
Fixes: QTBUG-121645
Change-Id: Ifb90fad3f16337b2a71b48d796dfb0fad82b39b4
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
When the incoming data is 4, the index defined by this macro has a crash
Log: mips array out of bounds
Pick-to: 6.8 6.7 6.5
Change-Id: I5acff5479f17e55d5731443d08b0915c701968f6
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
The handler state had been reset only after the release state. This
causes the handler to be inconsistent when the dragged item is dropped
outside the corresponding drop area. It can even lead to a crash (as
mentioned in the bug report) when the next drop happens over the same
location.
This patch resets the state of the handler whenever a drop happens (as
this causes the drag event loop to exit).
Fixes: QTBUG-127865
Pick-to: 6.8
Change-Id: I14cac162df8af8b7b6b9eed99631e29bada410d1
Reviewed-by: MohammadHossein Qanbari <mohammad.qanbari@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
A native dialog helper might not be able to show a dialog due to the
dialog options not being possible to represent with the native dialog.
If so the helper returns false from show(). We were not handling this
case, so failing to show a native dialog would result in no dialog
shown.
We now fall back to the non-native dialog by destroying the native
helper and using the non-native dialog helper explicitly.
Fixes: QTBUG-124124
Pick-to: 6.8 6.5
Change-Id: If50c63e419ae7b13e9317cd2cbbcaa02fe13bbd5
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
If we know the (dynamic) vertex QRhiBuffer is backed by a single native
buffer object, we could use the
begin/EndFullDynamicBufferUpdateForCurrentFrame mechanism to update the
contents since the entire buffer contents is changing, saving a memcpy
in practice (and no need to enqueue a resource update via the standard
QRhi mechanism)
However, with OpenGL glMapBufferRange has "interesting" behavior
patterns on some platforms (like unexpectedly trippling the CPU load for
no apparent reason on some systems), and anyway all we want in the end
with GL is a glBufferSubData. So instead of the mapBuffer-like existing
begin/end functions, use a newly introduced helper function in
QRhiBuffer that, specifically for OpenGL, boils down to doing a
glBufferSubData, whereas it is equivalent to begin+memcpy+end everywhere
else.
Not applicable for backends for modern APIs.
The logic is based on querying resourceLimit(FramesInFlight) == 1. This
is convenient to avoid having to write backend type checks, although it
relies on undocumented internal knowledge (as FramesInFlight==1 may not
strictly imply and give guarantees on how a Dynamic QRhiBuffer is
implemented internally)
Task-number: QTBUG-125087
Pick-to: 6.8
Change-Id: I317f9ff4bc03fadb6808b61cb053461b30ef1db7
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
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>
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>
This can lead to crashes in static analysis passes when they try to use
the resolver.
Pick-to: 6.8 6.7 6.5
Change-Id: I2f7951374a3aa6bd38ef93333b97b08d9a46dd13
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
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>
This is rather dangerous. The global static is not protected in any way
against concurrent access. However, we already have a place to store
attached objects. The base object's QQmlData. Just use that.
Pick-to: 6.8
Task-number: QTBUG-124345
Change-Id: I5f254e640f836016564f297d2f39ea40e037acd8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Add description of the warning introduced in 6.8 and an example on
how to fix it.
No need to pick back to 6.7 as this warning was introduced in 6.8 via
9cdd485c2b.
Pick-to: 6.8
Task-number: QTBUG-118112
Change-Id: Ice2a161cb195bc47dff2aa98bfee882d2ee6d417
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Add description of the warnings and examples on how to fix it.
Pick-to: 6.8 6.7
Task-number: QTBUG-118112
Change-Id: I9d2c98ce15e558da81f9a204b8edff08e12ad5be
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
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>
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>
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>
Documentation for qsTr does not include sufficient info. about disambiguation, which is well described in another topic. Added a
link to that topic to fix the gap.
Change-Id: I700e53207d997e7c8cd97413e6ff31111a21799c
Fixes: QTBUG-124847
Pick-to: 6.8
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
The private instance of the header view has not been properly
initialized and this may lead to accessing invalid memory. Thanks to CI,
which caught this issue (while running in release with debug info).
This patch properly initializes the header view with their
corresponding private instance.
Pick-to: 6.8
Change-Id: Iaf42c5e70c404786d8c2dfe03d9265551956d6fa
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Use existing assets for ItemDelegate and CheckBox, RadioButton, and
Switch respectively.
Factor out SwitchIndicator into separate component so that it
can be shared by Switch/SwitchDelegate and use QML instead of
images for switch indicator in order to support custom accent
color
Task-number: QTBUG-125279
Pick-to: 6.8
Change-Id: I738a655439ca07745968f4775d4e8c123329fa25
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
You really should not store them across modifications of the ListModel.
Pick-to: 6.8
Fixes: QTBUG-118024
Change-Id: Ib83aa31e47d9c4cfab612e678068679300b2d9d8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
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>
Highlighted text represents the color of selected text and should be
white on both light and dark mode. We were incorrectly using this role
for the button text color for checked and highlighted buttons, which
does not correspond to always light text. Fix this for Button and
ToolButton as well as set this palette role to white color.
Pick-to: 6.8
Change-Id: Ia79d3e86cc038525e4c566d368f418ee5c56f89f
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
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>
Add a qt.quicktestutils.compareimages logging category which saves
compared images to the test executable's directory on failure when its
debug category is enabled.
Change-Id: Ifb5e85d00768fd11336d986a20080e1c16ca78a2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The function was added in 906d5c5c40. The
tests there don't only use red, so it looks like this bug has existed
since 2013.
Pick-to: 6.5 6.7 6.8
Change-Id: I4bdf87fe6be0224016baf9a2a80faee6fe61514e
Reviewed-by: JiDe Zhang <zhangjide@uniontech.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
A flag that can be used by setters for properties with
implicit/explicit state to avoid bool traps.
Use it in a few places in Qt Quick Templates.
Change-Id: I5455a33c34ed978161d9d7e20e1d40267cc077b2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Earlier, the uniform updating in updateNode() would access the fill
nodes only as QSGCurveAbstractNode, since it only called
setColor(). Recent changes have added muany more uniform settings
(texture fill, gradients etc), and hence the nodes are now being
accessed as QSGCurveFillNode. That will crash for the wireframe debug
nodes. Add a flag to filter out those nodes.
Pick-to: 6.8
Change-Id: Id167d0d85d8800110a44cc5eac9eb0dbec8bf03b
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
For each visual change, the curve renderer generates new scene graph
nodes in runner objects. If the renderer was destroyed before the item
was updated, the runners and their nodes would be leaked (always in
sync mode, and sometimes in async mode).
Fix by making the renderer clean up the runners on exit, and the
runners clean up any nodes that have not been inserted into the scene
graph.
Fixes: QTBUG-127519
Pick-to: 6.8
Change-Id: I9fcfe9d0b67cfa5b4c6fcef59cc5f78c579ec7ea
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
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>
This commit organizes the articles, so they:
- have a reasonable tree structure
- can be navigated through the topic tree in the Qt Creator help viewer
Task-number: QTBUG-126648
Change-Id: I7851664d28fc487c8801cc9caa55deb2c0f249ec
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
This commit organizes the articles, so they:
- have a reasonable tree structure
- can be navigated through the topic tree in the Qt Creator help viewer
Task-number: QTBUG-126648
Change-Id: Iaf9fe0f42c31999879ae904294b747135ac49eac
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
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>
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>
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>
When QtQuick is loaded, we know that we also need QtQml, models and
workerscript. Therefore, hold on to some symbols in those so as to
prevent the linker from optimizing the depedencies out and forcing the
engine to use plugins.
This doesn't work on QNX, for unknown reasons. Therefore, on QNX we keep
loading the plugin for WorkerScript.
Pick-to: 6.8
Change-Id: I3653aac46028521160e4f96274c90c586bde1512
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
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>
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>
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>
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>