Skip to content

Calls order of q_invokable method #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10,000 commits into
base: 6.2
Choose a base branch
from
Open

Calls order of q_invokable method #10

wants to merge 10,000 commits into from

Conversation

rjcamatos
Copy link

If there are 2 or more methods with the same name but reciving diferent arguments the QJSEngine Pickup the First One declared.

Example:
methodxyz(string)
methodxyz(objptr*)

It picks up the first one passing as argument a string and not the one that i was expecting an object as it was send.

qtprojectorg pushed a commit that referenced this pull request Dec 8, 2023
Using std::binary_search has the requirement that the passed
range fulfils ordering requirements, which was not the case
for the cppKeywords array here.

As the QString doc says [1]:

> QStrings can be compared using overloaded operators such as operator<(),
> operator<=(), operator==(), operator>=(), and so on. Note that
> the comparison is based exclusively on the numeric Unicode
> values of the characters. It is very fast, but is not what a
> human would expect; (...)

Therefore, sort the array accordingly and add an assert to
ensure it will remain sorted.

Fixes an crash/assert when building qtdeclarative with
CXXFLAGS='-D_GLIBCXX_DEBUG':

    /usr/include/c++/13/bits/stl_algo.h:2243:
    In function:
        bool std::binary_search(_FIter, _FIter, const _Tp&) [with _FIter = const
        QString*; _Tp = QStringView]

    Error: elements in iterator range [first, last) are not partitioned by the
    value __val.

    Objects involved in the operation:
        iterator "first" @ 0x7ffc4a2c4f18 {
          type = QString const* (constant iterator);
        }
        iterator "last" @ 0x7ffc4a2c4f10 {
          type = QString const* (constant iterator);
        }
    Aborted (core dumped)
    ninja: build stopped: subcommand failed.

GDB backtrace:

    Program terminated with signal SIGABRT, Aborted.
    #0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
    44      ./nptl/pthread_kill.c: No such file or directory.
    (gdb) bt
    #0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
    #1  0x00007f307e0a815f in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
    #2  0x00007f307e05a472 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
    #3  0x00007f307e0444b2 in __GI_abort () at ./stdlib/abort.c:79
    #4  0x00007f307e2a300d in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
    #5  0x00005639ff90471d in std::binary_search<QString const*, QStringView> (__first=0x5639ffa1a9c0 <QmltcVisitor::checkForNamingCollisionsWithCpp(QDeferredSharedPointer<QQmlJSScope const> const&)::cppKeywords>,
        __last=0x5639ffa1b2c0 <guard variable for QmltcVisitor::checkForNamingCollisionsWithCpp(QDeferredSharedPointer<QQmlJSScope const> const&)::cppKeywords>, __val=...) at /usr/include/c++/13/bits/stl_algo.h:2243
    #6  0x00005639ff8fb837 in operator() (__closure=0x7ffc4a2c52bf, word=...) at /home/michi/development/git/qt5/qtdeclarative/tools/qmltc/qmltcvisitor.cpp:764
    #7  0x00005639ff8fb89e in operator() (__closure=0x7ffc4a2c52a0, name=..., errorPrefix=...) at /home/michi/development/git/qt5/qtdeclarative/tools/qmltc/qmltcvisitor.cpp:768
    #8  0x00005639ff8fc99b in QmltcVisitor::checkForNamingCollisionsWithCpp (this=0x7ffc4a2c6070, type=...) at /home/michi/development/git/qt5/qtdeclarative/tools/qmltc/qmltcvisitor.cpp:787
    #9  0x00005639ff8f9dea in QmltcVisitor::endVisit (this=0x7ffc4a2c6070, program=0x563a002e0628) at /home/michi/development/git/qt5/qtdeclarative/tools/qmltc/qmltcvisitor.cpp:341
    #10 0x00007f307f6636fa in QQmlJS::AST::UiProgram::accept0 (this=0x563a002e0628, visitor=0x7ffc4a2c6070) at /home/michi/development/git/qt5/qtdeclarative/src/qml/parser/qqmljsast.cpp:1193
    #11 0x00007f3080159b8f in QQmlJS::AST::Node::accept (this=0x563a002e0628, visitor=0x7ffc4a2c6070)
        at /home/michi/development/git/qt5/qtbase/include/QtQml/6.7.0/QtQml/private/../../../../../../qtdeclarative/src/qml/parser/qqmljsast_p.h:272
    #12 0x00007f3080212f4b in QQmlJSTypeResolver::init (this=0x7ffc4a2c5b50, visitor=0x7ffc4a2c6070, program=0x563a002e0628) at /home/michi/development/git/qt5/qtdeclarative/src/qmlcompiler/qqmljstyperesolver.cpp:173
    #13 0x00005639ff8f0bd3 in QmltcTypeResolver::init (this=0x7ffc4a2c5b50, visitor=0x7ffc4a2c6070, program=0x563a002e0628) at /home/michi/development/git/qt5/qtdeclarative/tools/qmltc/qmltctyperesolver.cpp:19
    #14 0x00005639ff8c02d4 in main (argc=23, argv=0x7ffc4a2c7a68) at /home/michi/development/git/qt5/qtdeclarative/tools/qmltc/main.cpp:269

[1] https://doc.qt.io/qt-6/qstring.html#comparing-strings

Change-Id: I82ebbcdca4ab90155b935f9af24b3a3821134563
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Copy link

cla-assistant bot commented Nov 15, 2024

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
0 out of 15 committers have signed the CLA.

❌ samishalayel
❌ kkoehne
❌ alcroito
❌ SafiM5
❌ Inkane
❌ jujokini
❌ mitchcurtis
❌ Richard Moe Gustavsen
❌ alpqr
❌ isolovev
❌ mseben
❌ vohi
❌ jaheikk
❌ michaelweghorn
❌ QtDheeru


Richard Moe Gustavsen seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Olivier De Cannière and others added 28 commits May 8, 2025 12:31
Merge conflicts are slowing us down quite a bit when working on
qmllint. Sorting data-test entries by tag name will reduce their
number significantly.

The modified functions are:
  cleanQmlCode_data
  dirtyQmlCode_data
  dirtyQmlSnippet_data
  cleanQmlSnippet_data
  dirtyJsSnippet_data
  cleanJsSnippet_data

There were 517 tests executed by qmllint both before and after this
change.

Pick-to: 6.9 6.8 6.5
Change-Id: I0bb9ef9d7e5ff7cb900891c06336b5403b2250e6
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
Since we recently sorted some data test functions and the git history
already is compromised, we can take the opportunity to clean those up.

This unifies the style of all test entries and removes a lot of
boilerplate. This should make the tests easier to read and navigate.

There were 517 tests executed by qmllint both before and after this
change.

Pick-to: 6.9 6.8 6.5
Change-Id: Ie394c5b6e967377903da0138ac7ee37ec9dc6765
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Fixes: QTBUG-126715
Task-number: QTBUG-129307
Change-Id: I739587bf6d44131d9a0bdcec4df60ab3f53e1a12
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Change-Id: Iec0d97e3340ee8f83389af3119575a0d586f637c
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Previously, prepareEnterTransition would reparent the popupItem before
saving window->activeFocusItem(), which could shift focus into the
popup and cause the saved focus to fall back to the window contentItem.

In particular, during reparenting focus may be set if user code calls
forceActiveFocus, for example, in the onVisibleChanged handler.

The activeFocusItem is now captured before reparenting and stored in
lastActiveFocusItem.

Pick-to: 6.9
Change-Id: I6f4691e871661b6ba66b43ed720dc771a65ae3ed
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Non-modal popups were saving lastActiveFocusItem but only clearing it
if *they* had focus when closing. If focus moved away while open, the
stale focus stuck around and got restored on the next close.

Introduce a savedLastActiveFocusItem flag in QQuickPopupPrivate. Set it
when we record lastActiveFocusItem in prepareEnterTransition(), and in
finalizeExitTransition() only clear the overlay's saved focus if this
popup actually set it.

For stackingOrderPopups, add an additional check which avoids setting
active focus to a popup which has already gained it during open. This
allows lastActiveFocusItem logic to take place instead. This scenario
happens with menu popups using exit transition (e.g. Material style).

Pick-to: 6.9
Change-Id: I81caf1b5e647b3794ac8d03888534501c771ae07
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Add a nullptr check in finalizeExitTransition to prevent potential
dereferencing of a null pointer when destroying a window.

Pick-to: 6.9
Change-Id: I05b8e266df93df873af96c6f5692b2fd519d3bbf
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Pict-to: 6.9
Change-Id: I4a3147a11d36ed6db94b454581ee4dee0a8730e4
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Task-number: QTBUG-136447
Change-Id: I8abecb89bf844dd0e98b6f947b63107fce4db15d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
QTest::createTouchDevice() passes ownership of the device to the caller,
so make sure it gets deleted.

Pick-to: 6.8 6.9
Change-Id: I1289def6b40bf688a7334b9997f7e4319516d018
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Change arch build type of qmltestrunner to match the target
and not host.

This amends 3e2a853.

Task-number: COIN-1211
Change-Id: I4cac9d0d664ea14bd95cea10936d790ab1d33d4a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Enter transitions may want to animate the Menu's height based on its
implicitHeight. The Menu's implicitHeight is typically based on the
ListView's contentHeight, among other things. The docs for ListView's
forceLayout function say: "Responding to changes in the model is
usually batched to happen only once per frame." As e.g.
NumberAnimation's from and to values are set before any polishes
happen, any re-evaluation of their bindings happen too late, and the
starting height can be out-dated when menu items are added after
component completion (QQuickItemView::componentComplete does a layout,
so items declared as children aren't affected by this).

To account for this, this patch forces a layout before the transition
starts, if necessary.

Fixes: QTBUG-136256
Pick-to: 6.5 6.8 6.9
Change-Id: I1cc912347b774369b3542f0d32c654ae5615b97a
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Change-Id: If8d5e4187c1c5e361e8160b8f472ffda74c0f149
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Change-Id: I8364e33cb2bffd528e73c1fd1e46fa8b3663e951
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
We shouldn't store property indices in the compilation units. That makes
the system brittle and vulnerable to changes in unrelated code. Rather,
we should always resolve aliases from names at run time. We can store
the alias target property indices in the property caches. That's where
they belong.

This means we need to add the alias properties to the property cache
right when we resolve the aliases since we can't communicate the
property indices back anymore.

Task-number: QTBUG-135286
Change-Id: I1d25f66ee06cff3fdf958f766c62cb99a30f6720
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
When we introduced value type lists, we didn't adjust the QQmlProperty
code which assumed that any list property could be represented as
QQmlListProperty.

This was of course no longer the case, and attempting to use it with
such a property would result in UB, and most likely in crashes.

Fix this by detecting what kind of list we are dealing with.

Pick-to: 6.9 6.8 6.5
Fixes: QTBUG-136735
Change-Id: I1e4531da3e5f26994809f02d630820541849691c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
The CMakeLists.txt errors out if the plugins aren't available =>
expect the test to pass only if the needed features for building the
plugins are set.

Amends: 0170258

Task-number: QTBUG-136101
Change-Id: I440c45f6b1f7345c1ae963b7f3756675dafc72b7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
As it won't pass without it.

Task-number: QTBUG-136101
Change-Id: I4a3454244fec97e624ed14e61138516c304f33d7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Since we don't store any property indices in the compilation units
anymore, we don't need to hash the dependencies anymore.

Task-number: QTBUG-135286
Change-Id: I2ea05c920475749f2a2d6cf309d0956a74d6c688
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
When the thread is not running yet, we indeed have to set the window
pointer. And we can do that without mutex/atomic because starting the
thread is a synchronization point.

When the thread is already running, however, writing into 'window'
races with reads of that variable in the thread. But it's useful to do
that, after the thread handled a WM_Obscure event which set the window
pointer to nullptr (testcase: tst_qquickwindow destroyShowWithoutHide).
We need to set it again if the window is exposed again: use an event
to do this in a thread-safe way.

WARNING: ThreadSanitizer: data race (pid=427588)
  Read of size 8 at 0x723400006048 by thread T11:
    #0 QSGRenderThread::syncAndRender() qsgthreadedrenderloop.cpp:802
  Previous write of size 8 at 0x723400006048 by main thread:
    #0 QSGThreadedRenderLoop::handleExposure(QQuickWindow*) qsgthreadedrenderloop.cpp:1294

Pick-to: 6.9 6.8 6.5
Change-Id: I145bb499628fc0c95c4362a32aecdc7c3d688677
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Add semicolon option to qmlformat. While --Always always appends
semicolons to the JS statements, --essential removes the semicolons
unless it is not safe to rely on ASI once semicolons are removed.

Change the way EmptyStatements are handled. Prior to this
commit, semicolons following if, for, foreach, while statements
without bodies were added to the new line with some indentation.
Make the semicolon following no-body items stick to the right
paranthesis. If there is a chain of empty statements, write out a
single one.

[ChangeLog][qmlformat] New option semicolon-rule is added and
EmptyStatement formatting behavior has changed.

* Added --semicolon-rule option with modes:
  - --semicolon-rule=always: Always appends semicolons to JS statements.
  - --semicolon-rule=essential: Removes semicolons unless ASI makes it unsafe.

* Changed handling of EmptyStatements:
  - Semicolons after control structures without a body (e.g., if, for, while)
    now appear directly after the closing parenthesis, instead of on a new line.
  - Consecutive empty statements are collapsed into a single semicolon.

Fixes: QTBUG-107152
Change-Id: Ic95047a1f0077937d4c1f01328d77a3e6a4f22d6
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Task-number: QTBUG-107152
Change-Id: Ib858cfa67041f8dc54afbc00ae9527cf1939a6db
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Having a valid scope is not guaranteed. Check pointer validity
before dereferencing it.

Fixes: QTBUG-136552
Pick-to: 6.8 6.9 6.9.1
Change-Id: I401a5f96c96b3a7a880145151a1f7cb55b196df0
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Pick-to: 6.8 6.9 6.9.1
Fixes: QTBUG-136192
Change-Id: I3a5a53c5c127f63d79656b8c13c677ee2779f28b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Amends f86d1a5

Pick-to: 6.9
Change-Id: I153228bb7bab2f853b35d7d0bbfc76bd64088497
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Test the case when `qt_target_sources` is run only in a subdirectory

Change-Id: I27546c484ff52357a376ec9fadc7e9212b01a034
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This should already be called only once per module definition.
This ensures that all definitions were done in the context of the
qt_qml_add_module call.

This fixes the dependency cycle with subdirectory qml target.

Change-Id: I8e25c889245787fec4dfe27fe60c8ecf3ba4cbf7
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Effectively undo eeb320b
and 3df5ad9.

None of this is relevant to Qt 6 since
331e2ef because the basic
render loop also uses dedicated GL contexts per window now.

Important in particular because 3df5ad9
causes regressions in certain cases, when there are multiple windows
with one becoming dirty and hidden, preventing deleting the QSGTextures.

The patch must not be applied to Qt 5. There the basic loop uses one
context for all windows, and so the original fix is important to have.
The problem of not releasing textures should be solved in another way
for Qt 5.

Change-Id: I440836605121d50c6d059d383975249cc070ac25
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
alpqr and others added 30 commits June 10, 2025 13:25
...under certain conditions, such as when the size changes.

The recursive layer itself will likely depend on the texture backing the
layer when rendering. Typically, the fragment shader samples it. To make
this work, in recursive mode there are two backing textures.

There are two problems for recursive mode in the Qt 6 layer
implementation. (that in in some ways works quite differently from Qt 5,
due to the QRhi migration)

1. When new backing buffers are needed, for example because the item
size changes, immediately releasing the main backing texture in favor of
a new texture that is correctly sized but has uninitialized content is
not ideal, and is not what Qt 5 was doing.

Qt 5 continued to use the previous OpenGL texture when rendering for the
first time after a size change. As in, exposing the old texture as the
layer's backing texture, thus a recursive shader effect was sampling
that in the shader. (that the size of that input texture is technically
incorrect now is usually not a visible issue, and comes by design with
recursive mode)

Only once rendering to the new texture has been done for the first time
is the old texture released. The new one (which we just rendered into)
then takes over as the backing texture returned from rhiTexture() (or
the equivalent in Qt 5).

Make the Qt 6 implementation of layers to be identical to Qt 5 in this
regard.

2. There is an additional problem in the very first frame. Neither Qt 5
nor 6 clears the main backing texture. Because rendering to it does that
anyway. In recursive mode however, the very first frame will also sample
the texture. And the texture has uninitialized content at that point,
similarly to problem #1.

The result is that a non-live, recursive effect source exhibits either
artifacts, magenta (Metal) content, or just happens to look correct (so
not a visible issue usually with Qt 5 and OpenGL) With live: true (the
default) this issue is hidden, although the garbage my still flicker in
from the first frame.

Do an explicit clear now, so the first frame does not sample potential
garbage.

Pick-to: 6.10 6.9 6.8
Fixes: QTBUG-112355
Change-Id: Ic9d2b0dc4aa6ab1e99d456bcce48ffa9ffbfecfe
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
The warning emitted when calling functions with parameters type
annotated with enums does not communicate what's wrong or how to fix
it:

"1 should be coerced to void because the function called is
insufficiently annotated. The original value is retained. This will
change in a future version of Qt."

Until we support a proper representation of enums in the type system,
all we can do is warn the user that this does not work.

Add another warning that fires once when the function is constructed
that has a better description of what is going wrong. This should
provide the user with the info to solve the issue unlike the original
warning.

This does mean that we warn more for the same issue but it should still
be beneficial overall.

Task-number: QTBUG-135255
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: Icd8f8d80c6a4b9bd2b33c660394b9cf5a228a346
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Until we support a proper representation of enums in the type system,
all we can do is warn the user that enums can't be used as types.

After the improved runtime warning added in a recent commit, this patch
adds a qmllint warning to warn about the same issue but at
'compile time'.

Fixes: QTBUG-135255
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I02266f21266e59eb6d4a4dbe0e4335b845c62133
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
This patch addresses flaky failures in the context menu keyboard test
on xcb platforms. Previously, after opening the menu, the menu was
sometimes not opened as expected. Additionally, simulating a Tab key
press after opening the menu did not always give focus to the first
menu item.

The root cause was the focus timing inconsistencies on xcb: when the
window is shown, it may not receive focus immediately. This can
deactivate the application's focus window, causing popups/menus to
close unexpectedly or preventing the Tab key from correctly focusing
the first menu item.

To fix this, the patch processes pending and deferred events before
opening the menu, but only on xcb platforms, ensuring the window
receives focus in time.

Pick-to: 6.10
Task-number: QTBUG-133858
Change-Id: I648c72b484852d23c84e41dc6450c1f50cc4bdc2
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
QQmlData is attached to a QObject, and consequently can't be used to
track engine local state. Whether a _given_ engine has a const wrapper
for a QObject is an example of such local state.
False assumptions based on hasConstWrapper in turn led to asserts when
using multiple engines.

Fix this by changing the meaning of hasConstWrapper: It now only
indicates that at some point, a given engine had created a const
wrapper. If that flag is not set, we know that we can skip lookups in
m_multiplyWrappedQObjects. If it is set, we can't assume anything, and
have to consult our engines m_multiplyWrappedQObjects to truly know
whether we have a const wrapper or not.

Pick-to: 6.10 6.9 6.8
Change-Id: Id26823bdc942b227c991571334f45f45b8b109c3
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
It seems it was accidentaly removed as part of alignment with ES7
standard.
Returning it back to be usable / referable for matching instead
of manually hardcoded spelling.

Change-Id: Ib3c7fd7b103c611eea97ecc899963ab17a1f1e7b
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
This adapts to 7bd7df5aa170c240061144a9210a13b62949935c.

The test was expecting e.g. this path:

/var/folders/0r/vd385j117f949qnfm4h_539w0000gn/T/tst_qquickfiledialogimpl-dqvSBE/sub-dir

But the actual path was this:

/private/var/folders/0r/vd385j117f949qnfm4h_539w0000gn/T/tst_qquickfiledialogimpl-dqvSBE/sub-dir

Fixes: QTBUG-137416
Pick-to: 6.5 6.8 6.9 6.10
Change-Id: I31b929017ebb1a672a614f8b409dc5c4e8d5e000
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Change-Id: I74b12066ba34f744958bb8170579197cbb915dee
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Besides the named constants and (A)RGB representations,
QColor::fromString (which is used to parse valid strings) also supports
using "transparent". The linter however did not handle this special case
so far.

This commit adds the missing support. We don't add "transparent" to the
list of known color names to mirror the documentation in
QColor::fromString: "transparent" is not actually a color keyword, but a
separate check.

Amends 53ccd32

Fixes: QTBUG-137054
Change-Id: Ic031144b888d3fa892a87c44b4bffdc4c21bebf8
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
We need to tell the type loader that this is an ECMAScript module since
it cannot determine it from the file name.

Amends commit dc60c30

Pick-to: 6.10 6.9 6.8
Change-Id: Ie91bce86a08a81ff3df6c11d016308e3e380f15f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
We need it in many places and it's better to have it next to
equalBaseUrls(). Also, it can be inline there.

Change-Id: Ie83ad7a345a25a67f418c6cf9886ba8116f7a762
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
If accessibility feature is disabled, also don't build the related tests.

Pick-to: 6.8 6.9 6.10
Change-Id: Ieb34b481f8638a484d1b1b0672b7047d3c6ea3fb
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
This commit aims to add some clarity on what is considered
QmlIdentifier, JsIdentifier, IdentifierName and related
keywords.
It adds clear reference points for the ES7, also aims to group
tokens in the corresponding smaller sets.

This commit also adds some comments, aiming to explain the
existence of such definitions like JsIdentifier

One of the motivations behind this commit to make it more
clear and explicit for the maintenance and further addition
of keywords, such as, for example virtual and override, which
are going to be ContextualKeywords from the QML perspective,
while still being totally valid Identifiers from the ECMA
perspective.

Change-Id: I3d335bda609e8977c7c720c62229633821b1da13
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Initial implementation was based on the 3rd edition of ECMAScript.
Many things have changed since then and most of keywords were removed
from that section, even starting from the 5th edition of the standard.

This commit removes most of these reserved keywords, while leaving out
some which might potentially be useful for QML in the future.

Change-Id: I0190a6ea6d08b5d0797eb46c6636ffdb295b4565
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
There is no logic in the code based on the T_RESERVED_WORD, therefore
this commit removes it in favor of using explicit tokens.

Change-Id: Ie71f805e87bcee5c0b41ca24dc0c8fb20d13871b
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Before:

    Cannot assign object to list property "animations"

After:

    Cannot assign object of type "QQuickFrameAnimation" to list property "animations"; expected "QQuickAbstractAnimation*"

Fixes: QTBUG-137469
Pick-to: 6.5 6.8 6.9 6.10
Change-Id: Iddf52d4262720236ffc610b6f7326bb126c53509
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Coverity-Id: 481962
Change-Id: I73f9e8f49dbb9eaeab943b95c1f12b576f22b069
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
The exitCode is only valid is the process exited normally.

Pick-to: 6.10 6.9 6.8
Change-Id: Ib715ae9f6cd91b1ea8ef3fd4512b8aeb0936baa6
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Amends c77ff3f that forgot to remove
the ToIndex struct which is unused now.

Pick-to: 6.8 6.9 6.10
Change-Id: Ice185428c8848ea16c4a7a9b93c5ca9f9b70dbe9
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
We also need it for QQmlScriptBlob.

Task-number: QTBUG-19407
Change-Id: Ie06516f7ed3146b9f9198fd8ab2059474b7cc4b7
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
We only need one enumeration, and all the methods of the different
events can be inline. Then we can switch over the values of the one
enum.

Change-Id: I7691fb95fca57b6930de84fa71fc7e778edd879c
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Dmitrii Akshintsev <dmitrii.akshintsev@qt.io>
The initial window size is stored using qreal dimensions that were
implicitly truncated when passed to QWindow::resize(int, int).
This caused tooltips with multiple words to wrap unnecessarily on macOS.
By explicitly using qCeil() when resizing the popup window, the
calculated width and height are rounded up, preserving the intended
layout.

Fixes: QTBUG-130683
Pick-to: 6.10 6.9
Change-Id: I7305d02263108df72ff0c5cc81f5a7a829d9f755
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This should fix the look for 6.8.
Qt 6.9 introduced a new SideBar element to the dialogs,
so a follow-up fix is required.

Task-number: QTBUG-122738
Pick-to: 6.10 6.9 6.8
Change-Id: I5c10056e3d2636f167562b4b999f420d449ea5e2
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
The patch explicitly sets the colors from the palette for some of the
elements of the SideBar.
It also removes the usage of Basic.darkShade color, which is not
available in general case, replacing it with the palette.dark color.

A more complicated problem was related to the icons in buttonDelegate
and addFavoriteDelegate, that were not updating their colors.
The reason for that was that the unrelying C++ code was constructing
the delegates using QQmlComponent::createWithInitialProperties(), and
passed a QQuickIcon object as one of the properties. As a result, the
original binding on icon.color was removed.
To keep the binding, construct the components with a default icon,
then manually set the source and the size. This approach is slower,
but it allows to preserve the original binding from the QtQuick Button
component.

Last affected element was the drag pixmap, which was always using
the original color. Use the buttonText() palette color to update
all the non-transparent pixels of the icon before using it in the
drag.

Fixes: QTBUG-122738
Pick-to: 6.10 6.9
Change-Id: Ibf4182b1c5a631fe7043e8d76ed98629c69ab4d6
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
This amends e4971b5
and should fix build failures like the Android one seen
for the Qt submodule update in [1]:

    agent:2025/06/13 05:11:49 build.go:412: /opt/android/android-ndk-r27c/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=x86_64-none-linux-android28 --sysroot=/opt/android/android-ndk-r27c/toolchains/llvm/prebuilt/linux-x86_64/sysroot -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_QMLINTEGRATION_LIB -DQT_QMLMETA_LIB -DQT_QMLMODELS_LIB -DQT_QMLTEST_LIB -DQT_QMLWORKERSCRIPT_LIB -DQT_QML_LIB -DQT_QUICK_LIB -DQT_TESTCASE_BUILDDIR=\"/home/qt/work/qt/qtdeclarative_standalone_tests/tests/auto/qtquickview/statuslistener/android-build/build/qt_generated/qml\" -DQT_TESTCASE_SOURCEDIR=\"/home/qt/work/qt/qtdeclarative_standalone_tests/tests/auto/qtquickview/statuslistener/android-build/qml\" -DQT_TESTLIB_LIB -Dtst_qtquickview_statuslistener_qml_EXPORTS -I/home/qt/work/qt/qtdeclarative_standalone_tests/tests/auto/qtquickview/statuslistener/android-build/build/qt_generated/qml/tst_qtquickview_statuslistener_qml_autogen/include -I/home/qt/work/qt/qtdeclarative_standalone_tests/tests/auto/qtquickview/statuslistener/android-build/qml -isystem /home/qt/work/install/target/include/QtQml -isystem /home/qt/work/install/target/include -isystem /home/qt/work/install/target/include/QtCore -isystem /home/qt/work/install/target/mkspecs/android-clang -isystem /home/qt/work/install/target/include/QtQmlIntegration -isystem /home/qt/work/install/target/include/QtNetwork -isystem /home/qt/work/install/target/include/QtQuick -isystem /home/qt/work/install/target/include/QtGui -isystem /home/qt/work/install/target/include/QtQmlMeta -isystem /home/qt/work/install/target/include/QtQmlModels -isystem /home/qt/work/install/target/include/QtQmlWorkerScript -isystem /home/qt/work/install/target/include/QtOpenGL -isystem /home/qt/work/install/target/include/QtQuickTest -isystem /home/qt/work/install/target/include/QtTest -isystem /home/qt/work/install/target/include/QtQuickTest/6.11.0 -isystem /home/qt/work/install/target/include/QtQuickTest/6.11.0/QtQuickTest -isystem /home/qt/work/install/target/include/QtTest/6.11.0 -isystem /home/qt/work/install/target/include/QtTest/6.11.0/QtTest -isystem /home/qt/work/install/target/include/QtCore/6.11.0 -isystem /home/qt/work/install/target/include/QtCore/6.11.0/QtCore -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security   -O2 -g -DNDEBUG -std=gnu++17 -fPIC -fvisibility=default -Wall -Wextra -fPIC -pthread -MD -MT CMakeFiles/tst_qtquickview_statuslistener_qml.dir/tst_qtquickview.cpp.o -MF CMakeFiles/tst_qtquickview_statuslistener_qml.dir/tst_qtquickview.cpp.o.d -o CMakeFiles/tst_qtquickview_statuslistener_qml.dir/tst_qtquickview.cpp.o -c /home/qt/work/qt/qtdeclarative_standalone_tests/tests/auto/qtquickview/statuslistener/android-build/qml/tst_qtquickview.cpp
    agent:2025/06/13 05:11:49 build.go:412: /home/qt/work/qt/qtdeclarative_standalone_tests/tests/auto/qtquickview/statuslistener/android-build/qml/tst_qtquickview.cpp:4:10: fatal error: 'QtQuickTest/6.10.0/QtQuickTest/private/quickforandroidtest_p.h' file not found
    agent:2025/06/13 05:11:49 build.go:412: 4 | #include <QtQuickTest/6.10.0/QtQuickTest/private/quickforandroidtest_p.h>
    agent:2025/06/13 05:11:49 build.go:412: |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    agent:2025/06/13 05:11:49 build.go:412: 1 error generated.

[1] https://testresults.qt.io/logs/qt/qtdeclarative/975a91282e28a518a8a30b6425e5795c873a7d4a/LinuxRHEL_8_10x86_64AndroidAndroid_ANYx86_64GCCqtci-linux-RHEL-8.10-x86_64-51-8e0532AndroidTestRun_GenerateSBOM_Packaging_Sccache_UseConfigure_VerifySBOM_WarningsAreErrors/c72502c9a20723e5a9938f9d2caae2ee43c7809b/test_1749788448/log.txt.gz

Pick-to: 6.10
Task-number: QTBUG-133439
Change-Id: I58e0ce19e49b8f5ea286283e953392772cbd7a05
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Children get destroyed before their parents, and objects notify
listeners when they get destroyed. If a child is a listener on a parent,
then this results in a (partially) destroyed listener object being
notified, resulting in UB and - fortunately - test-breaking warnings.

The handle is (typically) a child of the dialog, and added as a listener
for implicit size changes when set. Explicitly remove it in the
destructor of QQuickAbstractColorPicker, before destruction of the
object tree.

Pick-to: 6.10 6.9 6.8 6.5
Fixes: QTBUG-137561
Change-Id: I76ff1ff8bc7d563133d7bb9cd8b7bee76d6cec9b
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
Change-Id: I6293d620671851f790fbbc3739901b444da27807
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Blacklist it on opensuse and skip it on android.

Task-number: QTBUG-137400
Change-Id: I8da8352e210d80734f5b0f9b3ab4e43799dda84d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Change-Id: If24576debc2246a2a8c244a56c4a69e9a2f6b2e6
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Change-Id: If9d47e447e9480f2030e79fabf7343e6c4d49ab4
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.