aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmldatablob_p.h
Commit message (Collapse)AuthorAgeFilesLines
* QtQml: Use CompiledData::CompilationUnit in more placesUlf Hermann2024-01-201-1/+0
| | | | | | | | | | 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>
* Remove the use of Q_QML_PRIVATE_EXPORTAlexey Edelev2024-01-111-1/+1
| | | | | | Task-number: QTBUG-117983 Change-Id: I5790f01d614cd70c7fcc9bd817ec6ace3f3e3730 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QQmlRefCount: de-virtualize dtorMarc Mutz2023-06-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | Now that QQmlRefCounted ensures no-one uses ~QQmlRefCount() directly anymore, we can make it non-virtual, shrinking the sizeof(QQmlRefCount) from 8/16 to 4/4 bytes (32/64 bit platforms). This requires moving the release() function from QQmlRefCount down into QQmlRefCounted<T>, and static_cast'ing *this to T before calling delete. We need to be careful, of course, that no derived class relied on the implied virtualness of ~QQmlRefCount() making their dtors virtual, so require that all classes that use QQmlRefCounted are either final or have a virtual destructor. Update the toolsupport test and the TypeInformationVersion, as sizeof(QQmlRefCount) was one the items checked. Fixes: QTBUG-114817 Change-Id: I69afd36ec5b63313842c1438e0244503603ed96f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QQmlRefCount: break all users that attempt to access the dtorMarc Mutz2023-06-251-1/+1
| | | | | | | | | | | | | | | | | | | | | ... by making the dtor private, accessible only via an auxiliary friend class QQmlRefCounted<T>. There are no users of QQmlRefCount outside of qtdeclarative, but we cannot rule out that users use this private API. Since we develop this patch as part of our own due diligence, we might as well put it into the 6.6 release so as to alert any potential users outside the qt5.git tree. Once this change is released as part of 6.6, we know we have no users of ~QQmlRefCount() (anymore), and can, in the next step, drop the virtual from the dtor, saving sizeof(void*) on each object in the hierarchy that isn't virtual of its own volition. Task-number: QTBUG-114817 Pick-to: 6.6 Change-Id: I16ea02dc57f9555e302d9415f3e573d8765cf7a3 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QQmlDataBlob: Take and return qreal for progressFabian Kosmale2022-11-021-3/+4
| | | | | | | | | | | | | | QQmlDataBlob so far took and returned a quint8 for progress – however the sole consumer of it expected a qreal in the [0;1] range. progress returning an integer dates back all the way to 22a7d19d68bab2882fd9a6ebefd65152bbc1eaf5; the reason why this did not create issues in practice is that the code path is only exercised when downloading QML files over the network, which turned out to be a rather uncommon use case. Change-Id: I0140729955e393a19000adabe55f40fdd2caa04d Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QQmlDataBlob: Use RefPointer when interacting with QQmlTypeLoaderFabian Kosmale2022-09-161-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | QQmlTypeloader and QQmlTypeLoaderThread so far used to manually call ref and deref on QQmlDataBlob pointers. Changing the refcount was necessary, as the blobs were stored in various data structures which should keep the blobs alive; namely the Message struct subclasses use in QQmlThread and the NetworkReplies hash-map. However, the whole setup was rather brittle; especially when it comes to QQmlThread, where methods adding Message structs would increment the refcount, and the actual callback stored in the Message would decrement it. This would obviously cause leaks if the Message::call would not be invoked (e.g. due to the QQmlThread shutting down). By replacing the raw pointers with QQmlDataBlob::Ptr (which is a new typedef for QQmlRefPointer<QQmlDataBlob>), we can avoid the whole issue[1], and also simplify the code. Note that Message stores a QQmlDataBlob::Ptr by virtue of inferring the type from its stored method. [1]: At least in theory; QQmlThread does not clean up its message list on shut-down so far. Change-Id: I6aaf5a9dcddfd38795059518ca2d3650072bcda3 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QML: Drop backup source code once we're done with itUlf Hermann2022-06-171-0/+5
| | | | | | | | | | | | | If a component is done loading, we don't need the source code anymore. Dropping it makes it possible to unmap any resources it may be part of. Pick-to: 6.4 Fixes: QTBUG-86088 Change-Id: Id523fffb788b5ffa60cb1e7b777328c6648c2a88 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-111-38/+2
| | | | | | | | | | | | 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>
* Add a hook that allows for ahead-of-time compiled functionsSimon Hausmann2020-04-221-0/+1
| | | | | | | | | | | | | Use the unused field in the CachedUnit structure provided by qmlcachegen to allow for providing function pointers for functions and bindings that are compiled ahead of time. Provided is the pointer into an array that is terminated with a {index: 0, functionPtr: nullptr} entry. The array index field in each array entry allows for gaps. Change-Id: I7457f5eea5f14e5f94431b9cc6da042cb03517a0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Prepare for new members in QQmlPrivate::CachedQmlUnitSimon Hausmann2020-04-211-1/+2
| | | | | | | | Pass the address of the entire structure through to the compiler, so that when adding new members we can easily access them. Change-Id: I5da75ba4e64d3e0e750a3ff3df4edbb88cdb6937 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-091-1/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qqmlirbuilder_p.h src/qml/qml/qqmlpropertycachecreator_p.h src/qmltyperegistrar/qmltypesclassdescription.cpp src/qmltyperegistrar/qmltypesclassdescription.h src/qmltyperegistrar/qmltypescreator.cpp src/quick/items/qquicktext_p.h src/quick/util/qquickvaluetypes_p.h Change-Id: Ic209741592e7b85820bf3845722023a190ebc1c5
| * Restore offset/length in QQmlJS::DiagnosticMessageSimon Hausmann2020-03-021-1/+1
|/ | | | | | | | | | | | This is needed in a few places outside of declarative, so this change restores the loc member in DiagnosticMessage and moves QQmlJS::AST::SourceLocation into common's QQmlJS namespace/directory. QQmlError is unaffected and retains only line/column. Amends d4d197d06279f9257647628f7e1ccc9ec763a6bb Change-Id: Ifb9d344228e3c6e9e26fc4fe112686f9336ea2b2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQmlTypeLoader: Prevent trivial cyclesFabian Kosmale2019-09-121-0/+2
| | | | | | | | | | | | | The type loader already contained a cycle check, however it did not work for the attached example. We now do an additional test for A->B->A cycles, which fixes the bug. This is a valid strategy, as in that case the currently resolved type would immediately fullfill the depentency of the type waiting on it, which in turn resolves the only dependency of the current type. Fixes: QTBUG-78098 Change-Id: I8b550a1c240d3d0fbf158beb99a5daf992904cb0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Split qqmltypeloader{_p.h|.cpp} into a several filesUlf Hermann2019-07-111-0/+257
No one can read this mess. Change-Id: Icec4f2afc466435c1ae5e4e80fa2c1b5baf7d087 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>