This turns out to be not quite valid since context hierarchy is
afffected. It was fine before since all the generated classes either
had the same context or a dead-simple hierarchy + the tests for
comprehensive usage were lacking. The problems arise when contexts are
meant to be different for unrelated JS calls e.g. in property bindings
with non-trivial cross-context dependencies (e.g. derived property
uses both neighbor property and base class property in a binding)
As a drive by, simplify QQmlEnginePrivate::executeRuntimeFunction():
* Expect function index to always be valid (in range), it's a very bad
otherwise anyway
* Use QQmlData::outerContext directly as a context argument for
callInContext(). This is what was done anyhow, just through a
QQmlContext -> QQmlContextData conversion, which is actually needless
Change-Id: I8ac6b181363a5d03e468c2b6f35db2dac188ea8b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This seems fairly essential one way or another since e.g. QQmlContext
uses the compilation unit to set up some of the internal data members.
Add a new method to the private API of QQmlEngine. This API could be
used by the object creation compiler to set up different parts of the
object (again, QQmlContext)
Change-Id: I25894ab74606793ade391bafd8eb5b1cbfbe0952
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
As QQmlContextData seems a better fit for this functionality, add
the new function to that class (instead of QQmlData)
It could then be reused by the object creation compiler, similarly
to how QQmlObjectCreator does it
Change-Id: Icb686164f3ae442cd7efe48a1588419a41c3e4c7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Change-Id: I7eb4c5587ee11dacb9414760fdc7487ace918582
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
The build recipe uses the qtbase's 'bin/qt-configure-module' script
directly which is recommended when building other Qt modules ouside
the qtbase's -prefix.
The recipe uses functionality from qt-conan-common Conan
package via 'python_requires'.
This recipe sets it's own Conan options that match with the
module configure options.
The recipe sets it's version number based on QT_REPO_MODULE_VERSION
and QT_REPO_MODULE_PRERELEASE_VERSION_SEGMENT in .cmake.conf file.
The dependency to qtbase, qtsvg and qtshadertools is declared
using semantic versioning so that it will pick the latest
available prerelease or final version of the major.minor.patch.
Task-number: QTBUG-94384
Pick-to: 6.2
Change-Id: I1f12434521d11f63c31a102bfbfaf923cb262965
Reviewed-by: Toni Saario <toni.saario@qt.io>
Now that __qt_internal_propagate_object_library provides common way to
link and propagate an object library it makes sense to reuse its
functionality in the _qt_internal_propagate_qmlcache_object_lib
function.
Pick-to: 6.2
Change-Id: I83faa3a7452f875982477930c584feae191cce27
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This was previously achieved by passing a NO_CREATE_BACKING_TARGET
internal option to qt_internal_add_qml_module.
Now it's just a conditional check to only create the backing target if
it doesn't exist yet. This aligns with the behavior of the public
qt_add_qml_module function.
The old option is deprecated and will be removed once all repos
mentioning it don't use it anymore.
Amends cb293ee3af
Pick-to: 6.2
Change-Id: Ifd478a5495b36c7ba127d4b8bea2ec1225035744
Reviewed-by: Craig Scott <craig.scott@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
We don't need --qmljs-runtime after all. However, we do want to pass
custom arguments to qmlcachegen. This way we don't need to change the
world whenever we invent one.
Pick-to: 6.2
Change-Id: I99f0c99c4b15e469605dc43d26871fa43dc36c08
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Amends 1285b67a11
It might turn out that this warning is just noise in other cases too;
not sure. But it's quite normal that currentEventDeliveryAgent is null
when the once-per-frame fake hover event occurs.
Fixes: QTBUG-94576
Pick-to: 6.2
Change-Id: Ib4eed274801b08b62403caec70d0fc3c538e4383
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
The recent 602d26c38f3767be9bec25302c93fc155c4dce59 change in qtbase
is now requiring that CLASS_NAME is always set for qml plugins, to
ensure that in static builds we can pre-build a plugin initializer
object library.
Split out the uri escaping and class name generation code into
separate functions.
Ensure that the class name is auto-generated by
qt_internal_add_qml_plugin if it wasn't manually specified.
Pass that value to the qt_internal_add_plugin function.
Remove comment about not passing the CLASS_NAME.
Task-number: QTBUG-93257
Task-number: QTBUG-92933
Change-Id: I8aa482a7da3a59f5a2213a630ff0be70506efe11
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Remove the configure.json and configure.pri files that
were used for the qmake-based configure.
Remove the .prev_*.cmake files that were a by-product of
configurejson2cmake.py.
Pick-to: 6.2
Task-number: QTBUG-89536
Change-Id: I1c41256e773b0cdfdf237802d672b1140b076e99
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
The imageelements examples depended on URLs being resolved
relative to the file where it was declared, but in Qt 6
this was changed. Since the source is actually resolved
inside MyBorderImage, which is in content/, we would end
up trying to resolve content/content/foo.png.
To avoid having code depend on the location of types it is
using, URLs have to be packed in Qt.resolvedUrl() in Qt 6.
Change-Id: I16e203e92b3b4c7c573dcdb85dcd556f2103ab80
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Previously support of required properties was limited to detecting whether a property that was required actually exists. Now it also enables us to determine whether or not the required property was ever bound to.
Still limited by the fact we do not fully support script bindings yet.
Fixes: QTBUG-86755
Pick-to: 6.2
Change-Id: I1abb921d3b4f86a7929f0f829b541088e0c2bf60
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Also explictily mention again that objects with JS ownership won't be
deleted as long as they have a parent.
Pick-to: 6.2 6.1
Change-Id: I1eeb5bc8183b6621f24f3751b8152b36acf2eeae
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
We should pass the variants themselves, not their constData().
Fixes: QTBUG-94502
Pick-to: 6.1 6.2
Change-Id: I92688348d7b46d74935dc11080b26290f5e8be86
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
We need to add an entry to all the RegisterID enums, so that we can mark
a RegisterID as invalid.
Pick-to: 6.2
Task-number: QTBUG-94068
Change-Id: I5c13b271eade50fd63327612514ba7ebe33a5c39
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
This way you can pass QML-related resources without triggering a
warning.
Pick-to: 6.2
Change-Id: I4b7db5007f1f2ecf0eb556bc4e5bc67f8ac9148d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
For targets that are built as part of Qt, we currently require all .qml
files to be passed to qt_internal_add_qml_module(). We can use that to
iterate over the set of qml files and access their source file
properties at configure time. The previous approach tried to use the
list obtained at generate time, but the source file properties (and
therefore their resource aliases) were not accessible and the install
locations assumed no resource path or alias.
By installing from the source dir, we also address the dependency issue
where an install wouldn't cause the build dir copies to be updated. The
install target will always install the latest source files with this
change.
Fixes: QTBUG-94519
Fixes: QTBUG-94520
Pick-to: 6.2
Change-Id: I6a97a9631ff77c3f7696899a347b83c2eb4b0ca4
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
All our qt5.git repos are marked with
QT_NO_INTERNAL_COMPATIBILITY_FUNCTIONS
There are still some marketplace repos like quicktreeview that don't
have it, but those should be fixed separately.
The point is we don't want to override the public qt_add_qml_module
function with the compatibility one.
Pick-to: 6.2
Change-Id: I7959025acbf30ac94b6c20799089996a66c06fc2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
We need to check for NaN before casting a double to an integer.
Pick-to: 6.2
Task-number: QTBUG-94068
Change-Id: Ib7bfab5ab2e24af950c8f8d7b32c7d411bd8cb71
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This was a terrible misfeature. It registers random enums from all over
the place into a type. See the test for an example.
[ChangeLog][QtQml] You can now suppress the registration of enums of
"related" C++ types in a QML type. Such registration is often unintended
and rather unpredictable. Set the "RegisterEnumsFromRelatedTypes"
Q_CLASSINFO to "false" in order to suppress the registration.
Task-number: QTBUG-83703
Change-Id: Ic9046daa7a3c833ce65396a8731dfa28d269317c
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Screen QML type is moved under the main QtQuick import
* XmlListModel types are their own documentation project, add a
dependency to qtquick.qdocconf.
* Remove QDoc comment identifiers from internal, undocumented
class.
* Fix linking to Qt Creator manual.
* Fix linking to QtQuick3D.Model.
Pick-to: 6.2
Change-Id: I3b48165c04ef84288472963e39eafc0868c14c49
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
The palette provider allocates QQuickPalette instances lazily in the
palette() implementation. Since we only only test here whether a palette
is present, uses the non-mutating providesPalette instead.
As a drive-by, remove the paletteData() check from setCurrentColorGroup;
paletteData() asserts if it would return nullptr, so this check is wrong
and misleading.
Amends 3675f2b235.
Pick-to: 6.2
Change-Id: I9701b3520998ec538ef560106a6c6078e7f1c4d8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Subclasses may override palette() and paletteData() may not be the
actual source of the palette data. QQuickPopupItemPrivate in
qtquickcontrols2 does this.
Fixes: QTBUG-94533
Pick-to: 6.2
Change-Id: I0434aafab8d0e9fc97f06c04c8dfaef738f4bf09
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Amends 3675f2b235 by testing that window
(de)activation changes the current color group.
Pick-to: 6.2
Task-number: QTBUG-93752
Change-Id: I031956c68c806b169ad02f2877581571aa3ff3f1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
The test is there to verify that the sourceChanged property
notifier gets a connection, but it also counted all other
connections. Since b65159a5ea8db05165b2eaab8e180a12f30063e4 in
qtbase the parentChanged, windowChanged and enabledChanged
signals are also connected to something so this broke the
test.
Fix is to make the test explicitly look for the sourceChanged
signal and ignore all others.
Pick-to: 6.2
Change-Id: Ia188384b37c9c078e78d09670bd955a69d10c7de
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
If the drag.target of the mouse area that starts the drag is a parent of
a drop area, then that drop area cannot be dropped on (as it's moving
with the dragged item).
Due to QQuickDeliveryAgentPrivate::deliverDragEvent calling itself
recursively, this is the earliest place where we can block this event
from being delivered.
Fixes: QTBUG-64128
Pick-to: 6.2
Change-Id: I495492161d67f7ac60eafb99982fb01ec2374c50
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
undefined as value returned from bindings has the special meaning of
resetting the binding. As AOT-compiled functions return the actual type
of the binding rather than a QV4::Value, we cannot always encode
undefined. Therefore, add a flag that tells us whether the result was
supposed to be undefined.
Pick-to: 6.2
Change-Id: Iac2298869dde80f6d889240dd8200b2ad83e5dc5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
...and rephrase one of the general description paragraphs to be
more accurate.
Pick-to: 6.2 6.1
Fixes: QTBUG-93489
Change-Id: If238fff84480720a618c8a337fe416cd08ee9b79
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
This was forgotten in 1875ad7f92.
Fixes: QTBUG-91365
Pick-to: 6.2
Change-Id: I8dabf0e2a5a13f0db5feac5c03e3494948393cb7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Previously QObject's could get garbage collected while in use.
This change fixes this by making them indestructible while in use and then restoring their previous state.
[ChangeLog][QtQml][QQmlListModel][Important Behavior Changes] ListModels now take ownership of the objects added to them, only releasing them after the object has been removed again. This may break existing solutions which rely on the object not being owned by the model.
Fixes: QTBUG-91390
Pick-to: 6.2
Change-Id: Ifd37c90e13fb0b6ad8a5a06e89f9fc9a429f6316
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This was an oversight: We only checked that normal properties have
unique names, and that alias properties have unique names, but we
neglected to check that alias properties and properties do not have name
collisions either.
Fixes: QTBUG-94456
Pick-to: 6.2 6.1 5.15
Change-Id: I0fa7666b143bc84f4dc5b2ad6e62427adff60cd7
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
We cannot use the lookup metatype before we initialize it, and the
calling code cannot know the result metatype before the lookup is
initialized, either.
Pick-to: 6.2
Change-Id: I3c691b41dbdb416aa1822c0ea7c4b887398f7908
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
We need to write the inner data of the variant. Otherwise we create
double-wrapped objects.
Pick-to: 6.2
Change-Id: Iacc7b341168c4328172a4e442c16cfbedc6c36c0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
A class with virtual methods should have a dtor.
Change-Id: I08316aadc6df72e8cb3f2d36f5eec2ac59cdeb42
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This ensures that we list all of Item's properties in the "List of all
Members" page.
Pick-to: 6.2 6.1 5.15
Change-Id: Ide7e270fd187e6adc4a20b70b8ef84d2c25a836c
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>