Commit Graph

30154 Commits

Author SHA1 Message Date
Ulf Hermann 5c594515f6 qmllint: Provide import paths and resource files when linting modules
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>
2023-02-07 19:23:12 +01:00
Ulf Hermann d15efae7e1 CMake: Fix output of internal QML types
We only need one line for those. For now we cannot add the version
information because that was forgotten when the qmldir parser was
written.

Pick-to: 6.5
Fixes: QTBUG-110815
Change-Id: Ic922caa6a339a51b905b493e4638ee4d8f737fe6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-02-07 19:23:12 +01:00
Ulf Hermann 577e1dea25 qmldir parser: Handle internal types with versions
There is no reason why internal types cannot have versions.

Pick-to: 6.5
Task-number: QTBUG-110815
Change-Id: I7fa9790dc64dd785fc08ec7b22f68b4f961fdb00
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-02-07 19:23:12 +01:00
Friedemann Kleint be81599723 QtQuick: Fix conflicting definition of MinimumFlickVelocity in CMake Unity (Jumbo) builds
Move constant MinimumFlickVelocity to a common header and prefix it
to avoid clashes in static builds.

Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: Ic4178a3e7c1ea930a711c4e04f26edda19ad3efb
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-02-07 19:23:12 +01:00
Friedemann Kleint 8ecf9441c3 QtQuick: Fix conflicting definitions of qsg_leak_check in CMake Unity (Jumbo) builds
Make it a properly prefixed global variable.

Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: Ia09072bf6603c3566484f5361b03f1d3a2164be3
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-02-07 19:23:12 +01:00
Friedemann Kleint cee1b1ac02 QtQuickTemplates: Disambiguate static variables
They cause clashes in CMake Unity (Jumbo) builds.

Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: I995892bf40e3261042d758bfa7fc244e17010460
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2023-02-07 19:23:12 +01:00
Friedemann Kleint 81bad2a9b2 QtQuickControls: Disambiguate static constants
They cause clashes in CMake Unity (Jumbo) builds.

Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: I6e7fbb1d3f33eda50f55257b6df5aaf47170eb57
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2023-02-07 19:23:12 +01:00
Alexandru Croitor 1f207f4a97 CMake: Speed up configuration of qml modules with newer CMake
When using CMake 3.21 use the new builtin command for copying files if
they are different.

On my macbook pro 2019, according to cmake's 3.25 profiling,
qt6_target_qml_sources execution speed goes down from 1072ms to 122ms
when processing the imagine style qml module.

Pick-to: 6.5
Change-Id: I46c51d03bc16cadacb64c011fdf9899a88332052
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-02-07 14:07:27 +01:00
Jarkko Koivikko 6ab7e33b05 quicktextinput: Update IM state after clearing selection with IM event
Virtual keyboard uses quick text input as shadow input control attached
on top of the keyboard when the actual input control is obscured by the
keyboard. The shadow input is synchronized by the IM update events sent
by the actual input control.

When the user makes selection or moves cursor on the shadow input
control, the change is synchronized to actual input control with input
method event (QInputMethodEvent::Selection). This all works, except
when there is a selection and the cursor is clicked. The expected
outcome is that the selection is cleared, and it is, but it was not
reported back to input method.

Fix the issue by sending the update in case the selection is cleared.

Pick-to: 6.5 6.4
Change-Id: Ieabc9ee97ad9fe6154d46f302314e3ebdfd10de2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-02-06 12:45:07 +02:00
Noah Davis 75fa992146 SpinBox: consistently call setPressed before and after increase/decrease
This change just makes the behavior a bit more consistent so that
developers can do things like `stepSize: down.pressed ? downStepSize :
upStepSize`.

Pick-to: 6.5 6.4
Change-Id: I4210f31eaf0e5eda6dc83b369346e16861304fb8
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2023-02-05 00:33:20 +08:00
Shawn Rutledge 2b6eb1a51d MultiPointTouchArea: rename signal arguments in Qt 7; test with formals
This will be a behavior change for anyone who is still relying on
"touchPoints" to be the signal argument rather than the MPTA property;
so let's put it off until Qt 7 and have a reminder in docs in the
meantime.

Fix autotests to avoid depending on this (just as users should).

[ChangeLog][QtQuick][MultiPointTouchArea] As a reminder: you should
always use formal parameters when writing a signal handler that depends
on an argument, such as MultiPointTouchArea.onPressed, onUpdated,
onReleased, or onCanceled. It gives you an opportunity to name the
argument, to avoid confusion with the touchPoints property, and will
avoid behavior changes if we rename the argument in a future version.

Pick-to: 6.5
Fixes: QTBUG-110906
Change-Id: Ie78dc539f7f6cac660f2e90bf3e4665afed3e3f7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-02-03 23:42:18 +01:00
Friedemann Kleint 053394edab QtQuick: Fix conflicting definition of ProtectedLayoutAccessor in CMake Unity (Jumbo) builds
Move it to qquicktextdocument_p.h in namespace QtPrivate.

Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: I7b0482e0dc052dc431c1264ff27423957d20b219
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-02-03 21:29:45 +01:00
Friedemann Kleint c279669c72 QtQuick: Fix conflicting definitions in qsgbasicinternalimagenode.cpp in CMake Unity (Jumbo) builds
Rename struct and helper function.

Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: I131ae2200981c4e4aace6918940b772af4cb6466
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-02-03 15:35:04 +01:00
Friedemann Kleint 6fea0cd57e QtQuick: Fix warnings about fields anonymous namespaces
Remove anonymous namespaces, fixing warnings like:
qsgareaallocator.cpp:27:8: warning: QSGAreaAllocatorNode has a field QSGAreaAllocatorNode::splitType whose type uses the anonymous namespace [-Wsubobject-linkage]

which occur in CMake Unity (Jumbo) builds.

Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: I71e4ec5f89bbf4220efd9a8ba819ee5fb39b95e8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-02-03 15:34:53 +01:00
Friedemann Kleint aeec621865 Examples: Add missing include guards
Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: I968865958770f6282ab6f79dc9b2becf4f7795af
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-02-03 15:33:07 +01:00
Friedemann Kleint a2e1bf6615 QtQuick: Fix conflicting definitions of options in CMake Unity (Jumbo) builds
Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: I576e61990dee9e479321b1a4b0eb49cafb030acc
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-02-03 15:31:04 +01:00
Sze Howe Koh 27878fdef7 Doc: Don't auto-close popup in Attached Style Properties Example
So that users can see the theme change while the popup is open

Change-Id: I9cac09badc04c5dcace45dadaa9282900b093e17
Pick-to: 6.5
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2023-02-03 22:23:40 +08:00
Sze Howe Koh ecdbc277ab Doc: Fix compile-time warnings in Attached Style Properties Example
Fixes: QTBUG-110831
Pick-to: 6.5
Change-Id: Iee931d5595cab1c6fb40b5ddff0596ce6195788a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-02-03 22:23:33 +08:00
Ulf Hermann c428ca6326 Doc: Recommend putting QML files in the same directory as their modules
Otherwise things quickly get messy.

Pick-to: 6.5
Task-number: QTBUG-106929
Change-Id: I9426f3ad3766cad5b133e8ef063696873bb9b7c9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-02-03 14:32:27 +01:00
Ulf Hermann b8c6c3ea0f QmlCompiler: Add hint about generalized grouped properties
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>
2023-02-03 14:31:51 +01:00
Ulf Hermann 236439de7b qmllint: Add warning about PropertyChanges using custom parser
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>
2023-02-03 14:31:38 +01:00
Fabian Kosmale 8a55827198 Remove superfluous QT_VERSION_CHECK tests
Change-Id: I09345f1e0cd23591de7a9fe545076cd8a951ee73
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-02-03 10:49:26 +01:00
Sami Shalayel 01d84ffc74 qmltc: export generated classes
Add QMLTC_EXPORT_MACRO_NAME and QMLTC_EXPORT_FILE_NAME arguments to
qt_add_qml_module() that allows the user to export qmltc-generated code
from its library. The qmltc-generated code will include the header-file
specified in QMLTC_EXPORT_FILE_NAME and will be exported with the macro
specified by QMLTC_EXPORT_MACRO_NAME.
Leave both options unspecified to not export the code generated by
qmltc.

Describe the options in the documentation and write a test to see if the
class really has an export macro in the generated code:
1) tst_qmltc_qprocess will test if the macro and the header are correctly
inserted in the generated code.
2) tst_qmltc_{no,}diskcache will test if the generated code can still be
   used from a static library.

Fixes: QTBUG-106840
Task-number: QTBUG-96040
Change-Id: I554f03bcdf043e8114e42f51a7289a5c00de4f89
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-02-02 18:11:07 +01:00
Fabian Kosmale 55f3bf8882 loadFromModule: Properly handle QML only modules
QQmlMetaType::typeModule only returns a sensible result for modules with
some C++ integration. That is not the case for a pure QML module (qmldir
put into an import path).

Detect the missing module case by instead checking whether addImport
failed to handle the module (either returning false, or returning true
but with unresolved imports).

Fixes: QTBUG-110882
Pick-to: 6.5
Change-Id: I7b25e225e1a34ec91f7ce4d9f4a182a24168ba47
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-02-02 16:55:03 +00:00
Sami Shalayel e4e20fabfe add QML_UNCREATABLE in the tests
Add the QML_UNCREATABLE macros in the tests where it is missing.

Change-Id: I58ef5a27e15f0bb99bc94bf819b38aaad3358432
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-02-02 10:24:37 +01:00
Kai Köhne b641eaebfa Doc: Add missing \since to new Qt 6.5 Qt QML API
Pick-to: 6.5
Change-Id: I9468f2a4ff6ca93b6a1b66cd6cb79659fec85524
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-02-02 10:24:36 +01:00
Kaj Grönholm 47be703df5 Improve MultiEffect API documentation
Add some code examples and images.

Task-number: QTBUG-110757
Pick-to: 6.5
Change-Id: I599bef3374c597e4ab2afa4478748100d3963d84
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2023-02-02 08:53:24 +02:00
Mitch Curtis 1f3cded986 Doc: add missing \row in Imagine style documentation
Pick-to: 6.2 6.4 6.5
Change-Id: I81b01ea4c8d0c29d58b36e3ac9d146f95d1f777c
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
2023-02-02 10:58:13 +08:00
Fabian Kosmale ec452fc6e8 qt_add_qml_module: Make usage of AUTO_RESOURCE_PREFIX a policy
Writing AUTO_RESOURCE_PREFIX in every qt_add_qml_module call seems
rather pointless.

In addition:
- Add documentation for QTP0001.
- Adjust some of the examples to use QTP0001 policy.
- Improved the error message.

Pick-to: 6.5
Task-number: QTBUG-96233
Change-Id: I6e19a491acba97493893bf1953fca3462296c1ea
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2023-02-01 23:39:19 +01:00
Qt Submodule Update Bot a6d9312c99 Update dependencies on 'dev' in qt/qtdeclarative
Change-Id: Ie203d403b2cc0ad262c03d8a32eaaa3569fbf2d7
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-02-01 20:04:42 +00:00
Thomas Senyk b899dff5d4 Fix QQuickImageParticle in case of QRhi re-create
With this patch QQuickImageParticle will now properly re-query
the m_rhi member the next time updatePaintNode() is called

Additionally a new (override)
QQuickImageParticle::invalidateSceneGraph()
will call reset() so that potential sub-nodes (e.g. SpriteParticle)
will also be re-created

Last but not least: QQuickSpriteEngine::startAssemblingImage()
was missing to reset it's sprites container
(without that the sprites would pile up and eventually
fail with "Too many animations" error)

Pick-to: 6.5 6.4 6.2
Change-Id: I172fd23ddfac475542aabc6cc17d8fee74f728b2
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2023-02-01 09:06:16 +01:00
Thomas Senyk 185b0d5f21 Fix QQuickCanvasItem in case of invalidateSceneGraph()
Adding requestPaint() at the end of invalidateSceneGraph()
will make sure that painting is trigger properly again,
including the (re-)creation of the painting context.

As that request of painting will also recreate the painting
context, it will also allow the creation of a new QSGNode

Without this patch a nullptr will be returned as QSGNode
until a "proper" dirty or update() happens due to property changes
or explicit update calls.

Pick-to: 6.5 6.4 6.2
Change-Id: If1e79d135d3d1f5253cb41a3be1630cfed3865dd
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2023-02-01 09:06:16 +01:00
Mitch Curtis d7f47127da Update Material Dialog to Material 3
Fixes: QTBUG-109035
Pick-to: 6.5
Change-Id: Idf4bf0a114529dd1715c4b9db0b3fdeea5b78bf1
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2023-02-01 13:53:09 +08:00
Qt Submodule Update Bot 34b22acd4d Update dependencies on 'dev' in qt/qtdeclarative
Change-Id: I0336cbff1915de82345e314a1d780b7108203379
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-02-01 00:26:42 +00:00
Fabian Kosmale 66b329ee29 SharedImageLoader: Do not use deprecated IPC mechanism
Change-Id: If368424ffa75921c001a9a72c4c8e46779ae52e1
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-02-01 01:26:41 +01:00
Kai Köhne 5f17c1cc3a Doc: Document QQmlEngine::offlineStoragePathChanged separately
The signal is new in Qt 6.5, so better list it separately (with \since
tag).

Pick-to: 6.5
Change-Id: If83cc1d48f0fdeafbd6a67691170932ec9ea5e04
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-01-31 22:41:47 +01:00
Ulf Hermann a29f316089 Doc: Disambiguate description of module URIs
While you can, technically, have URIs that contain '$', or '幽', '霊',
'文', and '字', you really shouldn't.

Amends commit 9e4f6d9211.

Pick-to: 6.5 6.4 6.2
Fixes: QTBUG-106074
Change-Id: Ic0f13b6ea2bb704d2bd9f4fa5841aa69a88cd5a7
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-01-31 22:41:47 +01:00
Semih Yavuz 66bc001968 qmlcachegen: fix nonstrict equality code generation
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 6a816a9e0d

Pick-to: 6.5
Fixes: QTBUG-110769
Change-Id: I7f9a457e71a621a005f377216e841bec01667454
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-01-31 19:12:30 +01:00
Semih Yavuz db71a35b1e qmlcachegen: Improve QObject comparison code generation test
The code generated for QObject comparisons holds for both weak and
strong comparisons. Improve tst_qmlcppcodegen by adding missing weak
comparison tests.

Amends afc7928d1a.

Pick-to: 6.5
Change-Id: Ib6176a39b329e792b81b3d8e8a288dcea074320b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-01-31 19:12:21 +01:00
Ulf Hermann e23ea6cf3c QQmlListMode: Update alignment calculation
We don't store a QObject* there anymore.

Amends commit 718f3469f6.

Pick-to: 6.5
Change-Id: Ib3088b8d4966c761af0c3fc815b85092361555b1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-01-31 11:52:53 +01:00
Vladimir Belyavsky 1b635cf831 AnimatedImage: Introduce private clearCache() method
Introduce clearCache() method in QQuickAnimatedImagePrivate and use
it wherever applicable to make the code a bit cleaner. Also don't clean
the cache explicitly on setSource(), as it's still cleared in setMovie()
call.

Change-Id: I299b138371534ff091248013ac833d734d8a6607
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-01-31 10:52:53 +00:00
Fabian Kosmale b48cf3dcba QQuickGraphicsConfiguration: Turn debug operator into hidden friend
Pick-to: 6.5
Change-Id: I97680ad83968ec33f70a5d16e6fb6e484764fa11
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-01-31 11:52:53 +01:00
Ulf Hermann bb6bc1a06d QJSEngine: Move old convertV2 to removed_api.cpp
Pick-to: 6.5
Change-Id: I7f700d64694c8651769841a0109d32e8f9a839b2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-01-31 11:52:53 +01:00
Ulf Hermann 506c74d782 Doc: Update qmlformat description
The behavior of qmlformat has changed. Update the documentation to
reflect it.

Pick-to: 6.5
Fixes: QTBUG-107213
Change-Id: I7a53ad7b62edce0f078782dbef340236d20c9781
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-01-31 11:52:53 +01:00
Ulf Hermann b04776e82e Item views: Don't create unnecessary QML contexts
Bound components can only be instantiated in the context they're
declared in. Adding a context in between before instantiating a
component makes it impossible to bind the component. We want to use
bound components so that we can safely use IDs of other objects from
the same context inside the objects created from the component.

See also commit fc683799fe.

Pick-to: 6.5
Fixes: QTBUG-110697
Change-Id: I8ac9afe13a3d88a4c8e432f5cd701abee8a7f6ac
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-01-31 11:52:53 +01:00
Ulf Hermann d31e86f806 tst_qqmlvaluetypeproviders: Choose a date in the middle of the month
If we don't set the date on the date value to be tested, it will be the
current date. If the current date doesn't exist in the month we set, we
get garbage.

Pick-to: 6.5
Fixes: QTBUG-110793
Change-Id: I91db0974e10e11ebce5ddce60f1594285da6fb3f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
2023-01-31 09:29:43 +01:00
Vladimir Belyavsky e4d627e129 QML test: Fix annoying warning in tst_animatedimage.qml
Fix a bunch of warnings "tst_animatedimage.qml:90:17: TypeError: Cannot
read property 'width' of null" during the test run.

Pick-to: 6.5
Change-Id: I9a1fcd5d8e2ff81768bed1cd1fb94f22940c617b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-01-30 18:09:31 +00:00
Ulf Hermann 07185214dd QmlCompiler: Fix version resolution for imports
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>
2023-01-30 15:58:12 +01:00
Ulf Hermann 9e4f6d9211 Doc: Clarify syntax of module URIs
No, you cannot use kebab case.

Pick-to: 6.5 6.4 6.2
Fixes: QTBUG-106074
Change-Id: I9e3bdfd71d40177f16c99330ffc51d899384f407
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
2023-01-30 14:58:11 +00:00
Ulf Hermann 718f3469f6 ListModel: Use PersistentValue to keep track of objects
This is the simplest way to prevent the garbage collector from
destroying the object while at the same time allowing a manual
destruction.

Pick-to: 6.5 6.4 6.2
Task-number: QTBUG-95895
Task-number: QTBUG-96167
Fixes: QTBUG-91390
Change-Id: Ic3f3146bc555991068ce3367971e050f745d235d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-01-30 14:58:11 +00:00