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

❌ Inkane
❌ mitchcurtis
❌ ec1oud
❌ samishalayel
❌ add-uos
❌ SafiM5
❌ diseraluca-qt
❌ wangwenx190
❌ eskilblomfeldt
❌ inharjul
❌ Olivier De Cannière
❌ torarnv


Olivier De Cannière 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.

samishalayel and others added 28 commits March 19, 2025 12:00
Fix QQmlJSImportVisitor to register the scope into its QQmlJSImporter.
This is important to avoid scope duplication.

Before this patch, the implicit directory import that
QQmlJSImportVisitor processes via QQmlJSImporter would create a
duplicate "lazy" scope that reads from the file on disk during
population.

With this patch, QQmlJSImporter will know the current scope and
therefore won't duplicate it during the implicit directory import.

Add a test to qmlls to make sure that it can lint enums correctly, even
if the enum declaration does not exist on the on-disk version.

Avoid warnings while resolving scopes by marking the currently to be
populated scope with the '$InProcess$' baseTypeName. It will be
populated (including with its real base type name) after the import
were processed.

Pick-to: 6.9 6.8
Fixes: QTBUG-134781
Change-Id: I05cc8f8cab9279ee07c4a48a1b467738354e11dd
Reviewed-by: Fabian Kosmale <[email protected]>
Change-Id: I4c165669390a79b77582afb331418d7e8d974a1b
Reviewed-by: Qt Submodule Update Bot <[email protected]>
The mouse position is no longer initialized to (qInf, qInf) after
qtbase 209a2145f94e99f99832c3a08cdf579d8f42ca55.

It wasn't really right to test equality of infinity here anyway:
that's what qIsInf() is for.

Amends 6bda8fc

Task-number: QTBUG-134878
Task-number: QTBUG-134718
Task-number: QTBUG-125906
Change-Id: Ice36465ec7eabbaa25b05958118cd5a56c1d7d5c
Reviewed-by: Fabian Kosmale <[email protected]>
If the start point and end point are equal, we will end up with
a divide by zero later.

df97b6b2de6282bd6422f1e531a42475dadc980d in Qt Base added an
assert which detected this.

Fixes: QTBUG-134664
Pick-to: 5.15 6.5 6.8 6.9
Change-Id: Ifc00d988713b8495942a1445e69d35c44605dcbc
Reviewed-by: Eirik Aavitsland <[email protected]>
It was missing ".y", and so it was trying to add a point to a float.
For some reason that results in a string, which becomes NaN and
triggers an assertion failure after
df97b6b2de6282bd6422f1e531a42475dadc980d.

Pick-to: 6.5 6.8 6.9
Change-Id: If1346b66c0cdc8b4fa15cb06fc00ed168c3b8f1c
Reviewed-by: Fabian Kosmale <[email protected]>
Pick-to: 6.9 6.8
Change-Id: Ief62d5f49e730ef8e82bf8690b91c3a633cabd59
Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
The method is a bit unreadable and getting unwieldy, split it in 2.

Change-Id: I8935bf0f07c66d1a55e3d778ccee8f13fcf28e8c
Reviewed-by: Ulf Hermann <[email protected]>
Reviewed-by: Fabian Kosmale <[email protected]>
This is a preparation task for QTBUG-119890 that should make writing
tests easier for the new warnings to come.

Task-number: QTBUG-119890
Change-Id: I87b353ae623ad42ae2ea3f0439636ae752f64783
Reviewed-by: Ulf Hermann <[email protected]>
Reviewed-by: Fabian Kosmale <[email protected]>
Add a warning about variable redeclaration for 'let' and 'const'
variables: they are not allowed in JS.

Fixes: QTBUG-127107
Pick-to: 6.8 6.9
Change-Id: I44ba50e436b0b396a089bc8aedcef31d5455e48a
Reviewed-by: Fabian Kosmale <[email protected]>
Reviewed-by: Olivier De Cannière <[email protected]>
Newer CMake versions no longer allow reading the LOCATION property, as
it doesn’t work with multi-configuration generators. Instead, the
$<TARGET_FILE> generator expression should be used to correctly resolve
the target file.

Ref: https://cmake.org/cmake/help/latest/release/3.0.html#deprecated-and-removed-features

Amends: b1134ac.

Pick-to: 6.9 6.8
Change-Id: I69b5625ca4ff641049c4b819e12651829d64b44f
Reviewed-by: Alexey Edelev <[email protected]>
Reviewed-by: Alexandru Croitor <[email protected]>
Pressing one Button and then another, on a touchscreen, should not cause
either Button to emit pressed() twice.

tst_button.qml's test_multiTouch() now counts the pressedChanged and
pressed signals separately.

Pick-to: 6.5 6.8 6.9
Fixes: QTBUG-122043
Change-Id: I2f353ebc29900f9cfba5e71425022473d3a32a26
Reviewed-by: Bartlomiej Moskal <[email protected]>
Reviewed-by: Mitch Curtis <[email protected]>
It's effectively the same.

This invokes the deterministic (and slower) hashing of strings inside
the QShader hasher. One hopes that the cost of the slower string hashing
is amortized by the number of calls to QSGRhiShaderMaterialTypeCache's
own qHash() function.

Change-Id: I6d257bb646c5b17a48dffffdb3977b5abca79ca1
Reviewed-by: Laszlo Agocs <[email protected]>
QQuickIconImagePrivate::updateDevicePixelRatio is called for named
_theme icons_, which ensures that the DPR is respected for icons coming
from a theme defined by an index.theme file. However, since a named
icon created through a _platform icon engine_ is loaded through
QQuickImagePrivate::setImage, it bypasses QQuickImageBase::loadPixmap
which would call updateDevicePixelRatio.

Fix this by setting the image's devicePixelRatio member before calling
setImage.

Fixes: QTBUG-133424
Pick-to: 6.8 6.9
Change-Id: Ibaf3d96ebcad6d0b99cd5802801bbf40d2c13e25
Reviewed-by: Shawn Rutledge <[email protected]>
Reviewed-by: Christian Ehrlicher <[email protected]>
This patch updates qtdeclarative examples to use
SDK 35 as a target and compile version SDK.

Task-number: QTBUG-130285
Task-number: QTBUG-129461
Pick-to: 6.9 6.8
Change-Id: Ie11f8bebff7dfeb4c1a87c07826f9e9ef0f78d4b
Reviewed-by: Rami Potinkara <[email protected]>
Reviewed-by: Assam Boudjelthia <[email protected]>
After bumping the Android compile and target versions to 35,
disable edge-to-edge feature that arrives with Android 15, because it
will be easier for users to work with this for now.

Later we'll add support for edge-to-edge feature.

Task-number: QTBUG-134880
Pick-to: 6.9 6.8
Change-Id: I8d703c6c6b925a39da9ac8ea6a3d23eaa9b3c3a0
Reviewed-by: Assam Boudjelthia <[email protected]>
This reverts commit 85f8076.

Reason for revert: The change is wrong, Clang is producing False Positives:
- llvm/llvm-project#126041

See https://eel.is/c++draft/except.spec#6, which clearly states that a
defaulted SMF is "noexcept(auto)".

Pick-to: 6.9 6.8 6.5
Change-Id: Icca3a4be990215ef80e5595d7b84e25ec3051f53
Reviewed-by: Fabian Kosmale <[email protected]>
As it stood, the background delegate of a Menu would draw its
drop shadow on the outside of the delegate, and therefore also
on the outside of the Menu as a whole. This works fine for
Popup.Item, since an Item is allowed to draw out-of-bounds. But
for Popup.Window, this would fail.

Instead, the correct solution in this case is to draw the shadow
_inside_ the delegate, and instead make the whole menu bigger by
adjusting the insets instead, to take the shadow into account.

In order to be able to do this, we also need to teach StyleImage
to optionally draw the shadow inside the bounds.

Pick-to: 6.9 6.8
Change-Id: I306e511abca44f4f86ee18a16740f679cf987ac1
Reviewed-by: Doris Verria <[email protected]>
The style declares many dynamic properties that are meant to be
private and not available eg: from code completion. Use __ to hide them.

Pick-to: 6.9 6.8
Change-Id: Idf132a71cacad6ddff951bc378101f1d094112f5
Reviewed-by: Richard Moe Gustavsen <[email protected]>
The style declares several QML dynamic properties which are meant to be
private. Hide them using __ convention.

Pick-to: 6.9 6.8
Change-Id: I4317d2ee7072a72fda1736fc8c9165a980889d95
Reviewed-by: Richard Moe Gustavsen <[email protected]>
After the previous optimization of the animation handling, the scene
grabber used a fixed timeout period without afterRendering() signal
before grabbing to test for stabilization. However, certain scenes can
be continuously rendering even though the content does not change, and
so the grabber would never get to grab for a second time, and so never
judge them stabilized.

Fix by forcing a grab after approx timeout period.

Change-Id: Ia3a05c3020e2f4df1e9bb87f6a0409a0ad68bbbd
Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
Change-Id: Ib83c8d3452d5a0521295750f068f429b414da6ff
Reviewed-by: Fabian Kosmale <[email protected]>
Implement the ErrInvalidEnumValue complaining about enum keys being
lowercased or duplicated. Change the warning message as the Qt Creator
code has a comment indicating that the message should be changed.

Task-number: QTBUG-129307
Change-Id: If0b72eab38124453f90eb9a52e126bf9f24c83b7
Reviewed-by: Olivier De Cannière <[email protected]>
Ensure that they're auto-tested, which would prevent issues like
QTBUG-128520 when combined with failOnWarning, which will be done in a
follow-up patch.

Pick-to: 6.8 6.9
Change-Id: Ib773dd2780e8ffe0a554852bd20ef20a4ab65c1a
Reviewed-by: Santhosh Kumar <[email protected]>
Task-number: QTBUG-98718
Pick-to: 6.8 6.9
Change-Id: I24e641952ca4570f85928c53fb9752a595d50122
Reviewed-by: Santhosh Kumar <[email protected]>
Allows specifying a subsection of the defined path to be displayed.
This mirrors the recently added trimmed() method of QPainterPath.

[ChangeLog][QtQuick][Shapes] Add path trimming functionality

Change-Id: I76371832df07cbab9d81a557b25a6fd53150630e
Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
There are many places in QmlFormat (DOM in general) relying a lot on the obscure side-effects. toUpdate member of PendingSourceLocation is one of these.

Typically the data behind it gets re-assigned under not so clear conditions in the `LineWriter::commitLine`.
This commit removes this member and simplifies all the upstream usages of it.

Unfortunately because the details are somewhat fuzzy and requires more research, this change is mildly risky, relying mostly on the existing tests, which seem to be passing fine.
Therefore it's open to the discussion whether it's OK to take this risk or better not.

Change-Id: Ia3ea68cd0afc44f1e8dbb35163ad29211c884b5b
Reviewed-by: Sami Shalayel <[email protected]>
We don't explicitly link against both, which avoids C++ level UB. But
if the class name is exactly the same, the metatype system is unable to
discern them. That in turn means that the meta-type based valiadion code
in QML breaks.

Fixes: QTBUG-135039
Pick-to: 6.9 6.8 6.5
Change-Id: Ib9c92511fd8eb7de9dcbef2c997b45cf76572a08
Reviewed-by: Ulf Hermann <[email protected]>
Part of the HDR story is loading images that contain pixel values in
bigger ranges than between 0 and 1. QQuickDefaultTextureFactory and
QSGPlainTexture automatically converts QImages to RGB(A) 32-bit and
textures to RGB(A/X) 8-bit, which are non-floating point based. This
change adds support for the additional formats required, which are 16
and 32 bit floating point. It will fall back to 16 bit fp textures if
RHI does not support fp 32, and down to the default 8 bits if fp 16 is
not supported either.

Task-number: QTBUG-126035
Change-Id: I6366f04af26126978e087301108af020749bae54
Reviewed-by: Tor Arne Vestbø <[email protected]>
Reviewed-by: Laszlo Agocs <[email protected]>
SafiM5 and others added 30 commits April 22, 2025 15:10
QDoc generates warnings for images that do not have alt-text associated
with them. Alt-text is used to add context to images for users who use
screen-readers.

This patch applies alt-text to images in the QtQuickDialogs module that
do not have any alt-text associated with them.

Fixes: QTBUG-135123
Pick-to: 6.9 6.8
Change-Id: Iff2fd3350d72e3bc986caefe2ca1977858890f05
Reviewed-by: Oliver Eftevaag <[email protected]>
QDoc allows positioning some amount of documentation under certain pages
by use of the "\relates" command.

The "\relates" command takes an argument that represents a name and
tries to find where the documentation should be positioned in the
output, based on that name.

When the provided name doesn't refer to anything that QDoc is aware of
in the current project, a "proxy page" will be created to hold the
documentation.

The "qqmlintegration.h" header is documented as an header and its
generated page was intended to be used to collect the documentation for
a series of elements that the header exports.

Nonetheless, while the header page itself was created while, the
elements that were intended to be collected where insted positioned
under a similarly named proxy page.

The issues stemmed from the "\headerfile" command using the
"<qqmlintegration.h>" name to refer to the header and the relevant
relates command using the "qqmlintegration.h" name to refer to the same,
with the two names differing in the usage of the surrounding angle
brackets.

To avoid creating a proxy page, and instead correctly collecting the
relevant documentation under the header documentation page, the name
usage was synchronized by changing the relevant "\relates" command to
refer to "<qqmlintegration.h>".

A similar issue existes for the "qqml.h" headerfile and a similar
solution was applied to solve the issue.

Pick-to: 6.9 6.8
Fixes: QTBUG-136037
Change-Id: I3bf1aa97648c0a94acb7a0de5f5fbbaeb6a81c7b
Reviewed-by: Sami Shalayel <[email protected]>
Unlike most other styles the macOS style didn't initialize QQuickTheme
with a style specific palette (either directly or via a custom theme
class).

Instead, we would indirectly pick up the platform theme palette when
QQuickStylePlugin::createTheme called QQuickStylePrivate::readPalette
to read palette settings, as we then default-constructed a QPalette,
which picks up its colors from QGuiApplicationPrivate::app_pal, which
in turn is based on platform theme palette, via QGuiApp's basePalette.

However QQuickStylePlugin::createTheme only initialized the System
palette of QQuickTheme, which meant that we failed to use any role
specific palettes that the platform theme provided.

In addition, because we only initialized the palette once, when
creating the theme, we failed to pick up any changes to the platform
theme's palette.

To fix this we simply tell the QQuickTheme to prefer
the platform theme for its palette, which means any query to the theme
will go through the platform theme. This also means we don't need to
hook into QtQuickControls2StylePlugin::updateTheme() to re-initialize
the palette.

Technically we do have the same problem with the theme's fonts, but for
that we don't have a way to instruct the theme to use the platform theme.

Pick-to: 6.9 6.8 6.5
Change-Id: I56eb278a80b184397114282839e958d61bd0028e
Reviewed-by: Shawn Rutledge <[email protected]>
Reviewed-by: Doris Verria <[email protected]>
Instead of manually observing the effectiveAppearance in the Mac
style we now propagate the colorScheme change signal, which lets
us update the style in lock step with the theme changes in QtGui.

Pick-to: 6.9
Change-Id: I459d47f722a26323f3b3a1f0e8b803b0058d0e7a
Reviewed-by: Doris Verria <[email protected]>
Reviewed-by: Oliver Eftevaag <[email protected]>
These should degenerate to straight line if any of the radii
are zero.

Task-number: QTBUG-135387
Change-Id: Ibd90c1bfe691b6bdeea968aaac1355bc5ea8de2b
Reviewed-by: Eirik Aavitsland <[email protected]>
Add a command line parameter to print the qmlls version, required by
qmlls clients to check the version of downloaded qmlls binaries.

Fixes: QTBUG-132692
Change-Id: I7903f6859b6da2f3849a899e46fe4c5ce1cf4c42
Reviewed-by: Ulf Hermann <[email protected]>
Reviewed-by: Fabian Kosmale <[email protected]>
Qmlls makes QQmlJSImportVisitor re-create a QQmlJSScope when a file gets
updated. It turns out that QQmlJSImportVisitor only works correctly when
used on an empty scopes, methods like rootScopeIsValid() don't work
correctly if the scope is not empty.

Therefore, reset the scopes before making QQmlJSImportVisitor run on
them. Make sure that the internalName and the moduleName are still set.

This fixes a bug where qmlls can't autocomplete an "in-memory" enum
because the import visitor does not set the new enum values in the root
element correctly on an non-empty scope.

Pick-to: 6.8 6.9
Fixes: QTCREATORBUG-32634
Change-Id: If6d620f350215074f87b53bb153363f2dec06145
Reviewed-by: Fabian Kosmale <[email protected]>
8fb643f fixed ComboBox not being
hoverable by setting QQuickApplicationWindowPrivate::control's
hoverEnabled property to true. By doing so, it ensured that only
that control and its parent chain could get hover events, breaking
hover for e.g. background.

The correct fix is to adapt QQuickControlPrivate::calcHoverEnabled
to skip the property("hoverEnabled") == true check for
QQuickApplicationWindowPrivate::control, resulting in it falling back
to the global checks.

- Remove code added in 8fb643f.
- Move QQuickApplicationWindowPrivate declaration into its own header
so that code outside the .cpp file (qquickcontrol.cpp, in this case)
can use it.
- Document behavior of hover flags in
void QQuickItem::setAcceptHoverEvents.
- Move the check done in tst_QQuickControl::hoverEnabledDefault()
into the new tst_QQuickApplicationWindow::hoverInBackground()
since they're closely related.
- Add initial starting position argument to PointLerper's constructor
since it wasn't previously possible to set it.
- Remove unused headers in qquickapplicationwindow.cpp.

Fixes: QTBUG-133886
Fixes: QTBUG-136031
Pick-to: 6.9
Change-Id: Ic32f902be6433c1c9dc9f4610c5715ce1537e605
Reviewed-by: Shawn Rutledge <[email protected]>
The calculation for progress was wrong.

With enough steps moving towards a position that's centered over an
item, this wouldn't have been noticeable. However, with only a couple
of steps, it will fail to reach its target.

Before:

    i=0, progress=0
    i=1, progress=0.333333
    i=2, progress=0.666667

After:

    i=0, progress=0
    i=1, progress=0.5
    i=2, progress=1

forEachStep(1, func) is silly: then there is just one step, so we only
call func(1.0) once, and avoid divide-by-zero.

Task-number: QTBUG-105856
Task-number: QTBUG-136031
Pick-to: 6.5 6.8 6.9
Change-Id: Ia8e37e3810ab3e94a17bab6d40087e521f1abde0
Reviewed-by: Shawn Rutledge <[email protected]>
The argument "-a" passed after "--" was being interpreted as the -a
option of the qml tool itself instead of being passed along to the qml
program as a positional argument.

Fixes: QTBUG-136120
Pick-to: 6.9 6.8 6.5
Change-Id: I602aea84e4766abeb47adce0f739f12315a70b24
Reviewed-by: Fabian Kosmale <[email protected]>
…ode()

There's no reason to use the helper function in QtCore, now that we have
the scheme available from the style hints.

Change-Id: I70063b62f0c359d9c88cf2ba401e4354b6d546c4
Reviewed-by: Tor Arne Vestbø <[email protected]>
Line 68 is using the Qt::QuickControls2WindowsStyleImpl
target, however, it is included after the qt_internal_add_qml_module()
call, and this always cause warning [1] when CMake is configuring.

[1] CMake Warning at qtbase/cmake/QtFindPackageHelpers.cmake:561 (message):
  Could not find target Qt6::QuickControls2WindowsStyleImpl to query its
  package name.  Defaulting to package name
  Qt6QuickControls2WindowsStyleImpl.  Consider re-arranging the project
  structure to ensure the target exists by this point.
Call Stack (most recent call first):
  qtbase/cmake/QtFindPackageHelpers.cmake:620 (qt_internal_get_package_name_of_target)
  qtbase/cmake/QtTargetHelpers.cmake:286 (qt_internal_register_target_dependencies)
  qtbase/cmake/QtPluginHelpers.cmake:290 (qt_internal_extend_target)
  qtdeclarative/src/qml/Qt6QmlBuildInternals.cmake:224 (qt_internal_add_plugin)
  qtdeclarative/src/quickcontrols/windows/CMakeLists.txt:39 (qt_internal_add_qml_module)

Change-Id: I26a430bad89aee96ecb0f0b4610a16b88704121b
Reviewed-by: Mitch Curtis <[email protected]>
Reviewed-by: Alexey Edelev <[email protected]>
Version strings fixed in qtdeclarative.

Task-number: QTBUG-135944
Change-Id: If829e0b430532c38300a461351e80e79665756e0
Reviewed-by: Johanna Äijälä <[email protected]>
Reviewed-by: Topi Reiniö <[email protected]>
Change-Id: I6d2fef4b49a7cc380c9a20e9a84732faff2609f1
Reviewed-by: Qt Submodule Update Bot <[email protected]>
Instead of passing the DPR through as function arguments to each addFoo
function we set the DPR on the QSGInternalTextNode and QQuickTextNodeEngine.
We could have solved this by pulling the DPR from the QSGRootNode's
renderer, but there might be more than one of them, and we're missing
a setDevicePixelRatio in QSGAbstractRenderer (it's only exposed one
level above, in QSGRenderer).

Pick-to: 6.9
Fixes: QTBUG-127913
Change-Id: I48081d441259f0713cdc5f784eede6777b5fb601
Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
Warn about functions used before their declaration. Its not technically
an error like the "var used before declaration" because functions are
"hoisted up" and therefore available even before their declaration, so
create a new warning category for it instead of reusing the "var used
before declaration" category. Disable the warning by default: Qt Creator
used to have it as default, while other tools like eslint don't.

For the same reason, don't warn about functions used before declaration
during codegen, and add a method to warn about it in
CodeGenWarningInterface. The code for "var used before declaration"
can be reused by function declarations by adding a sourcelocation for
function declarations in the "addLocalVar"-call, so make sure to
differentiate between functions and vars by adding an extra member to
Context::ResolvedName.

Task-number: QTBUG-129307
Change-Id: I83a4f8cd00c120db23a0cec3365a00ed44de2836
Reviewed-by: Olivier De Cannière <[email protected]>
Encapsulate the expected warnings into an own struct to prepare for the
test of the context property feature, where warnings are emitted twice:
once without required properties and once once the context properties
were loaded.

Task-number: QTBUG-128232
Change-Id: I0f2e8ac8e94913b0f4d1acba8c07201e7965f7da
Reviewed-by: Olivier De Cannière <[email protected]>
Also add support for popups (when controlstestutils_p.h is included).

[ChangeLog][Qt Quick Test] Added QVERIFY_ACTIVE_FOCUS and
QTRY_VERIFY_ACTIVE_FOCUS macros that can be used to get detailed
failure messages for when QQuickItem::hasActiveFocus should be true but
isn't.

Task-number: QTBUG-133858
Change-Id: I30c67a84ccc16e3969bac5661648d0062bc3d62c
Reviewed-by: Mitch Curtis <[email protected]>
The temporary directory is set as the current directory at the end of
iniTestCase. iniTestCase() returns earlier if the temporary directory
is not empty and this code is never reached.

Set the current directory directory as the temporary directory earlier
in tst_QQuickFileDialogImpl::initTestCase() to ensure that it is
always set properly.

Fix the failing test
tst_QQuickFileDialogImpl::changeFolderViaDoubleClick() on Ubuntu 24

Pick-to: 6.9 6.8 6.5
Change-Id: I9e124280e69c67056e0cc9ce15a1a45b57221cb2
Reviewed-by: Axel Spoerl <[email protected]>
Reviewed-by: Mitch Curtis <[email protected]>
Reviewed-by: Oliver Eftevaag <[email protected]>
- State ownership of returned object for createWithInitialProperties.
- Add missing stuff about contexts.
- Correct another sentence that referred to "m_engine".

Pick-to: 5.15 6.5 6.8 6.9
Change-Id: I1f6e743b0999236844f2666ca638efe75f3f8f0c
Reviewed-by: Olivier De Cannière <[email protected]>
The compiler is very polite and does not tell the user about its useless
code. Codegen::statementList(StatementList *ast) silently discards
unreachable statements during byte code generation.

Warn the user that their code is unreachable. Don't warn about
function definitions because these ones are "hoisted" up,
which means that their definition is supposed to be pushed up, so that
they can be used even if they are behind a "return" or "throw"
statement.

Don't use the qqmljsbasicblock analysis for that, it reports too many
"false positives" where the compiler generates dead code that can't be
fixed by the user.

Task-number: QTBUG-129307
Change-Id: Ia26e8af1adf4e63b26dcaa7fb10be73b7eb084d7
Reviewed-by: Olivier De Cannière <[email protected]>
Amends daf57e2 that recurses into
inline components when checking for required properties that were not
set. We should only check inline components that are base types of the
scope, and ignore all inline components in children of the scope.

Fixes: QTBUG-136008
Pick-to: 6.8 6.9
Change-Id: I8c687ce97b3f2eac699e2fd535193197b5239ada
Reviewed-by: Olivier De Cannière <[email protected]>
We create and increment an iterator and then don't use it...

Amends daf57e2

Task-number: QTBUG-135244
Pick-to: 6.9 6.8 6.5
Change-Id: Ia92df8e7dc337786eba43980364ad03c747ec11b
Reviewed-by: Fabian Kosmale <[email protected]>
Checking required properties had become quite slow, especially on huge
files, after daf57e2.

Immediatelly checking for the presence of a property binding speeds
things up a lot. fluentwinui3/Slider.qml, which reference a 20k line
file, now compiles almost instantly again instead of talking several
tens of seconds.

Amends daf57e2

Fixes: QTBUG-135244
Pick-to: 6.9 6.8 6.5
Change-Id: I4391db27f391b179ad03dabadc910f23fa932037
Reviewed-by: Fabian Kosmale <[email protected]>
Move it next to QQmlJSImportVisitor::checkRequiredProperties and also
make it filter out any scope that isn't of type QMLScope.

Task-number: QTBUG-135244
Pick-to: 6.9
Change-Id: Ibf3fa90ab7db9fcd9811509b5f893aeab4f14925
Reviewed-by: Sami Shalayel <[email protected]>
Amends daf57e2

Task-number: QTBUG-136058
Pick-to: 6.9 6.8
Change-Id: Ibf412089427e4d9d5a568ee24c224b9fa41fd20a
Reviewed-by: Sami Shalayel <[email protected]>
Because we only search for the name of the property in the
scopesToSearch and not which property that name actually references, we
confuse a property of the same name in a neighboring scope for the
actual required one.

Include the property's owning scope when searching through the scopes.

Amends daf57e2

Fixes: QTBUG-136058
Pick-to: 6.9 6.8
Change-Id: I998901fd0840270dd2048e7257d6eaca556b513d
Reviewed-by: Sami Shalayel <[email protected]>
Change-Id: Ia71e88dbd983303c15e532b812550214426d4d6d
Reviewed-by: Sami Shalayel <[email protected]>
The warning suggested calling TextEdit.clear() before loading a
different url if the text is modified, but that actually doesn't work.
But as the `source` property docs say, it's possible to set
`modified = false`.

Pick-to: 6.9 6.8
Change-Id: Ia078269c76be141adb06303163a661927f125bcd
Reviewed-by: Oliver Eftevaag <[email protected]>
Replace separate storage for corner radius and bevel with a single 8-bit
field cornerProperties. The first 4 bits track radius flags, and the
next 4 track bevel flags.

Fixes: QTBUG-134908
Change-Id: Ie2d706112965fc5dde07fa698e32e29695da219b
Reviewed-by: Shawn Rutledge <[email protected]>
Reviewed-by: Eirik Aavitsland <[email protected]>
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.