Commit Graph

3453 Commits

Author SHA1 Message Date
Andrei Golubev ff88fb0c82 qmlcompiler: Support attached property bindings
Extend group property binding creation with attached properties case

As a drive by, add extra attached property tests for QML and qmltc,
covering the case where an attaching type exists in both base and
derived types

Task-number: QTBUG-102082
Change-Id: I6c0d2b941da72d6dab7fc05a4f7b2a7875423ef0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-04-22 10:38:16 +02:00
Andrei Golubev 32b574314d qmlcompiler: Create group binding in group property syntax case
Cover the following case of binding on a group property:

Type {
 group { foo: 42 }
}

Task-number: QTBUG-100168
Change-Id: I0147c74dffb649907457d5f17a2ab29473101a6d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-04-22 10:38:16 +02:00
Andrei Golubev e739df5fcf tst_qqmljsscope: Cover a more sophisticated group property case
Document (via test) what happens when we re-assign a group property in
the derived scope

Introduce a QML test module along the way used within the test

As a drive by, add all QML test files to TESTDATA

Change-Id: Id4c3e20e45b8e0f3757840c87e0285f8516319a8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
2022-04-22 10:38:16 +02:00
Maximilian Goldstein fc3f4e5834 qqmlsa/PassManager: Add method for checking whether module is imported
Adds a method to the PassManager to check whether a QML document has
imported a particular QML module.

This is important as a lot of linting passes only need to run when a
certain module is present and can be skipped otherwise.

Checking for the module is accomplished by adding an invalid
$module$.<URI> scope to the imported types generated by QQmlJSImporter.
This means that not only direct imports but also indirect imports caused
by a qmldir import line will be properly detected.

Change-Id: I341f916a43c60d373d205b5571104d5c5a533d61
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2022-04-21 21:04:01 +02:00
Sona Kurazyan 6bb384d67c Replace uses of deprecated _qba with _ba
Task-number: QTBUG-101408
Change-Id: Ie4d6d8f92241a546c9c6507a0fbb27035661d33a
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2022-04-19 16:39:07 +01:00
Ivan Solovev d141804e6f Android: enable tst_qqmlextensionplugin
The test was extracting plugins from the installation directory.
However on Android plugins can be read only from APK's libs subdir.
By default no plugins are copied into the APK, because they are not used.
So add a dummy.qml file which uses some basic stuff from Qt.Quick and
Qt.Quick.Controls. This will force the plugins to be copied into the APK.

Fixes: QTBUG-100169
Pick-to: 6.3 6.2
Change-Id: I31d7a407c655e19f147d461a083f27d6f6cbda72
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-04-19 17:39:07 +02:00
Andreas Buhr b7fd8ab10b Fix tst_qv4debugger on Android
tst_qv4debugger::conditionalBreakPointInQml() failed on Android
because dependencies were not available.
This patch moves qml code from strings to file, thus exposing it
to the build system. This way, the build system can take care
of the dependencies.

Pick-to: 6.2 6.3
Fixes: QTBUG-102416
Task-number: QTBUG-101865
Change-Id: Icd6ef43a45642f68e749137a963ee2ebfe462bce
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-04-13 13:56:51 +02:00
Ulf Hermann 45dcac12e5 QML: Reset the binding name when synthesizing components
The binding that creates the element inside of a Component has no name.

Pick-to: 6.2 6.3
Fixes: QTBUG-101655
Change-Id: Ib2ff272cff4f21efb588553d55d1e348e2ee5f87
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2022-04-11 19:37:20 +02:00
Ulf Hermann ec79af7396 DelegateModel: Use actual bindings for required properties
Tracking the change signals is brittle and error prone. We have bindings
for this case. Let's use them. We can construct a synthetic
QV4::Function that contains its own QQmlJSAotFunction. In order to pass
the property index to the function we generalize the "index" property of
QQmlJSAotFunction to contain any extra data the function may want to
use. If there is no compilation unit, we pass that instead.

Fixes: QTBUG-91649
Change-Id: I0758bcc4964a48c6818d18bfb0972e67dbc16a1f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-04-11 14:12:09 +02:00
Ulf Hermann 5fdb88bcc1 QmlCompiler: Fix scopeObjectDestruction test case on android
Apparently we cannot close the dialog anymore once it has been opened.
Use a non-native dialog instead.

Pick-to: 6.2 6.3
Change-Id: Iced08fe83fcaa9890d002cf91f73987c1ee97a95
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-04-11 12:12:09 +00:00
Andreas Buhr f9bc831600 Repair tst_qqmltypeloader on Android
Task-number: QTBUG-101865
Pick-to: 6.2 6.3
Change-Id: Ie51831f6047653ec6bb97fedff0bc46a078ae525
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2022-04-07 14:41:33 +02:00
Ulf Hermann 388ccd7b6f QmlCompiler: Allow retrieval of descriptive name from invalid types
Apparently we do that somewhere. It should not just crash.

Pick-to: 6.2 6.3
Task-number: QTBUG-102147
Change-Id: Id612e0543d8794aa4f334a899b117142b7a8cd38
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-04-07 00:18:12 +02:00
Fabian Kosmale 8e867653d8 QQmlApplicationEngine: Add a more convenient error signal
In Creator's hello-world QML example, we currently have to do quite some
unhandy logic to check whether creation failed: Connect to
objectCreated, and then check whether the object is nullptr in a
lambda.
Provide objectCreationFailed as a more convenient alternative for when
we are only interested in the error case, and do not want to do anything
with the created object.
This allows simplifying the hello world example to a simple connect of
the new signal to QCoreApplication::quit.

[ChangeLog][Qt Qml][QQmlApplicationEngine] Added objectCreationFailed
signal as a more convenient way to check for errors than objectCreated.

Task-number: QTBUG-47996
Change-Id: I6513bf726807de183a604e03379e65515e090ccc
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2022-04-06 21:18:20 +02:00
Ulf Hermann 8a229c38fb QmlCompiler: Analyze type conversions before reads in basic blocks
The type conversions happen before the value is read. Therefore, we need
to record them in this order. Otherwise, we may lose a type conversion
if the instruction writes the same register as it reads.

Fixes: QTBUG-102281
Change-Id: Id63a69f86af90c8dc987c0301db3958322c006a1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-04-06 17:12:50 +02:00
Ulf Hermann a55299615f QmlCompiler: Fix string-to-bool conversion via QJSPrimitiveValue
We had a typo in there.

Pick-to: 6.2 6.3
Fixes: QTBUG-102309
Change-Id: I11eb9d35fde3b92d2e48e845740379e10c53774a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-04-06 17:12:41 +02:00
Andreas Buhr e0e4cfca95 Property include test data for tst_qqmlenginecleanup
tst_qqmlenginecleanup uses test data, but in was not properly
included. This patch includes it. tst_qqmlenginecleanup does not
work after this patch, so further repairs are necessary.
But this is a required step.

Task-number: QTBUG-101865
Pick-to: 6.2 6.3
Change-Id: I4739036249565ce6b78adff8f394436d184d9ae8
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-04-06 13:07:34 +02:00
Ulf Hermann 0b63f3b66d QmlCompiler: Respect qualified property types
Factor out the name construction routine duplicated all over the place
and apply it to all places where it was missing.

Fixes: QTBUG-102147
Change-Id: I7c93b4878cedf3489b978591da8d8dfbb2b98c9b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-04-06 05:02:34 +02:00
Andreas Buhr 377d20ad7c Fix tst_qmltc_manual for Android
tst_qmltc_manual did not find its test data. This patch
fixes it.

Fixes: QTBUG-100018
Task-number: QTBUG-101865
Pick-to: 6.2 6.3
Change-Id: I5c59937bb20f0ed904d7c1dec6ab543df9aba499
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2022-04-06 05:02:34 +02:00
Marc Mutz 7f349aeb31 tst_qqmllistcompositor: fix -Wdeprecated-enum-enum-conversion
Instead of an unnamed enum, make these extra flags of the correct
type, C::Flag. This is the same technique used a few lines up for
extra C::Group flags.

Pick-to: 6.3 6.2 5.15
Change-Id: I2dd5221f95bfa49c93e9cbf9d8583ac38c24de95
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-04-05 22:57:40 +02:00
Ulf Hermann d425712e93 QmlCompiler: Allow primitive conversion from any number to bool
Task-number: QTBUG-102281
Change-Id: I0dac4ce9c86c55e52283a6e05b0c3c0cc46551be
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-04-05 14:27:12 +02:00
Andreas Buhr 598bfdb139 Repair tst_qmlcppcodegen on Android
tst_qmlcppcodegen tries to start itself again using QProcess.
This does not work on Android. This patch skips this test.

Task-number: QTBUG-101865
Pick-to: 6.2 6.3
Change-Id: Ib8f9a5e028a938949347bc8e83ea483d0228968e
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2022-04-05 14:12:02 +02:00
Maximilian Goldstein 7c9276d38b qmllint: Integrate plugin infrastructure
Integrates the plugin and pass infrastructure into qmlcompiler and qmllint proper.
Plugins are searched for in the "qmllint" subfolder of the Qt installation's plugin
directory. In addition we also support loading statically linked plugins.

[ChangeLog][qmllint][New Feature] qmllint can now be extended via plugins. Use --plugins
to get a list of available plugins.

Original-patch-by: Fabian Kosmale <fabian.kosmale@qt.io>
Change-Id: I75a09dd978fc7724aca4931f055cc71c7ced971b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-04-05 14:06:56 +02:00
Andreas Buhr 93193747e8 Repair tst_qqmlproperty on Android
tst_qqmlproperty tries to start itself in another environment
using QProcess. This does not work on Android.

Task-number: QTBUG-101865
Pick-to: 6.2 6.3
Change-Id: I8e0410cf315e53899a88cf1b3c9dfba605b7f4d9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-04-05 13:57:56 +02:00
Andrei Golubev 5b63902d5c QQmlJSMetaPropertyBinding:add group type fetching function, extend tests
Change-Id: I754349ab5b6a8125ccc373210fc073dd71583c6f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-04-05 13:57:34 +02:00
Ulf Hermann aea732d607 Avoid copying QQmlJSScope
The factory should populate the pre-existing scope rather than copy it
into place. This way we can detect inheritance cycles involving the
pre-existing scope.

However, now we may detect the inheritance cycles earlier, when
resolving the types inside the lazy loading. We have the right pointers
available there now, after all. Therefore, add a way to propagate base
type errors out of the factory. When clearing the base type, we can now
give a reason for that. When checking the inheritance cycles we
retrieve that reason and log it.

We also remove the special casing of the ScopeType property of
QQmlJSScope. There is no real reason to set it in the ctor. As we
delay the population of QQmlJSScope now, we have to set it later.

Pick-to: 6.2 6.3
Task-number: QTBUG-102153
Change-Id: I49cf6e20f59fbdb6ed98a82040b3b159676f5975
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-04-04 09:09:49 +02:00
Mitch Curtis 6eaef57cd1 Ignore warnings in tst_parserstress::ecmascript()
We only care that the parser can parse, and warnings shouldn't affect
that.

Change-Id: I22bab85dbe6cb2f41640adaaa53cb8c85394773b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-04-04 09:24:54 +08:00
Ulf Hermann c12f0f07f5 QmlCompiler: Improve ambiguous type detection
When detecting an ambiguous type, we need to invalidate the entry in the
list of types, rather than delete it. If we delete it and we get yet
another version of the type, we'll add that one just like it was not
ambiguous.

Furthermore, we cannot check the type name when looking for ambiguity.
The QML name can be bent and twisted in various ways, to import
ambiguous-looking types under different names, so that they are actually
not ambiguous.

Pick-to: 6.2 6.3
Fixes: QTBUG-102153
Change-Id: Iee7951229c5f68b168899e55164e8cf91587eec1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-04-01 20:58:49 +02:00
Mitch Curtis a52fd0fcf3 Fix Connections warning in tst_qqmltablemodel
Declare the signal handlers as functions.

Change-Id: Ie583a123054cbc090245ccc55e7de9ac83397372
Pick-to: 6.2 6.3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-04-01 16:34:10 +08:00
Maximilian Goldstein bc63196948 qmlcompiler: Improve grouped property support
Still lacks support for merging and resolving grouped bindings, but
this will be handled in another patch.

Task-number: QTBUG-100168
Original-patch-by: Fabian Kosmale <fabian.kosmale@qt.io>
Change-Id: I1bb73f383acc3c8512676db47c5944f369b904b7
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2022-03-31 15:49:47 +02:00
Andrei Golubev 1d0ebfb4dd Add QmlModels dependency to LabsQmlModels
Some classes (e.g. QQmlDelegateChooser) depend-on / inherit QmlModels'
functionality. We need to propagate that dependency to QML via qmldir
entry, otherwise we won't be able to see the types in QmlCompiler lib

Note that we already depend more strongly (via linking) on the
QmlModels library, so there is no reason not to depend on the QML
module in qmldir

Pick-to: 6.2 6.3
Change-Id: I4f16f66f2910fb6afd38475cd6ba3209cfd1207d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-03-28 15:16:42 +02:00
Andrei Golubev 765bf6abdb Rework QQmlJSScope::causesImplicitComponentWrapping()
It does not seem correct to be able to use this function for both sides
of binding expressions: the property type and the assigned QML type
(`<property> : <qml type> {}`). Instead, it should really be a function
that considers both sides together (and actually checks the sides
differently!)

What we really should do for the assigned QML type is figure whether
its *first* non-composite base is a QQmlComponent - not just that it
is a QQmlComponent itself. Leave the QQmlAbstractDelegateComponent check
in place since this part is correct

The property itself, on the other hand, seems to cause an implicit
component wrapping if its type is QQmlComponent-derived (which means we
have to check the full C++ hierarchy)

As a drive by, also update QQmlJSScope::canAssign() since it used the
old function internally and was ignoring the case when a to-be-assigned
type lacks a C++ base type hierarchy (e.g. because it does not exist
ahead of time)

Pick-to: 6.3
Change-Id: I23524fa54d45d9140e1cafd9f81ef1f68d95f3a7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-03-28 15:16:35 +02:00
Ulf Hermann 3fd49c82cf Respect invokable toString() methods
We should not invoke the base toString() method if there is an override
in a more specific type. This involves lowering the priority of generic
JS lookups when resolving scope properties, in favor of context and
scope lookup.

[ChangeLog][QtQml] You can now override the JavaScript toString() method
by providing a Q_INVOKABLE method of the same name in your QObject-based
C++ classes.

Fixes: QTBUG-87697
Change-Id: I6190111f4c28e54ce76c391c69c4a921e290e612
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-03-28 10:28:35 +02:00
Ulf Hermann 8398f6990b Eliminate extra event loops from QQmlDebugTest
Extra event loops are famously brittle, and we don't need them here. We
can just us QTest::qWaitFor().

Task-number: QTBUG-101678
Change-Id: I73837bc323c83431f487db3cac6872736635d557
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-03-24 14:33:16 +01:00
Ulf Hermann 185760fa44 V4 ArrayIterator: Protect retrieved value from GC
When constructing the iterator return object, the garbage collector may
run, and drop the element value we want to return.

Fixes: QTBUG-101700
Pick-to: 5.15 6.2 6.3
Change-Id: I60c9b0b9fbb9e784fa089a8b5bb274d02ef7fc1f
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2022-03-24 14:32:51 +01:00
Ulf Hermann cc6bd22b61 Add public API for retrieving the extension object
Change-Id: I28bc1c177cb78d85d844c7a5cd5b6710db8fd65d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-03-23 23:21:56 +01:00
Ulf Hermann 5901fba811 QmlCompiler: Fix a number of warts regarding type lookup
There was a condition missing in qqml.cpp making most type lookups crash
right away. Furthermore, we need to generate code for type lookups we do
need. Finally, the shadow check should skip instructions we don't need
anymore. Shadowing in optimized-out code is not very interesting.

Pick-to: 6.2 6.3 6.3.0
Change-Id: I34e9de7686528b39a35e59c616e4e28b32a6e031
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-03-23 12:29:26 +01:00
Ulf Hermann aff516954d QML: Load qmldir-imports also for the implicit import
Since we load plugins and C++ based types, too, we should just load the
dependent imports as well. Otherwise this is rather confusing.

Fixes: QTBUG-101752
Change-Id: I5bd8afa22e5f16141ef8b47c1a40d3ba8698106c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-22 21:53:21 +01:00
Ulf Hermann 8a9607acfc QmlCompiler: Support type lookups in prefix-imported modules
We just have to return a plain metaType if it's neither an attached type
nor a singleton.

Pick-to: 6.3
Fixes: QTBUG-101811
Change-Id: I6a78ffe4504606d0cb34f1a6ca9d5511a3447d7f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-03-22 17:47:47 +01:00
Volker Hilsheimer aee6b231d0 Fix warnings in tests after QQmlListReference change
The engine parameter is no longer used.

Pick-to: 6.3
Change-Id: Ifc630eb4803a015d41df50210bd86947f6a5a472
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-03-21 12:45:58 +01:00
Volker Hilsheimer 3a857c0107 Fix compiler warning from deprecated API
tst_qqmllistreference.cpp:828:23: warning: 'QQmlListReference' is deprecated:
Drop the QQmlEngine* argument [-Wdeprecated-declarations]

Since without the engine argument the test case is identical to the
previous block, we can just as well remove it.

Change-Id: I4e4b29a69dfdd60ed1678361d7796739ecead41e
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-03-21 12:45:13 +01:00
Volker Hilsheimer f85790d097 Fix warning in test when iterating QJsonArray
QJsonArray doesn't hold QJsonValues, so we can't iterate over references.
Use QJsonValueConstRef instead.

Change-Id: I0246e2406b2f3d5aa2cd5382d17396717d899dfa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-21 06:14:56 +01:00
Volker Hilsheimer 9a2bbcd21b Fix warning after QString::count deprecation
Pick-to: 6.3
Change-Id: Id91980b01def84ff56212a267aca805ac7deb192
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-03-20 20:47:22 +01:00
Volker Hilsheimer 6fca2c1a6d Build tests without warnings after qtbase changes
Replace deprecated QString::count with QString::size or QString::length,
depending on context, and use qsizetype instead of int.

Pick-to: 6.3
Change-Id: Ie4c08abd2cf2ba771c23e8def72756170cc07af7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-03-18 22:56:54 +01:00
Ulf Hermann 7b8e6714e1 QQmlDebugProcess: Remove cruft
The mutex had no function I can discern as the class is not thread safe
in any way, and isn't used from multiple threads anywhere. Extra event
loops are famously brittle. We don't have to use an extra event loop
here. QTest::qWaitFor will do just fine.

Task-number: QTBUG-101678
Change-Id: If25a961312a1eeb725ff779e386b2657e0f23dd1
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-18 22:56:53 +01:00
Ulf Hermann 08d0fb39b9 DebugTranslationService: Do not show a window in the test
The test works fine with the window hidden. Trying to show it gives
problems in the CI. We also want to avoid showing windows in non-GUI
tests as far as possible.

Fixes: QTBUG-101738
Pick-to: 6.2 6.3
Change-Id: I206f74f940e6ba7ac6346c85459b896387ab85a5
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2022-03-18 22:56:53 +01:00
Shawn Rutledge ae3d6a0a65 tst_qqmllanguage::extendedForeignTypes: check signal with an argument
Check that this kind of signal is also accessible in the "extended"
QML type.

Change-Id: I81ba60c23dc96723a97f1b3df5b0a6c46dba77ba
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-03-15 20:53:33 +01:00
Maximilian Goldstein 01cde42d5d qmllint: Make "Did you mean" look in extension types as well
Makes sure we also look for suggestions in extension types. Adds two new
methods to QQmlJSScope called properties() and methods() to easily get
all of them across base types and extensions.

Change-Id: I5874c0221bac6d6e317b79146227bf749100f05b
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2022-03-15 12:55:56 +01:00
Maximilian Goldstein 650fa4bc36 tst_qmllint: Use library for unqualified access checks
This is a lot faster and a bit less messy.

Change-Id: Ia43549ad63875a80774d199bcaee2453d16bf3dd
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-03-15 09:01:45 +01:00
Ulf Hermann 922b95ea15 QmlCompiler: Avoid some deprecation warnings
QString::count() is deprecated, and also the "engine" argument to
QQmlListReference. Also, properly convert the results of "length"
retrieval.

Change-Id: Ib7edde1326a0347902174a23147086b9deccfe17
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-03-14 20:53:52 +01:00
Ulf Hermann 6eff3465b5 QmlCompiler: Implement generate_DefineArray
Using the type cloning and adaption mechanism we can now determine what
kind of list we have to create in order to avoid a later conversion. We
can even propagate the type adjustment into the element types we read.

Fixes: QTBUG-100157
Change-Id: Ia2f160ebae56f39ee5946f49d2f8c5b4986a6b77
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-03-14 20:53:52 +01:00