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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Apparently there is quite some outdated information on JavaScript memory
management on the internet. Clarify what the memory manager actually
does and link the description from a prominent place.
Pick-to: 6.5
Fixes: QTBUG-105498
Change-Id: I5e53d063ccef0d85cfa8e852f72c08fe93d35b01
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Add example to showcase keybord navigation for the TableView QML type
together with 'current' and 'selected' properties.
Fixes: QTBUG-107889
Pick-to: 6.5 6.4
Change-Id: Ie95d85aa09e574bee16c23a2dff27056bc0bcd05
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This dropes its reset method, which was only used for its side effect of
starting the timer. We however do not actually need support for
resetting interrupts: Any reset logic should be done inside
QQmlIncubationController subclasses.
Change-Id: I8626c745c46d1e941bfaf82c069c001322cc5598
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Also, drop all the VERSION 1.0 lines from the examples and tests. 1.0 is
actually a bad default version since it's before all the Qt versions.
[ChangeLog][QML] You can now omit the VERSION argument to
qt_add_qml_module(). This will automatically generate the highest
possible version.
Pick-to: 6.5
Task-number: QTBUG-99146
Change-Id: Ic10ec69b87c224e0e94e1785f65653815d4c778c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
When we allocate a new chunk of memory, there may still be a bit of
memory left at the end of the previous one. Throwing that away is a
waste.
Change-Id: I2b70b581cb835161b0819c3e11c2354010c6ca1c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
We're not using gray items anywhere. There is no need to waste the
memory for the bitmap.
Change-Id: I26983cbc005531184ed955cea6026b9a8c5be910
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Combined the "Internationalization and Localization with Qt Quick"
topic with the "Internationalization with Qt" topic. Fixed links
accordingly.
Pick-to: 6.5
Task-number: QTBUG-71876
Change-Id: Ib7bfac33921da8e261c0516c9da3aa7fc943027c
Reviewed-by: Kai Köhne <kai.koehne@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 7517c1b3ae.
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 probably don't want to close the editor if we didn't handle the tab
key.
Amends commit ed83f0f795.
Pick-to: 6.5
Change-Id: I11c8f52d5ec8e1b67074ebf25d4cf4b35eb6b7e8
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
qmlformat currently discards ES classes, and only reformats the element
list inside that class. Implement a class declaration visitor which
reformats ES classes in qml file.
Pick-to: 6.5 6.2
Fixes: QTBUG-110321
Change-Id: I9fa2561902dbcfde5e8fb041bc5dedcc56bb66cc
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
We had the tst_qmlsplitlib test failing in in-source builds only,
because qt6_wrap_cpp is called on the generated sources and this sets
SKIP_AUTOMOC ON. Later in the build, the consumer of the
corresponding moc_XXX.cpp.json file errors out, because it cannot find
the file.
The test worked in out-of-source builds, because the paths of the
generated files were relative: add_custom_command generated the files in
the build dir. qt6_wrap_cpp got the relative paths and assumed them
relative to the source dir and did set SKIP_AUTOMOC on non-existent
source files. AUTOMOC took care of generating moc_XXX.cpp and
moc_XXX.cpp.json, and all was well.
Clearly, the consumer of the moc_XXX.cpp.json files expects them to be
generated by AUTOMOC.
Fix this by
- using absolute paths for the generated files to make sure
target_sources gets the correct paths
- removing the qt6_wrap_cpp call
Pick-to: 6.5 6.4
Fixes: QTBUG-110117
Change-Id: I01bcd8e37f57cf30ea06a7dd1fd8844367b58a14
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@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>
Based on the API review, adjust the MultiEffect API.
- Change mask threshold Low/Up to Min/Max and for spread AtMin/AtMax.
- Change colorize to colorization so it is more symmetric with
brightness, saturation etc.
Task-number: QTBUG-109557
Pick-to: 6.5
Change-Id: I96ff2a13e20405998c5ed0cb38ad3b5911daf94c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
It has actually been writable since Qt 5 and it is useful to keep it
writable since DelayButton can be used as a progress button that way.
Pick-to: 6.5 6.4 6.2
Change-Id: I680e0392b1135f0a37d0866c14ae1039b053fef9
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
You should be able to assign any list of QObjects to any other list of
QObjects.
Pick-to: 6.5
Fixes: QTBUG-108155
Change-Id: I6ddf0b49f7248ad56cc9560d217f3ea316c648a8
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
This allows to reduce memory consumption and improve performance
when you need to load and play hi-res GIF files or animated SVG.
[ChangeLog][QtQuick][AnimatedImage] It's now possible to configure
sourceSize property for AnimatedImage. This might be useful when you
need e.g. to play hi-res GIF files in some smaller size.
Fixes: QTBUG-57501
Change-Id: I26d464855bbc20e155a8fb589a48842986a3dea4
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>