Commit Graph

12 Commits

Author SHA1 Message Date
Ulf Hermann 03d58031c7 Remove all QML_DECLARE_TYPE from src and tools
They are generally not useful for anything.

Change-Id: I12e959ce9338e6eb7465633496c7921fa09a3fe8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-11-18 07:37:33 +00:00
Lucie Gérard 0dc4fd240a Use SPDX license identifiers
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>
2022-06-11 08:05:15 +02:00
Ulf Hermann fda7978c20 Fix life cycle methods for some QML-exposed types
Follow the rule of 5: Drop empty dtors, and add Q_DISABLE_COPY_MOVE
where we do need an explicit dtor.

Change-Id: Icbb9d87e1087c69b1cf1f18062a496c148935783
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-07-14 15:10:45 +02:00
Ulf Hermann 1f8858cf7f Privately export all QML-exposed types
We need to be able to access them from C++.

Pick-to: 6.2
Change-Id: I2b7b823cbb36866240d194e877a3dd49f5d2f350
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-07-13 09:00:54 +02:00
Qt Forward Merge Bot d51d5ff3c1 Merge remote-tracking branch 'origin/5.15' into dev
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
2020-03-09 09:58:49 +01:00
Ulf Hermann 8dd1885071 Revision properties and methods added in 5.15
Change-Id: I00e3f9535e819d9d0d547c9d3cf50be469cf9339
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-02-27 09:34:20 +01:00
Ulf Hermann ddde036f6a Add major version to all Q_REVISIONs
Change-Id: Id72fbe10c16de61bd847773d0055d83cfe03f63c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-02-19 15:48:27 +01:00
Ulf Hermann ac46c9f6ce Synthetically reference type registration functions
Add unused volatile pointers to the type registration functions in each
import plugin. We need to do this in order to prevent the linker from
optimizing the registration away. There are two ways for this to happen:
When linking statically, the linker will examine the referenced symbols
on a per-object base and leave out all unreferenced objects. When
linking dynamically, the linker may do the same on a per-library base
and drop any unreferenced libraries from the dependencies. Forcing a
reference to the type registration function prevents both.

The volatile technique allows us to remove the previous qCDebug() hack.
Having an unused volatile auto variable should only result in a single
memory read as runtime overhead. The qCDebug() technique would generate
a read and a block of mostly dead code (as no one would ever use that
logging category).

Fixes: QTBUG-81622
Change-Id: I255667276dfd355b19baa17b1aad3db406bf1954
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-02-04 11:07:15 +01:00
Ulf Hermann 172d12c7a6 Force models and workerscript plugins to link their libraries
Some linkers can determine that we don't use any symbols from the
QtQmlModels and QtQmlWorkerScript libraries in the respective plugins
and avoid to link the libraries into the plugins. That means, when
loading the plugins, the types are not registered. We avoid that by
adding a debug message that accesses a symbol of the library to each
plugin.

Change-Id: I3d946259df96382a3751eaafa12cbdd3d830c139
Fixes: QTBUG-81721
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-01-30 12:43:33 +01:00
Maximilian Goldstein 3c4247e1e0 src/qmlworkerscript: Add ready property to WorkerScript
Previously it was impossible to determine whether a WorkerScript has
been fully initialized. This commit introduces a ready property that
allows outside Components to determine whether it is safe to send
signals.

Fixes: QTBUG-80413
Change-Id: I2a1892b5e759e317de791e71d79fbb0cbd320dd3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-12-06 14:32:16 +00:00
Ulf Hermann cc1a604c70 Specify parameters of type registration in class declarations
Using this technique we can automatically register all necessary
revisions and minor versions of a type, using the metaobject system.
This greatly reduces the potential for mistakes and resulting
incompatibilities between versions of imports.

We assume that for each type we need to register all revisions of its
super types and its attached type, and that the revisions match. That
is, if you import version X of type A, you will also get version X of
its attached type and of any super types. As we previously didn't take
these dependencies into account when manually registering the types, a
number of extra revisions are now registered for some types.

Potentially, we can now generate the qmltypes files at compile time,
using moc.

Change-Id: I7abb8a5c39f5e63ad1a0cb41a783f2c91909491b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-09-26 12:32:17 +02:00
Ulf Hermann 5032ff5c2b Move workerscript to its own module
Change-Id: I778cfe842ddf1c600a837d8f2061a338887eed95
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-05-06 07:15:20 +00:00