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 <[email protected]>
Reviewed-by: Ulf Hermann <[email protected]>
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 25 committers have signed the CLA.

✅ EvenOAndersen
❌ Oliver Eftevaag
❌ vohi
❌ gongotar
❌ Issam-b
❌ alcroito
❌ Inkane
❌ mitchcurtis
❌ dilekakcaay
❌ IQomit
❌ aavit
❌ eskilblomfeldt
❌ ASpoerl
❌ iCristalrope
❌ timblechmann
❌ a12e
❌ QtDheeru
❌ ec1oud
❌ matthias-rauter
❌ samishalayel
❌ diseraluca-qt
❌ JKSH
❌ Morteza-Jamshidi
❌ seyainc
❌ zzag


Oliver Eftevaag 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.

Inkane and others added 28 commits July 10, 2025 09:29
Instead of doing string comparisons, encode the information in the scope
type for bindings and signal handler functions. Add a helper function to
check whether a scope represents any kind of functions.

Change-Id: I41ad1316852dd484ac54c02f99bb25e618099e62
Reviewed-by: Sami Shalayel <[email protected]>
Coverity-Id: 482774
Coverity-Id: 482763
Change-Id: Ia80383c04cf47aef11d16b38d5580bf1b9329f0c
Reviewed-by: Sami Shalayel <[email protected]>
Hidden files can be used in QML. Previously, with QFileInfo, we did
detect them and we should continue to do so.

Amends commit 2bd3a62

Task-number: QTBUG-134652
Change-Id: Icfc4f37fe72428dda43bfa82803f223f77c94f77
Reviewed-by: Luca Di Sera <[email protected]>
Prior to this commit, the Accessible.ignored setter did not send a11y
events like the setter in the header STATE_PROPERTY macro and other
setter do. This leads to changes of Accessible.ignored not being
registered by screen readers.

Fixes: QTBUG-122436
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I0626b66c91876fa3e6dd23e76c32e8bfe43136bf
Reviewed-by: Michael Weghorn <[email protected]>
Reviewed-by: Volker Hilsheimer <[email protected]>
If we get the same file twice, that's generally the effect of a linkage
cycle. Either we're dealing with a static build where this is fine and
we don't need to complain about it, or the linker will complain anyway
and we don't have to.

Pick-to: 6.10 6.9 6.8
Fixes: QTBUG-132518
Fixes: QTBUG-127133
Fixes: QTBUG-134292
Change-Id: Iad8b3b5c694d96ebdcbf03522ce2318ae8d24fb2
Reviewed-by: Fabian Kosmale <[email protected]>
Updated SignalSpy::clear() QML documentation to clarify that it does
not affect the valid property.

Pick-to: 6.10 6.9
Fixes: QTBUG-54605
Change-Id: I9216cc0100a5eb2c463391db042d13c799e2318b
Reviewed-by: Shawn Rutledge <[email protected]>
Clarify the effectiveScrollBarHeight and effectiveScrollBarWidth
refer to the actual height and width used by visible scrollbars.

Pick-to: 6.10 6.9
Fixes: QTBUG-120706
Change-Id: I1b9efd998922f4e6fa20564710266a012b9de600
Reviewed-by: Doris Verria <[email protected]>
The documentation of QQuickitem::stackBefore() and stackAfter()
incorrectly stated that the sibling item was being moved. The
updated documentation now correctly states that the current
item (this) is moved before or after the sibling in the
stacking order.

Pick-to: 6.10 6.9
Fixes: QTBUG-77201
Change-Id: I608f0eb5bc5338e58ba82ab656ea7eb1d83e2e28
Reviewed-by: Mitch Curtis <[email protected]>
Added textual descriptions for all images in the QtLabsPlatform
documentation to ensure QDoc generates appropriate alt text.

Pick-to: 6.10 6.9
Fixes: QTBUG-136147
Change-Id: Ice484beaa12e2169923a84181257562b720ad61e
Reviewed-by: Alexei Cazacov <[email protected]>
Reviewed-by: Leena Miettinen <[email protected]>
Clarifies the known conditions when Repeater.count does not match the
actual number of delegate instances: if it doesn't have a visual parent
("set up correctly" was a bit vague, raising the question of whether
there are other forms of incorrectness), or because it's temporarily out
of sync during delegate instantiation/deletion. If you need more info,
monitor the signals and/or check itemAt().

Amends a6eac7e

Pick-to: 6.10 6.9 6.8
Fixes: QTBUG-127955
Change-Id: I6862beb8d61b1cf8a747bdc3ad02226691e6c3eb
Reviewed-by: Volker Hilsheimer <[email protected]>
The settings file in the docs looks quite old: replace it with a fresh
version obtained by "qmllint --write-defaults".

Pick-to: 6.10
Change-Id: I46b12f6b5164ea1880fb63b5408b4b3494eb2d93
Reviewed-by: Ulf Hermann <[email protected]>
Some comments and header guards still had V8 in them.

Change-Id: I71e888fb72916fcd948a293d9fd50fb54a9499c3
Reviewed-by: Sami Shalayel <[email protected]>
It was picked back to 6.10 after all.

Amends commit 8bc307e

Pick-to: 6.10
Change-Id: I7e3b755b50b9865f0905ccb6a2ab5f4844719869
Reviewed-by: Sami Shalayel <[email protected]>
The current btoa() and atob() perform UTF-8 conversion of the data and
therefore produce different outputs than the relevant Web APIs. That's
not helpful for a format which was explicitly invented for data
exchange. However, since they are compatible with each other, we cannot
simply change their behavior.

The actual problem stems from the fact that those functions take strings
as their inputs. Strings in JavaScript as well as Qt hold 16-bit data,
while base64 can only process 8-bit data. This makes it necessary to
deal with invalid characters in the first place.

Add additional overloads that take QByteArray. At least for btoa() we
don't need to check the input for compliance this way. However, since
it's difficult to obtain a QByteArray for random data in JavaScript,
also add overloads that take a few more common array-likes and convert
them. These overloads actually check the data for compliance and throw
the "Invalid character" excpetion if it's found to be non-compliant.

In turn, deprecate the broken implementations and print a warning when
they are used.

[ChangeLog][QtQml] The Qt.btoa() and Qt.atob() methods were subtly
broken and produced different output than the common Web APIs. They have
been deprecated in favor of overloads that take array-likes.
Array-likes, especially ArrayBuffer, are a better fit for expressing raw
data than strings.

Fixes: QTBUG-135329
Change-Id: I4d48c84b3a87cb615f78aa1a8c1eddfedcd306f9
Reviewed-by: Fabian Kosmale <[email protected]>
Reviewed-by: Sami Shalayel <[email protected]>
Doing this on the debug server thread can cause deadlocks since we may
need to serve a file request stemming from type registrations that also
lock the QQmlMetaTypeData.

Amends commit 618720a.

Pick-to: 6.10 6.9 6.8
Fixes: QTBUG-138349
Change-Id: Iaa6c8cbf9270989aeca0cb84a4a77cd2aee36804
Reviewed-by: Sami Shalayel <[email protected]>
Reviewed-by: Tim Jenssen <[email protected]>
Reviewed-by: Fabian Kosmale <[email protected]>
It makes no sense to prohibit multiple imports of the same QML module
with the same version. We can just re-order the imports according to
prcedence when we detect this.

Pick-to: 6.10 6.9 6.8
Fixes: QTBUG-138391
Change-Id: I5ad94e1181f6a2beb278e421c1bbf06678fd863b
Reviewed-by: Sami Shalayel <[email protected]>
The precedence is always quint8 and addImportToNamespace doesn't need
the errors list.

Change-Id: Ieb0a703cf4e2b5fe64fe954b6ddbdfcf35fb4ddd
Reviewed-by: Sami Shalayel <[email protected]>
A path that starts with '/:' is a pretty obscure thing and there is no
reason to special case it here.

Change-Id: I06cac90de9dfe202f9fbbe196183e9e89062de86
Reviewed-by: Sami Shalayel <[email protected]>
Currently when a JITtted function throws an exception, on exiting, the
accumulator is not zeroed-out if we don't have an exception handler and
is zeroed out when we do have an exception handler.

In the case where an exception handler is missing, this means that if
the caller is making use of the result of the function call, it might be
dealing with garbage memory.

Many times this isn't an issue as the result of the call would correctly
be ignored in the face of handling the presence of an exception.

Nonetheless, not directly using the result is not necessarily enough to
avoid issues with the possible garbage.

In particular, if the result of the call is put on the JS stack and
handling the exception allocates, the GC might be run as part of the
allocation and read the elements on the JS stack, one of which would be
the garbage memory that was returned.

One case where this can happen in the current code-base is during the evaluation
of a non-signal `QQmlJavaScriptExpression`, which does put the result of
a call on the JS stack while later handling an exception in a possibly
allocating way, with the garbage result still on the JS stack.

Furthermore, the interpreter currently isn't affected by the same issue,
as the interpreter always zeroes out when unwinding without running an
handler.
This adds the additional problem of the behavior differing between the
an interpreted function and its JITted version in the face of an
exception when the result of the call is voluntarily or not inspected.

To avoid the issue, the code generated by the baseline JIT was modified
to always zero out the accumulator before exiting a function call after
an exception, independently of the presence of an exception handler.

This further aligns the behavior of a JITted function to that of the
interpreter when no handler is present.

A test was added to `tst_qqmlecmascript` that exemplifies the issue by
passing by `QQmlJavaScriptExpression::evaluate` with a JITted throwing
function.

Fixes: QTBUG-138242
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I969dc790f8a274364ae124afaeae8e2381fc82ae
Reviewed-by: Fabian Kosmale <[email protected]>
Reviewed-by: Ulf Hermann <[email protected]>
Some of the tests currently use environment variables to configure the
garbage collector.

In doing so, the test indiscriminately unsets those configuration
variables on exit, which has the side effect of possibly unsetting them
even if they were set outside the test case itself, and especially could
unset them for later test cases, possibly affecting them.

To avoid the issue, the test cases now configure the GC through the use
of private API instead of indirectly passing by the relevant environment
variables.

Change-Id: I3b20badf754638dc8e4206de711c214e13e78c1d
Reviewed-by: Fabian Kosmale <[email protected]>
QQmlTypeLoader::fileExists() can do the same job, on all platforms, and
more efficiently.

Drop the file name case check when loading plugins. Plugin paths are
platform-specific and controlled by the build system. There is no sane
way to confuse the casing. Also, the build system apparently creates
case-mismatched plugins on android, and that works fine so far because
QQml_isFileCaseCorrect() was a no-op on android.

Fixes: QTBUG-134652
Change-Id: I46059be7998ff8402b400b3e2a5385065275e38d
Reviewed-by: Sami Shalayel <[email protected]>
The delivery agent generally accepts key events before sending them to
the quick item; the corresponding item can further accept or ignore
those events.

The reason that the user can't override the shortcut key event in the
quick text edit is that these events are marked as accepted by default
in the delivery agent, and the quick text edit also doesn't explicitly
handle the read-only case, which causes the event state to remain as
accepted.

This patch ignores the shortcut override event by default in the
delivery agent. Also, make the quick text edit to execute the
configured key handler to either accept or ignore before processing
the events. This gives the chance to execute the required shortcut
actions.

Fixes: QTBUG-136959
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: Ib6400f083f4e21d1b23db87b002acb1cbd4ac82b
Reviewed-by: Volker Hilsheimer <[email protected]>
We make a copy of the context menu event in order to map its position
to cursorRectangle, but we forgot to set the accepted state back onto
the original event. If we don't do this, showEditMenu (in
src/plugins/platforms/ios/qiostextinputoverlay.mm) shows the built-in
native text editing context menu (QIOSTextInputOverlay::s_editMenu)
because it sees that the event wasn't accepted, resulting in both that
and Controls' menu being shown.

Amends 31ca393.

Fixes: QTBUG-138209
Change-Id: Iac001d9632af2f891337821720a372ec4833f173
Reviewed-by: Shawn Rutledge <[email protected]>
Addresses header review feedback:

https://codereview.qt-project.org/c/qt/qtdeclarative/+/651782/1/src/qmltest/quicktest.h#86

Amends 386e085.

Task-number: QTBUG-137478
Pick-to: 6.10
Change-Id: Ie16fcac17b29280e47ef9e4362b877f3b4c61b74
Reviewed-by: Volker Hilsheimer <[email protected]>
Reviewed-by: Giuseppe D'Angelo <[email protected]>
Change-Id: I37d9d62856ac120be97cc929d298ffb77ba4a3af
Reviewed-by: Joerg Bornemann <[email protected]>
Task-number: QTBUG-137318
Pick-to: 6.10
Change-Id: I30bb7161d23c9723842b4dd7ea346dd8a85fb6d9
Reviewed-by: Jan Arve Sæther <[email protected]>
The method provides an easier construction of a QV4::Value representing
the Undefined value and was thus intended to be called "undefined", as
it can be inferred from the introducing patch at
ac2d9bf.

The current name is thus almost certainly an uncaught typo and is now
renamed to the more descriptive and originally intended "undefined".

The only usage site of the method was modified to use the new name.

Change-Id: Ic00d910960d281c84550af3ab5ccaab52283daca
Reviewed-by: Fabian Kosmale <[email protected]>
We need to actually defer the code which attempts to detect whether we
are linking against QtQuick to the point where we write-out the file, as
the user is not unlikely to use target_link_libraries _after_
qt_add_qml_module.
Amends 065b784.

To test that this works, we run the all_qmllint target of on an example
project. We need to add a .qmllint.ini file to let qmllint fail the
build if there are any warnings.

Pick-to: 6.10 6.9 6.8
Change-Id: I7e00583b3a5b38549db2be13b1a8817b8489496d
Reviewed-by: Alexandru Croitor <[email protected]>
Ulf Hermann and others added 30 commits August 12, 2025 12:27
stringValue() already checks isString(). We don't have to do it twice.

Coverity-Id: 486710
Change-Id: I074228f9a120c3bbfe6d4a65f05fe11322fbd07b
Reviewed-by: Olivier De Cannière <[email protected]>
Change-Id: I2fc82de562909ab2e0eecfbbe1e2e53953a33756
Reviewed-by: Fabian Kosmale <[email protected]>
Reviewed-by: Ulf Hermann <[email protected]>
We construct the iterator from the exports of the module in all current
code paths. Therefore, this case can't happen in the current code.
Still, the fact that we have a branch that throws a reference error
there tells us that it's intended to work on other collections of names,
too. Let's complete the check and also check for nullptr since
resolveExport can indeed return that.

Coverity-Id: 486706
Change-Id: Ieaf3996e76265e9e6ef59c2168699e47e41e8ff5
Reviewed-by: Olivier De Cannière <[email protected]>
The Text::wrapMode has been referenced incorrectly as Text::wrap and
its corrected in this patch.

Fixes: QTBUG-137733
Pick-to: 6.10
Change-Id: Ieb1ab02e19bc929f103443f0845a8980daceb245
Reviewed-by: Jan Arve Sæther <[email protected]>
QT_USE_NAMESPACE was missing, so they didn't compile with namespaced qt.

Pick-to: 6.10
Change-Id: Ic4b1126cfab7780c714a737e81f0947664bade02
Reviewed-by: Ulf Hermann <[email protected]>
The container reorders the content model items after component
completion. The content model can be assigned as a model to the item
views to visualise through a container content item. The content item
can have item views anywhere in the object hierarchy. If the item
views are somewhere down in the line and not at the top, there is
a chance during component completion that some of the items are
reparented to the item views, and others are with the container
content item itself. Thus, reordering at this stage (having partial
items) can lead to changing the order of elements within the content
model, which further causes repositioning of items within the item
views.

This patch resolves this issue by skipping reordering the content
model, if any of the items are not reparented to the item views.

Fixes: QTBUG-138490
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I1673e600774e2821653542c003d2d573f62d024d
Reviewed-by: Oliver Eftevaag <[email protected]>
Reviewed-by: Mitch Curtis <[email protected]>
The method incorrectly returned m_dirty_vertex_data instead of
m_dirty_index_data.

Pick-to: 6.10 6.9 6.8 6.7 6.6
Fixes: QTBUG-123988
Change-Id: Ib99175adabc711c8449ff3db755fbade968f7c63
Reviewed-by: Edward Welbourne <[email protected]>
Reviewed-by: Andy Nichols <[email protected]>
Replace the previous stable sort + filter approach with an in-place
compaction loop that moves valid batches forward and recycles invalid
ones immediately.

This removes the need for temporary heap storage and avoids redundant
copying and sorting, while preserving the original order of valid
batches.

Change-Id: Icbe2c3d96b5d38a0a1f2c14ce175eb19d45d5a63
Reviewed-by: Andy Nichols <[email protected]>
For applications running under Qt Wayland compositors, touch events may
be accompanied by fake mouse moves coming from the touchscreen device.
That might or might not be useful: but since most of Qt Quick ignores
such stray mouse moves, and PinchHandler was getting deactivated by
them, we now make an effort to avoid delivering them to PinchHandler
after it has become the exclusive grabber of those touchpoints (which
looks the same as being the grabber of "that" mouse).

Added a reminder to the handlePointerEvent() comment that tablet events
are different: hover events are not enough, in fact we need to deliver
TabletMove events to HoverHandler so that it has a chance to change the
cursor (i.e. keep the tst_HoverHandler::deviceCursor test working).

Pick-to: 6.8 6.9 6.10
Fixes: QTBUG-123985
Change-Id: I513caf277e2fb87401b3e0bb5547f9623467b423
Reviewed-by: Richard Moe Gustavsen <[email protected]>
The only difference in the function is moved into setDataPrivate.

Q_STATIC_LOGGING_CATEGORY lcTreeModel is no longer used.

This is the 8th patch in an attempt to make them more similar and
eventually merge common pars in a common abstract class.

Task-number: QTBUG-138703
Pick-to: 6.10
Change-Id: Id7a7166a7dd31a5ab3908e68571bc802729798a3
Reviewed-by: Mitch Curtis <[email protected]>
The only difference in the function is moved into dataPrivate.

This is the 9th patch in an attempt to make them more similar and
eventually merge common pars in a common abstract class.

Task-number: QTBUG-138703
Pick-to: 6.10
Change-Id: I6b247121f64b070ee31846a5da4be9ad1abb93be
Reviewed-by: Mitch Curtis <[email protected]>
Also, turn QQuickAccessible items to invalid() once the
QuickItem destructor starts.

Change-Id: I8b6bc7d69ffaeb01eb453e75de2847efb869cbf2
Reviewed-by: Jan Arve Sæther <[email protected]>
If we don't do this, QQuickAbstractDialog::create will see that
m_handle is valid and call onCreate, which tries to call selectedFiles
and we get a crash.

Amends f9421ab.

Pick-to: 6.5 6.8 6.9 6.10
Change-Id: Id522e068c689a5bc5662466e446f99586bc7c738
Reviewed-by: Oliver Eftevaag <[email protected]>
This adds a build command for generating QML files out of SVG
files automatically. It works by first calling svgtoqml on the
sources and then adding these to the QML module for the target.

[ChangeLog][svgtoqml] Added a cmake api for automatically
generating QML files from SVG files in an application.

Task-number: QTBUG-128915
Change-Id: I44e70f0ada4ca8ac9ac8253d46832d3a286da927
Reviewed-by: Alexandru Croitor <[email protected]>
Remove the hand-written keys from the test and use the static strings
instead. One of the previous hand-written key had a typo. Also make sure
that the settings are really set, as QVariant::toBool() returns false
for a unset settings, for example in the case of the key with the typo.

Change-Id: I15da10409fbf374a475dc3930844fd56120f370a
Reviewed-by: Semih Yavuz <[email protected]>
In animated transforms, it is common that only 1-2 of the properties
(scale/translate/rotate/anchor) are actually animated, while the rest
have constant, and often default, values. To lighten the generated qml
code somewhat, this patch skips generating Animation items for
constant value properties. In particular, it skips animating the
center/origin point of rotations when not needed. And for properties
with constant default values, the entire Transform object is skipped.

Depending on the inpu, this saves 10-50% of the size of the generated
qml, and correspondingly saves loading time and processing load.

Fixes: QTBUG-139076
Pick-to: 6.10
Change-Id: I151164b63356b0fd3b15cfcdc8d163f835d46fde
Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
A window can be hidden during the polish step. For example, an app may
hide its window if the geometry is not good enough. This can result in
the following render thread events if the QPA sends sync expose events:

 - WM_Obscure
 - WM_TryRelease
 - WM_RequestSync

The WM_RequestSync event comes from the WMSyncEvent.

With QtWayland, repainting a window after it has gotten unexposed can
lead to the compositor posting a protocol error. There is also matter of
keeping code predictable: if the QPA sends an unexpose event, it'd be
great if the app stops repainting.

Pick-to: 6.10
Change-Id: I1d477436d6f79156aca44960c47a84f2e12ca4d2
Reviewed-by: Andy Nichols <[email protected]>
When a property potentially used in focusIn or focusOut animation is
changed, we need to reschedule the animation with the correct parameters.
properties like verticalPadding, leftPadding, controlHasText, ...
To fix the issue I simplified focus animation logic.

Fixes: QTBUG-138028
Change-Id: I115fb6fdd5676ae0282b5b4b5bd460ea3b28392a
Pick-to: 6.10 6.9 6.8
Reviewed-by: Mitch Curtis <[email protected]>
Task-number: QTBUG-137318
Pick-to: 6.10
Change-Id: I3e4d506ce6b8961b85bfb8a992c6de345ea7c1f1
Reviewed-by: Jan Arve Sæther <[email protected]>
Add reportConfigForFiles to generic tooling class. It will perform the
search for the given files. Use stdout to report. qmllint had already an
option --dry-run for printing the fixed codes, but we can still allow this to
use that option name.

For qmlls, report the path if verbose option is set.

Fixes: QTBUG-137874
Change-Id: I6bd43866073b3df832b6fd89d477bced869d74c0
Reviewed-by: Ulf Hermann <[email protected]>
When requested, use the specified .qmlformat.ini file as the setttings
file. When --settings option is given through  commandline, do not
perform per-directory configuration lookup.

Adapt the test to accept the SearchOptions.

Fixes: QTBUG-107212
Change-Id: I6b4f2c4a4321f89ae6dabf89a866c53486c22cce
Reviewed-by: Sami Shalayel <[email protected]>
Pick-to: 6.10
Change-Id: Ie189960af25a33f0dee54fbd49213f9d5eab5891
Reviewed-by: Mitch Curtis <[email protected]>
Cmake escapes some characters but not all, so you may end up with
invalid command lines on some platforms.

Change-Id: I1a3aad0b3d48b9e2dea2c4b1b55e371f286dfd46
Reviewed-by: Alexandru Croitor <[email protected]>
If isReference() is true and we allocate a gadgetPtr() on the stack with
alloca(), then when readReferenceValue() fails, we return immediately,
leaving a bad pointer in d()->gadgetPtr():
- gadgetPtr now references alloca() memory from a function that returned
- the destructor of the gadget is never called

To fix this, ensure that we destruct and nullptr the gadget on all exit
paths, thanks to a qScopeGuard().

Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I4ff411c0f364ad337fdbd55772812e1f219e6dff
Reviewed-by: Ulf Hermann <[email protected]>
Names of QML components should not start with 'Q' and new components
should have a QML_ADDED_IN_VERSION.

Amends commit 9efc1fb.

Pick-to: 6.10
Change-Id: I1044603f7afab3fee92cd84b1a2a84f0564e6a73
Reviewed-by: Fabian Kosmale <[email protected]>
Reviewed-by: Santhosh Kumar <[email protected]>
Previously a RowLayout was being used. But I would argue that it's
better UI to use a SplitView instead.

Add the necessary overrides in QQuickSideBar, so that the SideBar
actually knows it's correct implicit size. This is needed in order for
the SplitView to work correctly.

We want the implicit width to be large enough to cover the delegate with
the most text, with a maximum width of half the available space in the
dialog.
As for the height, we want it to be tall enough to cover all the
standard paths + add favorite button, so that the feature of adding
directories to the favorite list is less cumbersome. The height of the
sidebar should be part of what determines the implicit height of the
dialog.

Pick-to: 6.10
Change-Id: If267d8197e82f8a91a059e31723c46fe95af3d41
Reviewed-by: Mitch Curtis <[email protected]>
It was causing the button to never appear when it should.

Pick-to: 6.10 6.9
Change-Id: I59d13d0e2588536c384fd2c6024dd9f5d7a24274
Reviewed-by: Mitch Curtis <[email protected]>
ReferenceObject and VariantAssociationObject were indented in rather
confusing ways.

Change-Id: I3a4ef04f716609a0b32844bb14e4dfded6a1f2fa
Reviewed-by: Semih Yavuz <[email protected]>
This generalizes the QVariantMap code path.

Pick-to: 6.10 6.9 6.8
Task-number: QTBUG-139025
Change-Id: Ibbdc1da974d3c166474c4bd02fb4c70d8df3e688
Reviewed-by: Semih Yavuz <[email protected]>
Reviewed-by: Fabian Kosmale <[email protected]>
Explicitly finding a private module was not strictly required in Qt
6.9 and older. This patch adds a small demonstration to some snippets,
to show how to find QmlPrivate/QuickPrivate. This might be helpful
for users who're scratching their heads when their previously-working
project now fails to build in Qt 6.10.

Change-Id: Ia8a08d94ea65aa73a44c7a7610d28119582ebf0f
Pick-to: 6.10
Reviewed-by: Fabian Kosmale <[email protected]>
Reviewed-by: Ulf Hermann <[email protected]>
Reviewed-by: Alexandru Croitor <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet