| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
We rarely actually need the executable CU, and where we need it, we can
dynamically create or retrieve it from the engine. To that end, store
all the CUs in the same container in the engine.
Change-Id: I0b786048c578ac4f41ae4aee601da850fa400f2e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This gives us a unified interface to all kinds of QML types at run time
and reduces the effort of finding corresponding type attributes.
QQmlType is much larger than CompositeMetaTypeIds. Most composite types,
however, are initially referenced by URL, and we call typeForUrl anyway.
typeForUrl already creates a mostly functional QQmlType; we only need to
add the dynamic metatypes. The same type can be retrieved later and
associated with the actual CU using the compositeTypes hash. That way,
we don't need any extra type. We do, however, incur the cost of creating
the QMetaTypePrivate instances when first referencing a type. This could
be optimized, like many things in this area, by using thread safe lazy
initialization.
Now some QQmlTypes implicitly depend on the CUs they were created for.
This creates problems if the CUs are removed but the types still
persist. Such a situation can arise if you create and delete engines. In
order to avoid it, we:
1. Make the compositeTypes hold a strong reference to the CUs
2. When unlinking, avoid dropping the property caches (as those are used
to hold the metaobjects)
Now, however we got a cyclic reference between the CU and its
QQmlType(s). To resolve this, we clear the QQmlTypes on unlinking.
Finally, to avoid deletion recursion when clearing the last CUs on
destruction of the QQmlMetaTypeData, we move the compilation units out
of the way first.
All of this still doesn't work if multiple CUs hold the same QQmlType,
since compositeTypes can only hold one CU per type and that may be the
one that gets removed first. Therefore, we cannot allow such a situation
to happen and have to create a new QQmlType if it arises. It can only
arise if you have multiple engines loading the same QML components,
which should be fairly rare.
For inline components, we apply a similar trick: You can either find an
inline component by Url, and receive any type that matches, no matter
what CU it belongs to. Or you can request an inline component type that
belongs to a specific CU. It turns out we don't have to store the
containing type of an IC at all. Also, we slightly change the naming of
internal components' "class names" since we want to use the inline
components' element names for them.
Change-Id: I0ef89bd4b0a02cc927aed2525e72f6bff56df626
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
| |
The ID can only be determined once the compilation unit is present. It
depends on the order of objects in the compiled data. The name is always
available. Indexing by name increases the overhead. However, since we
don't have to "amend" the ID later on and since we only need one
lookup table rather than two per type now, it's probably worth it.
Change-Id: I478de505a1934b5b6ab340b4be4fa5da4e95aeb3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
| |
In Unity Build, on OpenSUSE, for some reason compiler confuses
the Node with an `int`. This refactoring resolves the issue by moving
the type into the `icutils` namespace.
Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: Id379b9aff21b29115d4503791debd658f034a0cd
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Files that have to be modified by hand are modified.
License files are organized under LICENSES directory.
Pick-to: 6.4
Task-number: QTBUG-67283
Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
| |
|
|
|
|
|
| |
Change-Id: I46f4f21bda1360d09e2c49a1f04dbe411fb46f7d
Pick-to: 5.15 6.2 6.3
Task-number: QTBUG-99545
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
| |
|
|
|
|
|
|
| |
Pick-to: 5.15 6.2 6.3
Task-number: QTBUG-99545
Change-Id: Ia57a16313e883a8d4dab15c971181440ed1d2214
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
|
| |
|
|
|
| |
Change-Id: Icda3f73120d61b3483a6e1024ff12e019e799b90
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
| |
|
|
|
|
| |
Change-Id: If51b86e1741b7e9f0e7e4d5f593496bd28cec081
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The quint32_le_bitfield class, like its underlying type, doesn't
provide a user-defined constructor, so default-construction leaves the
'val' member uninitialized. When the user-defined assignment operator
then tries to read from 'val', that is undefined behavior. Or would, if
vector::resize() wouldn't value-initialize, which it is required to do.
So, False Positive, but due to -Werror, we need to do something about it
(value-initialize the largest union member before calling assignment).
Says GCC 11 with -stc=c++20 -fsanitize=undefined -Werror:
In member function ‘QSpecialIntegerBitfield<S, pos, width>& QSpecialIntegerBitfield<S, pos, width>::operator=(QSpecialIntegerBitfield<S, pos, width>::T) [with S = QLittleEndianStorageType<unsigned int>; int pos = 0; int width = 30]’,
inlined from ‘icutils::Node::Node(std::vector<QV4::CompiledData::InlineComponent>::size_type)’ at qt5-build/qtbase/include/QtQml/6.3.0/QtQml/private/../../../../../../../qt5/qtdeclarative/src/qml/inlinecomponentutils_p.h:66:26,
inlined from ‘constexpr void std::iota(_ForwardIterator, _ForwardIterator, _Tp) [with _ForwardIterator = __gnu_cxx::__normal_iterator<icutils::Node*, std::vector<icutils::Node> >; _Tp = int]’ at /d/gcc/11/include/c++/11.2.1/bits/stl_numeric.h:99:4,
inlined from ‘void QV4::ExecutableCompilationUnit::finalizeCompositeType(QQmlEnginePrivate*, CompositeMetaTypeIds)’ at qt5/qtdeclarative/src/qml/jsruntime/qv4executablecompilationunit.cpp:444:14:
qt5-build/qtbase/include/QtCore/6.3.0/QtCore/private/../../../../../../../qt5/qtbase/src/corelib/global/qendian_p.h:78:30: warning: ‘*(QSpecialIntegerBitfield<QLittleEndianStorageType<unsigned int>, 0, 30>*)((char*)&<unnamed> + offsetof(icutils::Node, icutils::Node::<unnamed>)).QSpecialIntegerBitfield<QLittleEndianStorageType<unsigned int>, 0, 30>::val’ may be used uninitialized [-Wmaybe-uninitialized]
78 | UT i = S::fromSpecial(val);
| ~~~~~~~~~~~~~~^~~~~
In file included from /d/gcc/11/include/c++/11.2.1/numeric:62,
from qt5/qtbase/src/corelib/tools/qhashfunctions.h:47,
from qt5-build/qtbase/include/QtCore/qhashfunctions.h:1,
from qt5/qtbase/src/corelib/tools/qlist.h:46,
from qt5-build/qtbase/include/QtCore/qlist.h:1,
from qt5/qtbase/src/corelib/kernel/qobject.h:49,
from qt5-build/qtbase/include/QtCore/qobject.h:1,
from qt5/qtbase/src/corelib/animation/qabstractanimation.h:43,
from qt5-build/qtbase/include/QtCore/qabstractanimation.h:1,
from qt5-build/qtbase/include/QtCore/QtCore:9,
from qt5-build/qtdeclarative/src/qml/CMakeFiles/Qml.dir/cmake_pch.hxx:5,
from <command-line>:
/d/gcc/11/include/c++/11.2.1/bits/stl_numeric.h: In member function ‘void QV4::ExecutableCompilationUnit::finalizeCompositeType(QQmlEnginePrivate*, CompositeMetaTypeIds)’:
/d/gcc/11/include/c++/11.2.1/bits/stl_numeric.h:99:20: note: ‘<anonymous>’ declared here
99 | *__first = __value;
| ~~~~~~~~~^~~~~~~~~
Pick-to: 6.3 6.2 5.15
Change-Id: I8bbe32438489120bd005e115ea34cd816c898116
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
| |
|
|
|
|
|
| |
It's used all over the place. We need a proper interface.
Change-Id: Iebe254ef3bf35503bf3fdd3639979a5db2b3449e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
[ChangeLog][QtQml] It is now possible to declare new QML components in
a QML file via the component keyword. They can be used just as if they
were declared in another file, with the only difference that the type
name needs to be prefixed with the name of the containing type outside
of the file were the inline component has been declared.
Notably, inline components are not closures: In the following
example, the output would be 42
// MyItem.qml
Item {
property int i: 33
component IC: Item {
Component.onCompleted: console.log(i)
}
}
// user.qml
Item {
property int i: 42
MyItem.IC {}
}
Fixes: QTBUG-79382
Change-Id: I6a5ffc43f093a76323f435cfee9bab217781b8f5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|