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.
1 out of 13 committers have signed the CLA.

✅ jobor
❌ Mate Barany
❌ samishalayel
❌ ec1oud
❌ alcazaco
❌ Inkane
❌ ottoryynanen
❌ alpqr
❌ eskilblomfeldt
❌ dangelog
❌ jarkkokoivikko-code-q
❌ michaelweghorn
❌ tjenssen


Mate Barany 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.

Dmitrii Akshintsev and others added 28 commits March 27, 2025 15:37
The matching against URIs was already done in staticPluginsFilteredByUris. Therefore this second matching is redundant

Change-Id: Ie9f349af678c7401733fdd828f78093c187ca972
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
There potentially might be plugins where the URI is not set properly. The warning and filtering such plugin should be enough. Early exit and error reporting seem to be excessive.

This will allow to make one more function free and makes the code flow more straightforward.

Change-Id: I29e1ede32fe76016c03a04ec6c8a288c7b5f1404
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
This patch attempts to simplify the code flow, improve readability
and separation of concern, by the following:

- add early exit instead of most of the functionality being within
big `if` statement
- unify parsing / verification of static plugin
(if it's an importable qml plugin) (tryExtractQmlPluginURIs)
- Instead of cumbersome (plugin, array of uri-s) introducing
(plugin, uri) pairs, taking into account the in majority of cases
there are 1:1 relationships.
- staticQmlPlugins is responsible for filtering out static plugins,
 which are "importable" qml plugins
- staticQmlPluginsMatchingURI is responsible for the further
filtering of qml static plugins based on VersionedURI and metadata URIs

Change-Id: I1eb392d49afc6f38a39e2df90e89f1e9773dc7c0
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Pick-to: 6.8 6.9
Task-number: QTBUG-134551
Change-Id: Iffbcd348a219259888137248f3b35bd9d36eff45
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Instead of restart(), since we don't need the elapsed time.

Pick-to: 6.9 6.8
Change-Id: Iae2246a8cd8a611622f0629e67a9502a1a2216c0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
QTest::createTouchDevice() passes ownership of the device to the caller,
so make sure it gets deleted.

We prefer std::unique_ptr over QScopedPointer.

Task-number: QTBUG-132212
Pick-to: 6.9 6.8
Change-Id: Icfde7cb42bd7296cc4dbac4095d24ec7d0888a35
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Comparing QPointF's is usually not a great idea, and I just saw it fail
locally with Actual QPointF(11,32.8) Expected (QPointF(11,33))
even with QT_SCALE_FACTOR=1

Task-number: QTBUG-55000
Change-Id: I222eb912df9c4d11dada9a6d8b18cecf89b5da1a
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Makes the code tidier.

Change-Id: I8d97ce601d3b16a90bb4cfd069ba2d997028d565
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Change the C-style array to std::array. Initializing C-style arrays from
temporaries seems suspicious. This issue was flagged by Clang-Tidy as a
warning.

Pick-to: 6.9 6.8
Change-Id: I7f9e5aefcda802ee0b45b39634175a634976b4a9
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
tst_QQuickApplication::active is flaky on openSuSE where when changing
the focus to nullptr, it remains on the window. This is due to some
asynchronicity when requestActivate is call, requesting a second
activation when the focus should be changed to nullptr.

Do not call requestActivate() on the window when the platform uses xcb

Fixes: QTBUG-75215
Fixes: QTBUG-123550
Pick-to: 6.9 6.8 6.5
Change-Id: I77216767f021abed09c888a17e1a580900044a18
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
tst_QQuickApplication::state is flaky on openSuSE where when changing
the focus to nullptr, it remains on the window. This is due to some
asynchronicity when requestActivate is call, requesting a second
activation when the focus should be changed to nullptr.

Do not call requestActivate() on the window when the platform uses xcb

Unblacklist tst_QQuickapplication::state() on Opensuse as no longer
flaky.

Fixes: QTBUG-122031
Pick-to: 6.9 6.8 6.5
Change-Id: I66ebc02bc44c6ba27d13f5eb5f026006ddf13263
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Pick-to: 6.9 6.8 6.5
Change-Id: I9a78932fe57029d53224ed190931c5db20f247fc
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Change-Id: I706714484d65b58360d72c7b680404f47285870e
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
QSGBatchRenderer uses QElapsedTimer without including the header. This
breaks compilation as used to be included transitively from QtBase, but
this seems to be removed.

Pick-to: 6.8 6.9
Change-Id: I20e58f4089287120f8e3d38e070f5324980dbaa1
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
The default device from QTest::createTouchDevice() is a touchscreen,
so we should call it that, to disambiguate touchpads (a few tests use
them). And QScopedPointer is discouraged nowadays.

Task-number: QTBUG-132212
Pick-to: 6.8 6.9
Change-Id: I2aeaf8cee3c7b6041945506e11fa62d7c923c556
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Frederic Lefebvre <frederic.lefebvre@qt.io>
Change-Id: I287c3f58674e00ef0541391a296c4c161a9e1c2e
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Match a recent change in QLocale and related tests.

Pick-to: 6.9 6.8 6.5
Task-number: QTBUG-134768
Change-Id: Ice980f0ce4db9966f812628526f1582506967736
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
We've resolved the value type in the type propagator. Trying to do it
again in the code generator, after the iterator may have been adjusted,
is quite wrong. If we resolve the list value type on a type that's not
a list (anymore), then we get an invalid type, which subsequently
crashes.

Amends commit a173d50.

Pick-to: 6.9 6.8
Fixes: QTBUG-135288
Change-Id: I1227803ed100c83f8fc11898be0a4d0199d639dd
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Change-Id: Ib9287352142fe3820d9b31d7423d3c34ca370046
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
It generally makes no sense to continue with the instruction after we've
detected an unrecoverable problem. Replace all reject() calls with a
macro that also returns right away.

Task-number: QTBUG-135288
Change-Id: I767318d5dc1e8e12c35e5ecbc04375cbf7d17016
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Pick-to: 6.9 6.8
Change-Id: I91d069b7bb833e4b0b3cb6c4debaebdd3d9d7e7f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Add a few cases to checkedInputRegister() such that
qqmljstypepropagator does not assert when processing eval calls.

Pick-to: 6.5 6.8 6.9
Task-number: QTBUG-129307
Change-Id: I2d10799051e59fb3597966992fd8aa7c85ed2545
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Move all the tests from testFormat() to a newly added qml() function
that do not seem to test any command line parameters.

The qml() function runs the tests in-process instead of spawning extra
qmlformat processes.

Task-number: QTBUG-134669
Change-Id: I99bfd8a840c31cd2b0a4c889c0f0ca39b8c73eb2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Remove the unused arguments and run clang-format on it.

Task-number: QTBUG-134669
Change-Id: I1aff620feb26a160f4330807a56a5985c7c5fc12
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Prepare for the splitting of tst_qmlformat into tst_qmlformat_cli by
extracting common functionality into a base class.

Task-number: QTBUG-134669
Change-Id: I66a72b128802a51b0289320e6022bd69c6cfe4ff
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Prepare for the splitting of tst_qmlformat into tst_qmlformat_cli by
moving the base into a header.

Task-number: QTBUG-134669
Change-Id: I76fbdf2f9d31a2e160d6ae0389a409c2214d36da
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Move the tests that require spawning a qmlformat process into
tst_qmlformat_cli.

Fixes: QTBUG-134669
Change-Id: I38f2e624bcd6152074604663bc4a626783097bda
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Make qmllint complain about bad qmldirs: don't ignore warnings emitted
by qqmldirparser, and adapt a test where a missing trailing `/` in a
prefer directive leads to a test failure because of a qqmldirparser
warning that now gets emitted by qmllint.

Pick-to: 6.8 6.9
Change-Id: I85f0dd53ba887d1f01ce9ef9a9475d58e3f97208
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Ulf Hermann and others added 30 commits May 2, 2025 16:02
If a QMetaType is a pointer to QObject, it's not a value type.

Change-Id: I7505a968e02ff87646af6c1e506a99328fc7d6eb
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
In theory, we might otherwise get conflicts when loading new types.

Change-Id: I6df05088684da8baeaf820fd7df78a10046b3ccd
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
In theory, newly loaded modules might have different module imports.

Change-Id: I045769e25b2bb89face1984fac0991e80cdbc199
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Commit 137cdc3 broke
qt6_target_qml_sources with no QML_FILES argument, because it called
qt6_add_resources without FILES (for the QML files), which causes a
linker error.

Check whether we have QML files and only then create the QML-specific
resource.

Add an autotest that calls qt6_target_qml_sources separately for QML and
resource files.

Fixes: QTBUG-136491
Change-Id: I5e8173652887f257fd6d8e6c8d18bcc0e295b714
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Remove the ASM language where no assembler files are used.

Pick-to: 6.5 6.8 6.9
Change-Id: I3c94f798803b054a432fc2c8d6d65c665572a202
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
If an object has a dynamic meta-object (e.g. because it has been
extended with additional enums), we can no longer create a property
cache.
This could have caused a null-poninter dereference; avoid this by
checking for nullptr.

We currently don't do any checks at all in that case; finding a better
solution is tracked in QTBUG-136560.

Pick-to: 6.9 6.8
Change-Id: I678cf9908d5bbec50e133a462f7f4c813dca44dd
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
A new example showcasing use of a worker thread for fetching data to a
custom model based on QAbstractListModel. The pattern is a topic in
Qt World Summit 2025.

Fixes: QTBUG-135351
Pick-to: 6.9
Change-Id: If1fe04740206fa5bfbe1eea269e2bde1e217eaf9
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Change-Id: I375c9b1713d3eaef9626ee23527b8b48601b957e
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
Port QSGDepthStencilBuffer in a slightly changed form from Qt 5.

Two layers in the same scene can use the same single depth-stencil
buffer, instead of creating a dedicated one for each. As long as the
size and sample count is the same. The render passes are recorded
sequentially, and there is no need for the depth-stencil content once
a render pass is done.

The catch is having to deal with changing sizes, e.g. a window resize
often leads to changed sizes for the layers of the scene. We do not
want to end up cached renderbuffer objects with sizes that will
possibly never be needed again. The Qt 5 approach solves this with
reference counting and QShared/WeakPointers. Continue with that
approach.

If there is actually a depth-stencil buffer that is fully physically
backed, that is a different question. With Vulkan for instance,
on some GPU architectures we expect that the depth-stencil images will
be transient + lazily allocated + no store, so it may matter little
how many images we have. Similar things might happen in GLES
implementations on tiled GPU architectures.

However, generally it is ideal if the Qt 5 behavior is kept, so that
no confusion arises from an extra renderbuffer or two showing up when
counting and comparing resources in frame captures between Qt 5 and 6.

Fixes: QTBUG-135813
Pick-to: 6.9 6.8
Change-Id: I238dc53600f4a00e6ee2f7ccc97ac33ff189e3c5
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
This fixes a shutdown crash observed in Qt Design Studio 4.8 with Qt 6.8.3.

Minimal crash trace:
  QQuickShaderEffectPrivate::shaderEffectManager
  QQuickShaderEffectPrivate::updateShader
  QQuickShaderEffect::setVertexShader
  ...
  QQmlBinding::slowWrite
  QObject::~QObject

Pick-to: 6.9 6.8
Change-Id: I0e729bf7bb59a4e133cc2d06d79af2343934bbc5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
We need information about all members in the qmltypes file, even if the
revisions are nonsensical. This is because we need to get the method
indices right when trying to call methods.

We don't want to actually register the extra versions, but the code
handling registration is different from the code producing qmltypes
already.

Amends commit c0f4442

Pick-to: 6.9
Fixes: QTBUG-136248
Change-Id: Ibd41fcd3a3d7b9d79e1d1715746dd90702ade518
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
QVector is just an alias for QList in Qt 6, so use
the latter directly.

Change-Id: I55792668400b4ad46929dc2b9b9bc1b68cbc4b00
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
tst_flickableinterop::pinchHandlerOnFlickable is no longer flaky on
openSUSE

Pick-to: 6.9 6.8 6.5
Change-Id: Ib700766612f0b29c39be12ef2d5b6d8f50665579
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
tst_qquicklistview::populeTransitions was blacklisted on
openSUSE-42.1, which has been deprecated.

This test is not flaky on openSUSE 15

Fixes: QTBUG-53863
Pick-to: 6.9 6.8 6.5
Change-Id: I88c26d9450f9563f0e83c60f052b3f4f696efd21
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
tst_qquicktext::fontSizeMode was blacklisted on openSUSE 42.1, which
has been deprecated.

This test is also not flaky on openSUSE 15

Pick-to: 6.9 6.8 6.5
Change-Id: I056634aeb0a418e1d33aad72e8fa912840895365
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Amends 8848fba

Pick-to: 6.9 6.8 6.5
Change-Id: I1b8d907ab20abcfb78c52ac28d20cc953bab2a25
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Amends 959836a

Change-Id: I64a04f20beed34cb853e69a356734bcb6f7f0349
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Amends db0913a

Pick-to: 6.9 6.8 6.5
Change-Id: I7230644465832c9de1b8343b01948a606a15012d
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Merge conflicts are slowing us down quite a bit when working on
qmllint. Sorting the logging categories will reduce their number.

As a drive-by: fix macro

Change-Id: Ibee997c79b29128c209018a2aa010a35e7d13991
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
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>
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.