| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
Task-number: QTBUG-110983
Pick-to: 6.5
Change-Id: I9a664178c91bfa2962e2a5a3bf4bfa174a74a9d0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move the detection into the QtQuick lint plugin. It's mostly meant for
QQC, so let's auto-enable it for attached types derived from
QQuickAttachedPropertyPropagator.
To this end, two new categories are introduced: The Quick lint plugin
gets its own attached-property-reuse category which is synonymous to the
default category of the same name. Furthermore, we add a
controls-attached-property-reuse category for only checking controls.
That one is implied by either of the others.
Finally, fix the id vs. scope resolution to actually do something.
This way we can give appropriate hints when the outer type has an ID
already.
Pick-to: 6.5
Fixes: QTBUG-110834
Change-Id: Ib71a9e3bbc10bac77f36db6cc441af88df20fd33
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
In this form we can expose it in QQmlSA.
Pick-to: 6.5
Task-number: QTBUG-110834
Change-Id: Ieb0cf31b6e86379c0d80f89bc6c63b129f269798
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
If we can't find a member, we don't know whether it's a property.
Pick-to: 6.5
Task-number: QTBUG-110933
Change-Id: Ie7d170f0e1967ac121630afe73e46c514b01e821
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
We use it in three different compile passes, so it should be a member of
QQmlJSCompilePass.
Pick-to: 6.5
Change-Id: Ibc46ceb7ab05839b0a573c8ab3ee2acf4a6de154
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
Pick-to: 6.5
Fixes: QTBUG-110833
Change-Id: Ie766c957a9ebeaea808fdc6904a1caea0e4cb849
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
|
|
|
|
|
|
|
|
|
| |
Those are just as important for modules as for single files.
Pick-to: 6.5
Change-Id: I201d62c61988abc2dfba6300a1cfc355203fec75
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
If a property cannot be found but there are immediate properties in the
surrounding type, that indicates that the construct in question may be
phrased using generalized grouped properties.
Pick-to: 6.5
Fixes: QTBUG-105251
Change-Id: I107132294ba0ca56ff522fc29e7a1972553390bd
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
You should use the id-based generalized group form.
Pick-to: 6.5
Fixes: QTBUG-105251
Change-Id: I42edfb03059d3e8c92bfb3c311bf1ed1af7cf70e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We should generate type checking code for only strict comparison
of var against null/undefined types or vice versa cases. The non-
strict comparison should be handled elsewhere. Removed pragma Strict to
allow to add warning emitting tests of non-strict comparison.
This amends 6a816a9e0dfc2b41a4f86c721679f2517ec27eb6
Pick-to: 6.5
Fixes: QTBUG-110769
Change-Id: I7f9a457e71a621a005f377216e841bec01667454
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Partially versioned imports should not be sorted useing the generic
comparison operators. We have to check each component individually.
Pick-to: 6.5
Fixes: QTBUG-110320
Change-Id: Id75ab73ff6a4b5b040b9fcbb426e6bcf893d3d8b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
And build standalone DOM against Qt 6.5 (beta)
Change-Id: I9395b4932ecdedd28f10d1e791e2abe445516183
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are many ways to "hide" the qmldir from the engine at run time,
which turns singletons into regular types. While all of this is invalid,
we should not assert on it, but rather produce a legible warning.
Furthermore, sharpen the importing of extra modules from qrc as implicit
imports. We should really only import modules the file in question can
ever be part of. Otherwise we needlessly produce the above situation and
hide legitimate warning messages.
Amends commit 7517c1b3ae9aa92f36b19d74a4b2de5e8531309b.
Now we need to teach our tools about the default import paths in the
resorurce file system. They cannot guess any type they may find in any
resource file anymore.
Pick-to: 6.5
Task-number: QTBUG-106929
Change-Id: Ic8c02396d10830a7f461e8a81649bb8c9a1add1f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We are treating global constructor functions as methods. But while they
are callable, they also have properties that can be accessed.
Accessing those should not trigger any warning. However, prior to this
commit, any property access to a method would yield a warning.
As we don't store the list of known properties in the
jsroot.qmltypes, we cannot really validate them. Moreover, it is also
possilbe to extend the prototypes, so it might never be feasible to
generate warnings.
Thus, for now simply don't create warnings for JS globals in
QQmlJSTypePropagator::isRestricted.
Fixes: QTBUG-109204
Pick-to: 6.5 6.4
Change-Id: I992365ea716827a562886d7204b2401062772f9a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
|
|
|
|
|
|
|
|
|
|
| |
Otherwise we later try to perform value type lookups on them. That won't
work.
Pick-to: 6.5
Task-number: QTBUG-110438
Change-Id: I1690a3375841ba5a1ff1a471a7f88bd2023ab4c4
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
QmlImportVisitor has some log messages that is only used for controls
sanity tests. Move these loggers into a QuickControlsSanity plugin.
Move the relevant tests from tst_qmllint to tst_sanity as we link the
plugin to tst_sanity. Also remove qmlControlsSanity category from the
default categories of QQmlJsLogger as it should be only utilised by this
plugin.
Task-number: QTBUG-103276
Change-Id: Iacc624711a2cd00aeb9d89fbde7c0131896d30ce
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Unfortunately value types behave differently when compiled to C++.
Document the difference and introduce a pragma to make them behave one
way or the other.
Pick-to: 6.5
Fixes: QTBUG-109221
Change-Id: Ib2685153c0b4ae209bafbea7a01229377fdb47dd
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We can coerce QDateTime, QDate and QTime into each other because they
would all be represented by a Date object in JavaScript. Furthermore we
can coerce them all to QString. Technically, we could also coerce
strings to all of them, but we don't want to because that is terrible.
Fixes: QTBUG-109380
Change-Id: I176bfb5b715a6a6750cb5918c44261fa23fb8832
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
|
|
|
|
|
|
|
|
|
| |
Pick-to: 6.5
Fixes: QTBUG-104576
Fixes: QTBUG-104632
Change-Id: I9e0919feb04798fb4c5d0c8c0ed2f5cbc7a0b552
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Earlier versions of gcc don't seem to know this warning.
Amends commit 1d72f21415609ce7a8b665a71776d7ac26f1d4ee.
Pick-to: 6.5
Change-Id: If7e78b84b0c3cd2190c33591f0fdc9e677489d66
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
|
|
|
|
|
|
|
| |
Pick-to: 6.5
Fixes: QTBUG-104643
Change-Id: I5ca0fea2ef6f822b70c08bc6e49f0d07a732b299
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GCC 13 seems to have a false positive here:
In copy constructor 'QSharedPointer<T>::QSharedPointer(const QSharedPointer<T>&) [with T = const QQmlJSScope]',
inlined from 'QDeferredSharedPointer<T>::QDeferredSharedPointer(QSharedPointer<T>) [with T = const QQmlJSScope]' at QQmlJSScope.cpp:33:11,
inlined from 'Data::ConstPtr Data::get() const' at QQmlJSScope.cpp:244:37:
/home/peppe/p/src/qt5/qtbase/build/include/QtCore/../../../src/corelib/tools/qsharedpointer_impl.h:296:80: warning: pointer used after 'void operator delete(void*)' [-Wuse-after-free]
In static member function 'static void QtSharedPointer::ExternalRefCountData::operator delete(void*)',
inlined from 'QWeakPointer<T>::~QWeakPointer() [with T = const QQmlJSScope]' at /home/peppe/p/src/qt5/qtbase/build/include/QtCore/../../../src/corelib/tools/qsharedpointer_impl.h:543:60,
inlined from 'QWeakPointer<T>::~QWeakPointer() [with T = const QQmlJSScope]' at /home/peppe/p/src/qt5/qtbase/build/include/QtCore/../../../src/corelib/tools/qsharedpointer_impl.h:543:12,
inlined from 'QSharedPointer<T> QDeferredWeakPointer<T>::toStrongRef() const [with T = const QQmlJSScope]' at QQmlJSScope.cpp:186:16,
inlined from 'Data::ConstPtr Data::get() const' at QQmlJSScope.cpp:244:36:
/home/peppe/p/src/qt5/qtbase/build/include/QtCore/../../../src/corelib/tools/qsharedpointer_impl.h:130:67: note: call to 'void operator delete(void*)' here
This makes qtdeclarative FTBFS in release builds.
Pick-to: 6.5
Change-Id: If7a7565a68a7eaa0770c41e4e7ad1288b460e7ef
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
QQmlJSScope::ContextualTypes::types() returns a QHash by const-
reference, which can't be made rvalue.
qqmljsimporter.cpp:581:71: warning: redundant move in initialization [-Wredundant-move]
Pick-to: 6.5
Change-Id: Ide4dbd0777a44ed0870efffd17394924871c28c6
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
We should be able to compare QObject * with QObject * or a
nullptr.
Pick-to: 6.5
Fixes: QTBUG-109377
Change-Id: I0e9d6fdc89cbb471774d6382316dfb4813310e1d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The code generator currently rejects any comparisons other than
primitive types. Add comparison capability for var types against
null or undefined types and vice versa. To achieve this, we generate
code that fetches the contained object within the variant and
comparison is done depending on the stored type.
Ideally, we also need to add comparison capability for QObject *, that will be handled with QTBUG-109377.
Pick-to: 6.5
Fixes: QTBUG-108632
Change-Id: Ib15450d7922f6025c78def5cc548c74827ad740f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
On 32bit platforms you cannot losslessly convert quint32 to qsizetype.
However, in the places we are facing here, we are only interested in
signed 32bit numbers anyway.
Pick-to: 6.5 6.2
Change-Id: I93a07c2847bd5bfae426dccbb6c0e33c5758442d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the common case that we read a register only once, in the same basic
block, generate a std::move() in order to move it into place.
Especially for QVariants holding large internal objects, this should
help performance.
Fixes: QTBUG-101452
Change-Id: I015892e1046ca7b739dbd296756f3f012dba5f9b
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
We can determine that a binding that looks like a signal handler on
first glance is not a signal handler after all. In that case we should
not warn about it. Furthermore, we don't need to store all the signal
handlers several times over.
Pick-to: 6.5
Fixes: QTBUG-109021
Change-Id: I4b90254faa7644df047f29c98f126977a90f6662
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously all list types used as arguments or return types for methods
had to be looked up via the imports. However, builtin types are not part
of the imports at run time. Therefore, recognize list types already
early on, when generating the IR. This is the same way we do it for
property types and it allows us to easily identify lists of builtins.
Pick-to: 6.5
Fixes: QTBUG-109147
Change-Id: I91fa9c8fc99c1e0155cc5db5faddd928ca7fabbc
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We need to explicitly cast to double if we are wrapping a number type
that's not natively accepted by the ctors.
As a side effect, correctly run conversions from generic QVariant to
QJSPrimitiveValue through the engine now. For that we need another
clause in metaTypeFromJS().
Since we are calling methods that return list types in the test, we need
to add another clause that converts JS arrays to list types. Otherwise
we cannot run that test in interpreted mode.
Pick-to: 6.5 6.2 6.4 6.4.2
Task-number: QTBUG-109111
Change-Id: I87f7aafd24371d2c1ffe85569e1f2cd3a1979742
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
A StoreElement on a JS value can do pretty much anything you can
imagine, after all.
Pick-to: 6.5 6.4 6.4.2
Fixes: QTBUG-109196
Change-Id: Ic638d94b55e6340eb9fe56abc663a6f0f2277f5e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If we try to lookup the length of a generic QVariant, we fail, and so
far crashed. We should ideally detect that we are dealing with an array
(and thus length is a known, available property), but for now simply
reject compilation to C++.
Pick-to: 6.4
Fixes: QTBUG-109164
Change-Id: I9d4149ac09a351754d012dbc829774413d6b32eb
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
CallProperty does not use the accumulator.
Pick-to: 6.4 6.4.2
Fixes: QTBUG-109144
Change-Id: I2bd98bb3a66d68806d250bd50226a8f8e0cdf765
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Allow qmltc to generate handlers for c++-defined signals with const
parameters by changing the safeguard to avoid type mismatch between
slots and signals.
First, remove the qOverload in the generated QObject::connect call to
be able the connect slots and signals with different types (namely,
pass by const references and pass by value should be interchangeable but
is not allowed by qOverload).
Second, save in QQmlJSMetaParameter when types are passed by pointer.
Like this, qqmljsimportvisitor can check if a value type is indeed
passed by value or const reference in a C++ signal. The same for reference
types that need to be passed by (const and non-const) pointer.
Print a message when an type is passed by argument in an incompatible
way instead of letting qmltc generate uncompilable code, which makes the
compiler print out cryptical messages.
Third, add a qqmlcpptypehelpers template that decides if value types
should be passed by value or reference, by letting the c++ compiler
check if sizeof(T) > 3*sizeof(void*).
Fixes: QTBUG-107625
Fixes: QTBUG-107622
Change-Id: I1a00532df591d10f74c1fd00dff5b7fccf40cb22
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
| |
We obviously want to see the defaulted parameters when generating the
handlers.
Fixes: QTBUG-108762
Change-Id: I33a52bac305238467d45650bf8a2ad59d40e366f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
| |
Change-Id: I914ccc09297ac6283d7cf24d5afc96ebdaf294d0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
When checking for default properties, a type may not be resolved (due to
a missing import). So check for that first before checking that the type
is a list property.
Fixes: QTBUG-109197
Change-Id: Idc142588b5d8bc52fdea52d637afc3643e7d9891
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
| |
Task-number: QTBUG-108762
Change-Id: I916ec32329bccfff89a93a57aaca183e3f798197
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* If we got an object type exposed as namespace, we still need to add
the "*" to get its augmentedInternalName(). Otherwise we cannot get
its metaobject, needed to look up enums.
* Enums cannot be shadowed. The shadow check will produce garbage if we
try to check because an enum lookup also does not use the accumulator,
which then contains some artifact from a previous operation.
* If we find a property lookup on a plain QMetaObject* we have to
immediately return in order to not confuse it with attached
properties.
Pick-to: 6.4 6.2
Fixes: QTBUG-109048
Change-Id: If9e3b4806e4d773de9cf48f1b3750b684a8c8f69
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, there were four lists that contained each one entry
for each parameter. There was one list responsible for the names, types,
type names and const-qualifiers but this was quite bothersome to use
(e.g. they not always had the same length).
This commit introduces QQmlJSMetaParameter to
encapsulate all the information required when manipulating parameters.
This reduce the 4 lists to one, making parameters easier to handle
and QQmlJSMetaMethod easier to read.
This is a purely refactoring change, no new functionality was added.
Task-number: QTBUG-107625
Change-Id: Ia41b823c9e6294ee26e828071b802cac6b4058ce
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
| |
The QML engine will helpfully re-assemble our variant if we pass it in
pieces, but we should not rely on this.
Fixes: QTBUG-109005
Change-Id: I35d10b4ee61a0426049986bc6f83d6c880ddc281
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
We generally print a second message to clarify the context anyway.
Fixes: QTBUG-108851
Change-Id: Iba392f2983498ecb1d780034523feab8d9057b84
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
Coverity-Id: 403059
Change-Id: Ic45f749602f4230e8319d0c3d4c262043d2cdad4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The same type can be exported multiple times with different attributes,
even in the same module.
This requires us to fix directory imports as qmllint otherwise complains
about SegFault.bad.qml and SegFault.qml being the same type (which they
obviously aren't).
Task-number: QTCREATORBUG-27590
Change-Id: I295d927b9a07acbb715055a6883ac44b50129c2d
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
isCreatable in qqmljsscope just returns the value of the flag as it was
read from the qmltypes, which is slightly confusing as isCreatable is an
opt-out option.
Instead, isCreatable should reflect whether the type is creatable or not.
A type is uncreatable if and only if it is a singleton, an attached
type, a c++ type with QML_UNCREATABLE and types without default constructor.
This uncreatibility can also be inherited to composite types.
Types without default constructor require QML_UNCREATABLE or
QML_ANONYMOUS, and will be handled in another commit.
Now that uncreatable types can be detected, emit a warning when a singleton
or an uncreatable type is created: up to now no such warning was emitted.
This warning can be seen when using qmllint or qmltc.
By the way, also fix qmltc to not assert when something goes wrong (e.g.
because an uncreatable or singleton type was created).
Change-Id: I9a82106a801d14063407eb4e54858b1ca9fd578b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
We provide semi-private functions in the AOT context for this. Since we
cannot know the complete run time type of the potential logging category
at compile time, we have to check any first argument that might be one
separately.
Fixes: QTBUG-107175
Change-Id: I46a8922b1c5c16d2b450b8728d650d31dfd867e3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Those are not stored. If we compare null to null or undefined to
undefined, we do not have to generate a comparison at all. the result is
statically known.
Pick-to: 6.4
Fixes: QTBUG-108634
Change-Id: I6a5323c2e0c023838609aec90d7ecc15b885dc08
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some enums happen to have an alias, e.g. when an enum is used as a flag, the
enum will exist in two versions, once as enum (e.g. Qt::MouseButton) and once
as a flag (e.g. Qt::MouseButtons). In this case, normally only the flag is
exposed to the qt metatype system and tools like qmltc will have troubles when
encountering the enum in signal parameters etc.
To solve this problem, QQmlJSScope::resolveEnums() will create a QQmlJSMetaEnum copy
for the alias in case the 'self'-scope already does not have an enum called
like the alias.
For the greater picture: this allows qmltc to compile signal handlers
for signals that take enums as argument without asserting, and also is
a step forward to compile the quick/text example with qmltc.
Task-number: QTBUG-107609
Change-Id: I8fcb48a15a2066fb2d2dc89fc26b8441a1a0f489
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add singleton support to qmltc.
Add the QML_SINGLETON annotation to the class, generate a static T*
create(QQmlEngine*, QJSEngine*) method for the engine and also add test
this new functionality.
Fixes: QTBUG-106828
Change-Id: I7b6b39ab0c8a427b3166562c3f04cf4a7eaa20e2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is commonly done for logging. With this in place we can have the
code generator use coerceType() for such constructs.
[ChangeLog][QML][Important Behavior Changes] You can implement custom
toString() methods for your QML objects in JavaScript or in C++. Those
methods don't actually have to return a string. Previously, whatever
return value the method generated was forwarded as-is. Now it is coerced
to a string.
Change-Id: I4a9721a6948be0c24a36b31d453a74bd747db729
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
|