Commit Graph

36613 Commits

Author SHA1 Message Date
Fabian Kosmale ee77c14ec3 qmllint: Consider "on-bindings" for required properties
The runtime doesn't complain if a required property is satisfied via a
ValueSource or an Interceptor, so qmllint shouldn't complain either.

Whether this really should apply to interceptors is debatable, but for
now let's aim for consistency. And that a ValueSource can satifsy the
requirement is arguably to be expected.

Pick-to: 6.8
Fixes: QTBUG-139632
Change-Id: I355b8a48e6b9bc2749839267c3b799e8eba5d72f
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
(cherry picked from commit 46925f589f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-24 01:02:09 +00:00
Fabian Kosmale 7079e6889c Synchronizer: Add a note about using it with singletons
Notably, that you can't use aliases.

Fixes: QTBUG-139608
Change-Id: I984dea6695419b11f777e7ad516b4c15ead6c3ed
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 9d768789ff)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-24 01:02:09 +00:00
Oliver Eftevaag 4def5114fd FluentWinUI3: Fix text color of RoundButton for high contrast themes
The RoundButton was overlooked in
34c542aba1 when we originally fixed Button
and DelayButton. It makes sense that RoundButton gets the same
treatment.

Fixes: QTBUG-129088
Change-Id: I55110440794ac229cbc755e8fc00373097fdf058
Reviewed-by: Benedikte Holm <benedikte.holm@qt.io>
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit bf891bdf15)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-23 20:07:17 +00:00
SanthoshKumar Selvaraj 95cea6c511 Move the includes outside of the namespace for the 3rdparty yoga source
The includes within the qt namespace causes build issues in some
compilers such as msvc. It would be good to place the includes outside
the namespace, and thus the problem can be avoided.

Amends patch 918315eac4189ab955f922ffe242351cb0f28b42.

Pick-to: 6.10.0
Change-Id: I0902d4a4ca5a80d9ccb102e16d72faa0d79b7604
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit 59dca51e02)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-23 20:07:17 +00:00
Santhosh Kumar 78e78f008e Mark security header for the qt labs wavefrontmesh
QUIP: 23
Task-number: QTBUG-136184
Pick-to: 6.8
Change-Id: Iad6ee24119f8b0198e4d7fbb93db013999e65c7a
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit 7b70ea7430)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-23 20:07:17 +00:00
Tor Arne Vestbø 5ca79c7485 Skip tst_QQuickFramebufferObject if OpenGL is not available at runtime
Pick-to: 6.9 6.8 6.5
Change-Id: I6dfa9c0abf4bef736c39caee578b630efdea748d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 11cc077da6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-23 13:23:17 +00:00
Santhosh Kumar 543560f523 Mark security header for the qt labs sharedimage
The image loader (QuickSharedImageLoader) uses shared memory
(QSharedMemory) but it shouldn't trigger security issue from the
framework itself.

QUIP: 23
Task-number: QTBUG-136184
Pick-to: 6.8
Change-Id: Ie0c5f63e3c7d4c8557dab8c12af412fd6dad1464
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit 2ef3de7803)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-23 13:23:17 +00:00
Ulf Hermann e467e5c6ad QmlCompiler: Don't adjust the same conversion multiple times
The same conversion can re-surface in multiple places in the byte code
by virtue of being stored and loaded unchanged. If we've already
adjusted it, we don't need to do it again.

Fixes: QTBUG-140415
Change-Id: Ic1e7e90af49f0ee9440a9c37abd4ab8ee0fdbe3e
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
(cherry picked from commit 044d3d2cdb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-23 13:23:17 +00:00
Aurélien Brooke fea2b695eb sg: remove an unused variable in QSGMaterialShaderPrivate::prepare()
It seems to have been forgotten in a previous cleanup.

Amends b87b3d3d43.

Change-Id: Ibabeeea164448b381603252da05a81ff76faccab
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit b0720f5024)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-23 13:23:17 +00:00
Tim Blechmann c1eda2ead6 QtQml: Fix initialization of non-optional static plugins
Don't let the initialization of a non-optional, supposedly dynamic,
plugin pass if there actually is no QPluginLoader for it. The absence of
the QPluginLoader in this case tells us that the plugin is in fact
static and we need to check the static plugin map.

Optional static plugins are not an issue here since there is no code
path to create instances of those. They need to be linked into the
application and thereby have their module registration function hooked
up in order to be reachable at all.

Task-number: QTBUG-140220
Change-Id: I82e44fba2f2880ada16a5ea60e2e33f1900b208e
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit d66cfa93ee)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-23 13:23:17 +00:00
Morteza Jamshidi 358559b955 Give ownership to qml instead of deleting the object
after calling grabToImage in the callback it returns a qml wrapper
around QQuickItemGrabResult object but then in the Event_Grab_Completed
event it destroys the QQuickItemGrabResult object so the wrapper is
also automatically destroyed after that.
so in order for qml to be able to store the wrapper object and hold the
result as long as needed we give the ownership of QQuickItemGrabResult
to qml instead of deleting it.

Pick-to: 6.8
Fixes: QTBUG-128483
Change-Id: Ibf9b9765e22ee8e0caf8b3646d86f8a4cf789ff1
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 8f0d9f6133)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-23 13:23:17 +00:00
Sami Shalayel 4b5b1540c5 qmlformat: Fix ScriptFormatter for blocks/statements comments
Component.onCompleted: {
    if(true) /* true */ {
        // the true clause
    } else {
        // the else clause
    }
}

was formatted to :

Component.onCompleted: {
   if (true /* true */)
   // the true clause
   {} else
   // the else clause
   {}
}

Add a new parameter to outWithComments that allows to change the
indentation. The use cases are:
```
{
    // 1) some comment attached to '{'
    ...
    // 2) some comment attached to '}'
}
```
For 1), IncreaseIndentation prints '{' and then increase the
indentation before printing any post comment.

For 2), DecreaseIndentation prints the pre comments, decrease the
indentation and then proceed with '}' and potential post comments.

This allows to print the comments attached to `{}` tokens with the
correct indentation.

Also adapt a test to the new comment behavior on blocks.

Task-number: QTCREATORBUG-33333
Task-number: QTBUG-123386
Change-Id: If8dd483a520c3bd25e161f3cec05530c1460bb80
Initial-patch-by: Xavier BESSON <developer@xavi-b.fr>
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
(cherry picked from commit a50af19873)
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2025-09-23 10:18:00 +02:00
Santhosh Kumar 54e3197024 Mark security header for the qt labs synchronizer
QUIP: 23
Task-number: QTBUG-136184
Change-Id: I27e9fc93ca4503459263aa4086d89c79fc1bebfa
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit ab008ba17b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-22 21:55:47 +00:00
Dheerendra Purohit 4713a2de0c Doc: Add QML docs for Window::startSystemMove and startSystemResize
startSystemMove() and startSystemResize() are callable from QML but
were undocumented.
This change adds \qmlmethod documentation under the Window type.

Pick-to: 6.9 6.8
Fixes: QTBUG-126558
Change-Id: Ib34a25fa3f9e12cc6fab85732c852a81448dcc4b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
(cherry picked from commit 775861c9ca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-22 09:04:07 +00:00
Santhosh Kumar 17e441fa3c Namespace yoga APIs to avoid ODR violation
Fixes: QTBUG-137829
Pick-to: 6.10.0
Change-Id: I660b08638daa8d78f03e184bc9eb0c2ab3488a44
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit 3524e8ec2f)
Reviewed-by: Tim Blechmann <tim.blechmann@qt.io>
2025-09-22 10:50:54 +02:00
Volker Hilsheimer 1dac1435d4 Include qqmlglobal_p.h in tst_qmltyperegistrar.cpp to fix build
Fixes build error from testing for an unknown feature flag, i.e.

tst_qmltyperegistrar.cpp:1439:6: error: division by zero in preprocessor
expression

As it's a private feature, include a private header.

Change-Id: I6112d73ebb738a555c05211d8f6c29a053de7b39
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit dec68b9e75)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2025-09-20 17:48:09 +00:00
Sami Shalayel b45ea1289d CRA: review src/qmlls
Mark all files as significant.

Use reason:trusted-sources on files that spawn QProcess or parse data:
* qdochtmlparser.cpp parses content obtained from the QHelpEngine,
  which is a trusted source
* qqmlcodemodel is used to spawn QProcesses that runs CMake (which is
  a trusted source) with arguments from
  QQmlLSUtils::cmakeBuildCommand(const QString &path) (which is also a
  trusted source) or trusted hard-coded arguments.

Pick-to: 6.9 6.8
Fixes: QTBUG-136201
Change-Id: I3f2ff1dfc208224baff6fe88b337fe24c44b599a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 1cd950dbbb)
2025-09-19 21:24:28 +02:00
Ulf Hermann 5580964be4 QmlCompiler: Properly handle uncertain component status
In order to determine whether an ID is visible from a referrer we need
not only determine the component boundaries of the referrer, but also
those of the candidate elements with the respective ID. Rewrite the
logic to have QQmlJSScopesById handle this. It has to iterate the
respective elements anyway and can therefore easily check if one of them
is assigned to an unknown property. It now provides low-level methods
that output all possible candidates for an ID, while also stating the
confidence associated with them. The plain id() and scope() methods only
return results we are actually certain about.

In places where we generate warnings or can allow for some fuzzy
results, we use the low-level methods, since those generally produce
more informative results.

The QML DOM was passing the JavaScript global object as referrer to the
scope() method before. This happened to work but was, of course, wrong.
Make sure that ID elements in the DOM receive a proper QML scope to
avoid that.

Pick-to: 6.9 6.8
Task-number: QTBUG-140041
Change-Id: I41cf8603ae6a5d5461d3c12d74521e68b5e28ea4
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
(cherry picked from commit ecf78f3190)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-19 02:04:18 +00:00
Sami Shalayel 21895145d2 CRA: review src/plugins/qmllint and src/plugins/qmlls
Mark all files as significant.

Pick-to: 6.9 6.8
Task-number: QTBUG-136187
Change-Id: I655241e8fd460f423c230b3ae2979246f4ffc841
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 52e6456d6e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-19 02:04:18 +00:00
Jan Arve Sæther fb13e36d6c Assess security levels for files under qtdeclarative/src/qmltest
No critical security levels found.

QUIP: 23
Fixes: QTBUG-136206
Pick-to: 6.9 6.8
Change-Id: I1a29dab77678a45cd5fe7391124791cbf6aa6ca8
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 249e7f768f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-18 21:29:02 +00:00
Fabian Kosmale 6146d957a3 Mark security criticality for most files in qml/parser
Mark the lexing / parsing code as security critical, because they are
data parsers. While _running_ QML code needs to assume trusted input, we
probably should not have this restriction on the parser, so that tools
like qmllint, qmlls and qdoc can safely pass any file to the parser,
without having to worry about security implications.
The criticality extends to qqmljskeywords_p.h, as we do custom bounds
checking in the functions defined there.

qqmljsastfwd_p is marked as insignificant, as it only contains fowrard
declarations and no logic at all.

The other marked files have the default level (significant).

QUIP: 23
Task-number: QTBUG-136966
Pick-to: 6.9 6.8
Change-Id: I1e44f346d91d6d66c8e9632f0dec4a11fffc935a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 8d4ebd03d2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-18 21:28:47 +00:00
Fabian Kosmale bc6c29d509 CRA review: mark workerscript subfolder
- Mark the global heades as insignificant, they don't contain any logic.
- Mark qv4serialize as critical: String data that might get passed to a
  worker script might come from an untrusted context, and thus the
  serialization process needs some basic care.
- Evertything else gets the default significant marker to indicate that
  it has been reviewed.

Pick-to: 6.9 6.8
Fixes: QTBUG-136209
Change-Id: Ib820d551f687cbd41f0306d39552e55e8642a2b3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit cf79831023)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-18 21:28:12 +00:00
Fabian Kosmale f124a3bef4 CRA review qml/jsruntime
This relies heavily on the documented fact that we only support trusted
QML/JS content, meaning most files are only significant, not critical.
This also extends to the handling of qmlc files (as in
compilationunitmapper), as we store them in a user owned, non-shared
cache directory – so any vulnerability there would already mean that an
attacker has write-priviledges on user data.

An exception is ArrayBuffer, which can be used with arbitrary user data,
and should create a valid QBA.

Fixes: QTBUG-136970
Pick-to: 6.9 6.8
QUIP: 23
Change-Id: I22033fe6ab4acf8362a8183e25b92331d45cb32c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 22df353c14)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-18 21:28:04 +00:00
Fabian Kosmale 45be501c9a Add security header for src/qmlmodels
As we assume that all QML comes from trusted sources, everything remains
at the default "signicant" security level. The exception are the module
headers which only include other headers and add a few defines.

QUIP: 23
Fixes: QTBUG-136203
Pick-to: 6.9 6.8
Change-Id: Ib1a2abbb94dbb25420f03e01a2b444f89517a902
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit c86476db1f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-18 21:27:51 +00:00
Fabian Kosmale 18f185a4de CRA review: mark qml/qmlmeta subfolder
Everything gets default significance. Note: there's a QML custom parser
in usage, but that's not "real" parsing, and we document that QML
documents have to be from a trusted source.

Pick-to: 6.9 6.8
Fixes: QTBUG-136202
Change-Id: Ifbc5a2a33cc527c14dc5aa328da8f634f63df5f8
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 4a60da23f6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-18 21:27:38 +00:00
Santhosh Kumar cf409d7695 Mark security header for qt labs animation
QUIP: 23
Task-number: QTBUG-136184
Pick-to: 6.9 6.8
Change-Id: I2867ec1ba4faa7c03e95735504b3052fea132ff3
Reviewed-by: MohammadHossein Qanbari <mohammad.qanbari@qt.io>
(cherry picked from commit 5ab3da9daf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-18 21:27:30 +00:00
Fabian Kosmale d3a830280f CRA review: Mark qmlintegration as insignificant
The header is only used to add meta-data to source files.

Pick-to: 6.9 6.8
Fixes: QTBUG-136199
Change-Id: Ib2a5c55b68613b9d2c3d7bd619841358201b9341
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 4bab3e2c7a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-18 21:27:16 +00:00
Luca Di Sera ae21568a70 QML: Preserve return type annotation for function expressions
The parser for QML allows the specification of type hints on a series of
callable elements; such as functions defined as part of a QML type.

It is possible, for example, to provide an hint for the return type of a
function expression, anonymous or not, such as:

```
import QtQml

QtObject {
    property var: function (lhs: int, rhs: int)): int { return lhs + rhs; }
}
```

While this parses correctly, the return type annotation is currently
discarded as part of the parsing process, such that in turn it is
invisible to the engine when managing the function.

Hence, ensure that the return type annotation for function expressions
is preserved during the parsing process so that it can later be visible
to the engine.

In particular, the AST node that represents this kind of element can
already store a type annotation that refers to its return type and later
down the line, the code generation phase is already able to take into
account the annotation when it builds its representation of the function.

Nonetheless, that storage is currently purposefully not used in the
cases we are interested into, albeit it is in other cases that might be
considered more common.
This is most probably, albeit nowhere near certainly, due to simple
historical reasons and partial implementations related to type hints.

Thus, ensure that the return type annotation is correctly preserved and
stored for `FunctionExpression` rules during the parsing process, such
that it can later be recognized and used by the engine.

A few test cases related to the return type annotation were added.

Task-number: QTBUG-137944
Change-Id: I6133bb286a916d0687ff5d5542b9aa769cfd493b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
(cherry picked from commit cf572e2b03)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-18 16:48:59 +00:00
Santhosh Kumar 7e5bcd71d2 Mark security header for the qt labs platform
No security critical issues identified for the qt labs platform.

QUIP: 23
Task-number: QTBUG-136184
Pick-to: 6.9 6.8
Change-Id: If2d0e6991463ed9994fba8adbc3eef848984ab45
Reviewed-by: MohammadHossein Qanbari <mohammad.qanbari@qt.io>
(cherry picked from commit 8c94259cf1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-18 16:48:58 +00:00
Topi Reinio e12be9f7df Doc: Qt Qml Models: Fix documentation issues
Fix linking issues in qqmlsortfilterproxymodel.cpp:

qqmlsortfilterproxymodel.cpp:86: (qdoc) warning: Can't link to
        'SortFilterProxyModel::setPrimarySorter(sorter)'
qqmlsortfilterproxymodel.cpp:343: (qdoc) warning: Can't link to
        'recursiveFilteringEnabled'

Add an \internal class topic for private class QQmlSortFilterProxyModel.
This removes warnings such as:

qqmlsortfilterproxymodel.cpp:287: (qdoc) warning: No output generated
        for 'QQmlSortFilterProxyModel::~QQmlSortFilterProxyModel()'
        because 'QQmlSortFilterProxyModel' is undocumented

Change-Id: I6ea3a6be606a5fdff18750beab28cdb16dba9755
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit 506f128103)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-18 16:48:58 +00:00
Eskil Abrahamsen Blomfeldt 985b6c7094 Fix Android deployment of VectorImage plugins
When selecting which files to automatically bundle in an Android
package, we look at the dependencies of the app and try to infer
which libraries are needed.

For plugins, which specific ones will be loaded is determined at
runtime, so we include any category of plugin that is used by
one or more of the application's dependencies. This is done by
setting the PLUGIN_TYPES of the module. If the application
depends on this module, it will then include all plugins of said
type. For instance, Qt Gui includes all "imageformats".

For vectorimageformats, we had put this dependency on the
VectorImage import, but since this is loaded at runtime, the
deployment tool was not able to determine the dependency on it.
We instead make it a dependency of Qt Quick instead. VectorImage
is technically a part of Qt Quick and any app depending on it
may want to load vector image formats.

Task-number: QTBUG-140187
Change-Id: I2ab42a6c23710a97936ae39ace47b19411e2c6a8
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 43f7c0d570)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-18 11:04:23 +00:00
Eskil Abrahamsen Blomfeldt 27330c6090 vectorimage: Add dependency on QtQuick.Shapes
The generated code may (and will) depend on QtQuick.Shapes, but
this cannot be determined by the Android deploy tool without some
help. This adds a dependency on that module so that you don't have
to manually add it to your own QML code.

Task-number: QTBUG-140187
Change-Id: Id888407345d3c1932d3200d540aa7d2b56ef228f
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 567c5a0b1a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-18 11:04:23 +00:00
Santhosh Kumar a129087bfd Make security header for the qt labs folderlistmodel
The FolderListModel operates with QFileInfo and QUrl interfaces to
provide file information in the provided path. The path used needs to be
validated by the application developer for any illegitimate access.

QUIP: 23
Task-number: QTBUG-136184
Pick-to: 6.9 6.8
Change-Id: I50a4737aa9193a5b9996a37cd865c49de7b84121
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit 9ba8506e1b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-18 07:51:45 +00:00
Santhosh Kumar 8608b8c116 Docs: Correct the type of the ValueFilter::value property
The type of ValueFilter::value property been used with a variant type,
but the documentation incorrectly mentions it as string type. This patch
updates the correct type of this property.

Fixes: QTBUG-140143
Change-Id: I15141d256657f33e9e6c06cc3819f300bb9ab11c
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 88ee904cc7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-18 07:51:17 +00:00
Olivier De Cannière d0c2b846d1 Add security header for src/qmlcompiler
We assume that QML or JS code comes from a trusted source. Therefore,
most files are deemed to be significant even if they parse data. This
includes the source code itself but also the associated metadata or
cache files.

However, the QML compiler also generates C++ code. Extra care needs to
be taken with the generator as a vulnerability there could propagate and
have a disproportionate effect on the program's security. It is marked
as critical.

QUIP: 23
Fixes: QTBUG-136195
Pick-to: 6.9 6.8
Change-Id: I70630361ec8e9cb3969f78a3fdf36a41334a33b3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 2e4c66160f)
2025-09-18 09:04:12 +02:00
Ulf Hermann 06360d9051 QtQml: Unregister QML animation timer on deletion
The QUnifiedTimer generally outlives the QML animation timer and needs
to be notified about that latter's deletion. Otherwise it will hold a
dangling pointer.

Pick-to: 6.9 6.8
Fixes: QTBUG-136629
Change-Id: I52b7f2f3ae716128e4acac628ea29477fc17b677
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit f94a727bd6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-17 14:02:40 +00:00
Semih Yavuz 315da2e6c2 Add security header for src/qmldom
There is no security critic code in qmldom. Everything remains
at the default "signicant" security level. Exception is one file
containing only headers marked "insignificant".

QUIP: 23
Fixes: QTBUG-136197
Pick-to: 6.9 6.8
Change-Id: Ied3f8f9299b8c429e903922b815ee5db8f2d1a9e
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 14785c2867)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-17 13:31:26 +00:00
Semih Yavuz 1d147f4103 Add security header for src/qmlformat
There is no security critic code in qmlformat. Everything remains
at the default "signicant" security level.

QUIP: 23
Fixes: QTBUG-136198
Pick-to: 6.9 6.8
Change-Id: Iac1c84748bc98a9c921fc8ae895a2dcd53d01270
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit b855223eda)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-17 13:31:20 +00:00
MohammadHossein Qanbari 0b093770a2 CRA review: src/core/
No data parsing or critical situation is found.

QUIP: 23
Fixes: QTBUG-136181
Pick-to: 6.9 6.8
Change-Id: I8fe748a6cd82d4e6f762dcda8e16967282a8403f
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit 11348012d0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-17 13:31:20 +00:00
David Faure 3357047fcd QQuickWindow: disconnect incoming signals in dtor to avoid assert
qtbase commit 92a65fdac69d7773b114584f1637946622cf4f72 changed what
happened when deleting a QWindow with child windows: they are now
deleted earlier, from ~QWindow rather than from ~QObject.

As a consequence, if the deletion of the child window triggers any
signal (such as QSGRenderContext::invalidated), the parent window
now receives it (while before, the code in ~QObject would disconnect
the parent window from all senders).

Fixed by explicit disconnects, using a std::array of
QMetaObject::Connections, like in QSortFilterProxyModel for instance.

Task-number: QTBUG-140170
Pick-to: 6.10.0
Change-Id: Id2c402d3121c8a3e6962cfed0afe1e90f5f14b3f
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit a346f6d0f3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-17 06:04:37 +00:00
Ulf Hermann 0a2e227bc6 QmlModels: Signal list model changes also via QQmlTableInstanceModel
Allow QQmlDelegateModelItemMetaType to store any QQmlInstanceModel, but
also store the kind of model we're dealing with so that we can quickly
produce a QQmlDelegateModel or a QQmlTableInstanceModel when necessary.
This allows us to send the modelChanged() signal. We do not expect to
perform the same trickery that QQmlDelegateModel and
QQmlTableInstanceModel do more often. Therefore this solution does not
need to scale beyond those.

Task-number: QTBUG-139941
Change-Id: Id6d2a8ae5f96b755a776eb354e6ae291314dbf7b
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
(cherry picked from commit c66fb45c88)
2025-09-16 18:53:48 +02:00
Ulf Hermann bbb6679072 QQuickTableView: Expose internal model changes via the model property
If the delegate changes the model, those changes need to be visible in
the "model" property of the view. To this end, use
QQmlTableInstanceModel's model variant instead of the assigned one once
it has been synchronized.

The inner change signaling from the delegates to the view will be
added in a separate change.

Task-number: QTBUG-139941
Change-Id: I1296fa2c886dad063b6b39defef56cb7faf1e943
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
(cherry picked from commit a5ad373e6e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-16 01:49:46 +00:00
Petri Virkkunen 52f0596541 QQ4A: Reduce amount of spam calls in tst_signallistener
To avoid filling the JNI global reference table limit on the CI,
reduce the amount of signals emitted during the tst_signallistener
spam call testcases.

Fixes: QTBUG-138104
Pick-to: 6.9
Change-Id: Iaeefcbef6447586578f2cf2cc8dbfcb7f4536818
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 21543ca52d)
2025-09-15 22:20:08 +00:00
Ulf Hermann d478f11129 QmlCompiler: Guard against disappearing arrow functions
You can override a QObject method with a JavaScript function and take
away the JavaScript function later by swapping out objects. This should
not crash.

Pick-to: 6.9
Fixes: QTBUG-140074
Change-Id: I85b17f4f619235024d0f1a27b4ff4128c7a57083
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
(cherry picked from commit 7105eb6d0d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-15 16:33:37 +00:00
Ulf Hermann 221a09dc41 Properly wire up DelegateModel's modelChanged signal
If the model contents change we need to notify. This enables the signal
propagation for Instantiator, Repeater, ListView, and GridView.

Task-number: QTBUG-139941
Change-Id: I384dcd296068ca7abfd1cad9fe662ae6e8938338
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 6803e9c908)
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
2025-09-15 11:41:21 +02:00
Ulf Hermann 983efffc67 QtQuick: Simplify TableView model handling
Unwrap any QJSValues right away and eliminate a copy of the model.

Task-number: QTBUG-139941
Change-Id: I7f4a3ea97ae64cf0bb24aa032f8307c56bf7a597
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
(cherry picked from commit 9494ecafb9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-14 05:20:08 +00:00
Assam Boudjelthia acdcf5f664 Account for safe margins in tst_qquickwidget::layoutSizeChange
Pick-to: 6.9
Change-Id: Ie20dbbc0edcd1a559209322e2f297aefc3fb121b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit ae8ec32a99)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-13 04:58:54 +00:00
Ulf Hermann 04f069e4d6 QtQml: Empty SimpleArrayData vacant space when truncating
Without this we effectively soft-leak the contents of any
SimpleArrayData whenever we truncate it. Only when the array was either
completely dropped or re-filled would the extra objects be reclaimed.

Task-number: QTBUG-139025
Pick-to: 6.9 6.8
Change-Id: I88e9dc3ea8ec57c1de71b7b5417ebcfbaa75bb61
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit e0f65fe66f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-13 02:11:52 +00:00
Santhosh Kumar d0287165a7 Release section item when the corresponding view item removed
The section item has not been removed or added to the section cache
in all cases when the corresponding delegate item has been moved out
of the visible area, either during flick or scroll. This happens in
a case where the delegate item has been requested to be removed (as
it goes out of the visible area) from the list view, but it's not
released from the delegate model due to its caching mechanism. When
an item is outside the visible area, releaseItem() is triggered,
intended to free the item and its sections. The problem arises when
releaseItem() calls QQmlInstanceModel::release(), which caches the
item in the delegate model, but does not free the section. This
prevents the section item from being released properly.

This patch releases the section item whenever removeItem is
triggered from the list view, which happens when the delegate item
is moved out of the visible area.

Fixes: QTBUG-137172
Pick-to: 6.9 6.8 6.5
Change-Id: Ib7e78309e076e76750b03f3238a7501563a3962a
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit 5a664f0836)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-13 02:11:52 +00:00
Ulf Hermann c1fff61a4d QmlModels: Test model-writing behavior of delegates
When writing through a delegate, the original data is already written.
We are only missing change signals.

Task-number: QTBUG-139941
Change-Id: I3124a8dc5852e3858a1e9bd9b74c07608bb5e446
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit b8b1b94cea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-13 02:11:52 +00:00