We hardcode them into QQmlJSTypePropagator and QQmlJSCodegenerator for
now. This is OK for builtins.
Task-number: QTBUG-101387
Change-Id: Ifab46083b3a782f009859ce969c283d5bb2b4e8b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The offsetsAndSize member was renamed to offsetsAndSize_s_ recently.
Detect the name change and use one or the other instead of failing.
Pick-to: 6.4 6.3 6.2
Fixes: QTBUG-104523
Change-Id: Ica16a91577fd1d20352e2c8136453432acbbc8b0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Since "/qt" is reserved, we can use "/qt/qml" as the default path for
user QML modules.
[ChangeLog][QtQml] The AUTO_RESOURCE_PREFIX option was added to
qt_add_qml_module(). It places your QML modules in the otherwise
reserved resource directory /qt/qml. This directory is also added to the
default QML import path. By using it you don't have to specify custom
import paths anymore. Specifying neither AUTO_RESOURCE_PREFIX nor an
explicit RESOURCE_PREFIX will generate a warning now because such QML
modules are likely invisible in the resource file system.
Fixes: QTBUG-95145
Fixes: QTBUG-103452
Change-Id: Ie27dec5cbf34ea06258d55c659d202cdd61e54b2
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
In that case we need to allocate extra registers. We already did so
before, but we wouldn't use the registers afterwards.
This works nicely in 6.4 because we have a separate type for each store
operation. Therefore, the original function argument (being of a
different "type") won't be found in the list of local registers. Access
to it falls back on the actual arguments array. Only once we've stored
something into the register that mirrors the argument we can retrieve
it.
Pick-to: 6.4
Fixes: QTBUG-104462
Change-Id: Ibb0315cd2f8a8e4106d39fff88a6097b1623eb48
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
It doesn't write the accumulator, but it does read it. Generating code
for throwing exceptions reveals that we have to default-construct the
return type rather than converting from undefined/void when throwing an
exception.
Pick-to: 6.2 6.3 6.4
Fixes: QTBUG-104447
Change-Id: I0a725679d8ecb7e87bb20528033097bc0c3c7bb6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
It is generally not actionalbe. In QQC2, we mark properties as deferred,
so that users can replace them with their own custom elements.
We however really don't care about the replacement not being deferrable,
as it will be needed in any case (e.g., Control will create its
contentItem and background in componentComplete if they do not exist
yet). Thus, there is zero gain in ensuring that the replacement is
deferrable.
There are cases where this is not the case: You might want to create a
whole new style, and in turn allow users to override elements there. Or
there might be an item where deferring indeed makes sense.
However, we cannot distinguish those cases so far, and as long as that
is the case, we should not confuse users by complaining about a concept
which is mostly engine internal (the only public documentation about
deferred properties is
https://doc.qt.io/qt-6/qtquickcontrols2-customize.html#considerations-for-custom-styles
and that does not mention the word deferred), where fixing the warning
might not even given them any benefit.
Checking that our standard controls do not prevent deferring is better
checked in tst_sanity statically via qmllint.
Pick-to: 6.4
Fixes: QTBUG-98964
Change-Id: I030e2a2c2a1d99c9cc6cf0d892e0a1d17e048b6a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
We accidentally checked the element type instead of the binding type.
Also added some more tests to make sure this doesn't happen again.
Fixes: QTBUG-104430
Change-Id: I5848b937b7bf4b15ad09adbe1d2a3941c4572fb5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Previously these would have not been created properly. This change fixes
this and adds some tests.
Fixes: QTBUG-104197
Pick-to: 6.2 6.4
Change-Id: I3d2d7d5a0e4019d9f7bd3496ea5762d4b7d680cd
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Remove the test to allow integration to work again. A commit will
follow to repair and readd it.
Fixes: QTBUG-104079
Change-Id: I56fbcaee88bca5520da1b3d5ca2c3c47eb3c519a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reimplement tst_qqmljsscope::qualifiedName() to test the versioning
on Qml elements that will never change their versioning information.
Before, this test was testing elements from QtQuick that were subject
to change with every Qt version.
Fixes: QTBUG-104079
Change-Id: I45c18d1a995b1a8aa99dd15d86dfbb26f5666545
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Warn when different types are exported under the same name and
revision.
Fixes: QTBUG-103189
Change-Id: I90258d5fdd7ab531f8093ed2ca871d40d0b68519
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
If there is no QML.AddedInVersion then the component should be available
from version X.0, with X being the current version of the module.
Amends 464abaec05
Pick-to: 6.3 6.4
Fixes: QTBUG-104373
Change-Id: If30b66df384fe815c41d2a0b5ca7b034b9955956
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
If a component is done loading, we don't need the source code anymore.
Dropping it makes it possible to unmap any resources it may be part of.
Pick-to: 6.4
Fixes: QTBUG-86088
Change-Id: Id523fffb788b5ffa60cb1e7b777328c6648c2a88
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
If the attached property can only be used in certain delegates and it's
used in a root component, there's no way of knowing whether or not it
will be used in a valid way, so don't warn about it.
Fixes: QTBUG-104209
Change-Id: I70593ca05473b38e341592fa8a117e0e92c651ec
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Sometimes we use var or Item property types when we actually expect
some very specific types. We warn about these at runtime, let's also
warn in the linter.
Task-number: QTBUG-102859
Change-Id: I68c2bc8b2bf5097723a432d02d76f45651f4ef12
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
qrc cannot handle ".." in paths, so we need to clean our paths in order
to make relative directory imports work.
Fixes: QTBUG-103903
Change-Id: I31386728a7a20c30bd8c087dd3a1f2affc369cf4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Add a tst_qqmlcomponent test dealing with QJSEngine originated
dictionary converted into a QVariantMap. QQmlComponent should be able to
correctly handle such cases
Task-number: QTBUG-101440
Change-Id: I1550dbf28a1ae1eee5473914515f1bf46f8d788a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This way we can determine that QList<qreal> is the same as
QList<double>.
Pick-to: 6.4
Fixes: QTBUG-104129
Change-Id: I96df19da1a613558b950aa6cee46159024c19cc9
Reviewed-by: Evgeniy Dushistov <dushistov@mail.ru>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Those are generally less efficient than what the interpreter would do,
they can have side effects, and they can throw exceptions. We don't want
to deal with any of that. Most of those implicit conversions have
explicit equivalents. For those that don't we can add them.
Pick-to: 6.2 6.4
Fixes: QTBUG-104010
Change-Id: I62898db92219386c94f2a6c9b56f6fb0b7578832
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Now that we have split integration into a separate module, use that
instead.
Also fixes a warning about redefining QML_SINGLETON.
Change-Id: Iad54ac7815957222d64e96342e48bb9eb25be2c0
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Because we run a test, we might have a handler for SIGABRT installed. If
qfatal uses SIGABRT to terminate the process, we will thus actually
handle it gracefully.
Instead, simply check that the process has terminated, and rely on the
output being available.
As we check for "FATAL" in the output, the exit status check was anyway
redundant before.
Fixes: QTBUG-104051
Change-Id: I062a592e97e717cd1a0d93f7913b492aa322296a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 27cc99809d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The old pattern of waiting for window exposure or activation is error
prone. We have this nice abstraction now.
Change-Id: I82a585b5e89941533b910052becddeef9551dceb
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Files that have to be modified by hand are modified.
License files are organized under LICENSES directory.
Pick-to: 6.4
Task-number: QTBUG-67283
Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
The QLocalTime revolution has fixed this.
Pick-to: 6.4
Change-Id: Ieeb21b81bb0c7c8eb811310731e16a7a37b1b1f4
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
MinGW got a crash in tst_qqmlqt::dateTimeConversion(), due to the test
neglecting to verify that component.create() had succeeeded, when
various plugins were missing.
Pick-to: 6.4
Change-Id: I6ed5df864b78c689f3c572875115e4eea14748ca
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Split a long line, only emit an error message if there is one.
Also remove the QTimeZone include: a recent change eliminated the
dependence on it. (The #include should in any case have been #if'd on
feature timezone.)
Pick-to: 6.4
Change-Id: Id8208b39927c0324597d2008061c48958a7cbbdb
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
It's easier to see which flags are being set this way.
Pick-to: 6.4
Change-Id: I5ed7e9bcedacde19cb751512d404a872981f6eb0
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
V4's ES-compiler warns about assorted variables in the ES-262
test-suite being used before declaration. We aren't about to fix that
test-suite, so the warnings are just noise to us. As there are many of
them, they overflow the QTestLib logger's -maxwarnings threshold,
causing actually relevant messages (like test failures) to be lost in
the output.
Install a trivial QLoggingCategory::CategoryFilter to filter out
warnings and debug for the qt.qml.compiler category (and all
sub-categories of it). Condition this on a define so that someone who
actually wants to see those warnings can turn them on.
Pick-to: 6.4
Change-Id: If7decc241b407e816f5d7979b32f31a9f614d30f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
The JS-tests produce so much output that it routinely surpasses the
maximum number of debug messages testlib is willing to produce, after
which it cuts off and we don't get to see the output of failing tests,
which we actually need to see.
Add a logging category, just for this test, and condition the boring
bits on this category being enabled. Those are all qCDebug()s, so
disable the category for debug by default. In the process, re-enable a
commented-out qDebug() by converting it to use the new logging
category (and fixing the bit-rot that it had suffered while commented
out).
This should mean any future Coin failures in this test are reported
more usefully. If seeing all the PASS lines is really important to
you, enable category "qt.v4.ecma262.tests" in your Qt logging options
and pass -maxwarnings with a huge value when you run the test.
Pick-to: 6.4
Change-Id: I8ba1f6575120fcef533ae756d31cc40635c13370
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This puts all use of system time_t functions in one place, instead of
spreading it out. Its implementation improves on what was formerly
done in V4 Date's offset calculations, while simplifying them and
eliminating most of the #if-ery.
Add four more test-cases to tst_qqmlqt::dateTimeConversion(), based on
issues seen on MinGW, getting the time-zone wrong due to the failure
of localtime_r(); MinGW can use localtime_s, as QLocalTime now does.
Revised tst_qqmllocale::timeZoneUpdated()'s conditions. The
QEXPECT_FAIL()s have stopped triggering, at least on Darwin, and the
issue isn't that Date.timeZoneUpdated() wasn't working, it's that (now
only on Android and Windows) we don't have a way to set the system
time-zone referenced by the system functions that QLocalTime calls to
get time-zone offsets. Setting the TZ environment variable only works
on faithful POSIX implementations.
Pick-to: 6.4
Fixes: QTBUG-85149
Fixes: QTBUG-95993
Fixes: QTBUG-102971
Change-Id: I7bc983b9fd7167e3bab3db41dbc1c6f4a78665b9
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This is not valid QML, and the generated code crashes.
Pick-to: 6.2 6.4
Fixes: QTBUG-104092
Change-Id: If609acc2f2dc84a2e8f7c26d4d1b6c626f337cad
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
We need to generate isList properties for those, so that qmlcachegen and
qmllint can handle them.
Pick-to: 6.4
Fixes: QTBUG-104129
Change-Id: I7e632279a605694c2fd5f583c8a6dcf9968eb634
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
There is an apparent problem in certain cases where using outer context
to fetch ids is invalid: the outer context is the *outermost* context,
meaning that if a type has a derived type in another QML document,
the derived type would place its own context as a QQmlData::outerContext
As a simpler solution, just remember the document's context in all the
objects within this document. This automatically works in derived types
since they appear in other documents with separate contexts
Pick-to: 6.4
Fixes: QTBUG-103956
Change-Id: I29420ff4962b485502d87b2d2ac2f89b9e0f5736
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
This symbolizes the last piece of QmlIR dependency that qmltc has.
We do still have some implicit dependencies on QmlIR, though, but
that should go way once the remaining prototype code's logic is
migrated to QmltcVisitor, QQmlJSScope and friends. This, however,
is not attempted here as the patch itself is rather large
In the process of switching to QQmlJSMetaPropertyBinding, observe
and fix issues in QmltcVisitor and surroundings
Pick-to: 6.4
Change-Id: I752b68a7f57baf354de16dc0bb466a3f693a4e49
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
The logic is misbehaving on multiple occasions. For instance,
same-named signal handlers in different scopes and script bindings
inside array scopes were wrongly handled. Fix that by revising
the mechanism of inner function computation
As a drive by, fix parseLiteralOrScriptBinding() to distinguish
translation bindings from script bindings (they are vitally
different now)
Extend the script calculation test in tst_qqmljsscope to cover
the findings
Pick-to: 6.4
Change-Id: Ic4cf0a4539f0d714a416b61f4635eb6494e89922
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Follow the policy of "good" QML modules where the module would reside
in a folder named the same way as the module URI
Somehow this is still not enough to remove an explicit
"-i <own qmldir>" workaround in qmltc compilation command
Change-Id: If1725ec03baf3690bb6cb8fc7876b082a155eaa2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
If the element type is unknown the list type is also unknown. This will
happen if we cannot resolve the type.
Fixes: QTBUG-103920
Change-Id: If1b05d99a1e64961981b5adb3974a51c11e776d2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
We can get into situations when binding creation is problematic
due to the relevant scopes being yet unresolved. In particular,
this happens when processing attached/group properties script
bindings
Avoid having this situation by postponing the actual binding
setting until after the relavant scopes are resolved (mainly,
the binding owner). However, do relevant AST order dependent
operations beforehand to avoid accidental errors
This commit amends 25098b7a4f
Fixes: QTBUG-103897
Change-Id: I671955dbe321d03e5f1ab9891cc79dc0a936deda
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Group scopes may be value types so they require access semantics
different from a default value
Ordinary scopes and attached scopes seem unaffected, only groups
are thus covered with an extra logic
Change-Id: Ia9012548a602ca7ca07296491d27a295f4455f91
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Whenever working with properties (reading, writing, aliasing, etc.)
of the type that has extensions, prefer the same-named properties
from extension objects over type-owned properties (this is the internal
QML mechanism)
To achieve that, we need to query the extension object:
* for Q_GADGETs use a dummy model of assuming we can cast the object
to the extension type and use that
* for Q_OBJECTs use a qmlExtendedObject() with additional logic of
figuring out which extension should be picked in each specific case
Create QQmlProxyMetaObject via a custom dynamic meta object API for
qmltc-compiled objects that are derived from base types with
extensions
Task-number: QTBUG-91956
Change-Id: I5e783768ae2abdb9dddf894de7e79960244352bd
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This is de-facto how it always was before
ff0b9ec6bf. As we plan to revert back to
the "original" behavior, document the FINALity of the properties so that
users know how it behaves (and we could not be held responsible for this
mess)
Change-Id: I4afed215fd66875821b7ce8d824b81782388324b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
As we can store sequence types in QJSValue, we should be able to
retrieve them, too.
Move the declaration of the QV4::Sequence struct into a header to make
it less of a hassle to identify sequences.
Change-Id: I3e45bfe193c669107f90cd6c502765c0c9f60fb0
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
[ChangeLog][CMake] The qmltc compilation functionality provided by
qt6_target_compile_qml_to_cpp() is merged into qt6_add_qml_module()
command and is available through ENABLE_TYPE_COMPILER argument. The
qt6_target_compile_qml_to_cpp() function does nothing and is left
only to highlight that users must migrate away from it.
Fixes: QTBUG-100215
Change-Id: Ie7d6b82564dff86176194fce35039ba0d93c0977
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This reverts commit ff0b9ec6bf.
Reason for revert: QTBUG-103881
Change-Id: I7e333ec854e81fb06f1f84b77125edc78bb181e6
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
If the debuggee somehow manages to ignore our kill signal, the QProcess
dtor will hang. Let's rather crash in this case, so that we see when it
happens.
Task-number: QTBUG-101678
Change-Id: Idc72412925244acfdb1dfdeec07369d5fb271080
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
URLs with two slashes after the colon are generally _not_ local as they
contain an authority. However, file URLs with two slashes are
interpreted as "special" paths by QUrl::toLocalFile(). Therefore, we
accept them.
URLs without slashes after the colon can be local files. They denote
relative paths or special android resources then.
Pick-to: 6.2 6.3
Fixes: QTBUG-102944
Change-Id: Iaab3d7501b631e88ee8c1d93f1de8149ba60a5c4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
In JavaScript the [] operator on strings returns a string. QString's
operator[] returns a QChar, but we can easily create a string from that.
Fixes: QTBUG-103371
Change-Id: Id5c960f00ecc7a5dfe30ccbcaac3ffb2a30308b9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>