Commit Graph

37 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 1b9808737a Change the license of all CMakeLists.txt and *.cmake files to BSD
Task-number: QTBUG-105718
Change-Id: Id89ed14990804a5024183e75382cc539d4293da1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-09-07 17:01:30 +02:00
Alexandru Croitor eed7b3f4e7 CMake: Don't use PUBLIC_LIBRARIES for executables
Change-Id: I346ea4eac1dfbfb7fb81609307f5f7c4716bb8d1
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-07-21 13:19:04 +02:00
Lucie Gérard 5a7b716474 Add license headers to cmake files
CMakeLists.txt and .cmake files of significant size
(more than 2 lines according to our check in tst_license.pl)
now have the copyright and license header.

Existing copyright statements remain intact

Task-number: QTBUG-88621
Change-Id: I72c89a98c42bbc9234d8495e9e503bec81d11037
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-07-08 10:41:06 +02:00
Ulf Hermann 6aad465f08 Introduce a sane resource path to qt_add_qml_module
Since "/qt" is reserved, we can use "/qt/qml" as the default path for
user QML modules.

[ChangeLog][QtQml] The AUTO_RESOURCE_PREFIX option was added to
qt_add_qml_module(). It places your QML modules in the otherwise
reserved resource directory /qt/qml. This directory is also added to the
default QML import path. By using it you don't have to specify custom
import paths anymore. Specifying neither AUTO_RESOURCE_PREFIX nor an
explicit RESOURCE_PREFIX will generate a warning now because such QML
modules are likely invisible in the resource file system.

Fixes: QTBUG-95145
Fixes: QTBUG-103452
Change-Id: Ie27dec5cbf34ea06258d55c659d202cdd61e54b2
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2022-06-23 09:35:57 +02: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
Joerg Bornemann 0d6d3c7bc5 Skip unnecessary commands when cross-building tools
Call qt_internal_return_unless_building_tools() directly after
qt_internal_add_tool() to avoid having to special-case code for when
this function only creates imported targets in cross-builds.

Task-number: QTBUG-85084
Change-Id: I5c8f2ecdf4936cfd15cb530e896bc4e5b5531620
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-10-08 10:37:35 +02:00
Craig Scott 73c76005e6 Add NO_PLUGIN option to qt6_add_qml_module()
The new option allows the caller to state more clearly that they do not
want a plugin at all. Previously, the NO_CREATE_PLUGIN_TARGET option
had to be given to prevent the command from trying to create a plugin
target, but that option is meant for when the project will create the
plugin target later.

Now that the caller has a way to explicitly say they don't want a
plugin, require PLUGIN_TARGET to be given if NO_CREATE_PLUGIN_TARGET
is present. This forces the project to provide the name of the plugin
target that they will be responsible for creating.

Fixes: QTBUG-95141
Pick-to: 6.2
Change-Id: I84e036074f3e2785f17a8d33ad87ee0b7e016173
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-08-03 12:28:56 +10:00
Craig Scott 1c4ba17015 Refactor and update qml CMake API
The existing CMake API for qml modules had a number of
shortcomings. Refactor it to achieve the following:

- Clearly separate public and internal aspects.
- Re-use code from qtbase for adding plugins and module
  targets rather than reimplementing close variations.
- Provide more robust and complete support for qmllint,
  qmlcachegen and automatic generation of qmldir files.
- Reduce the steps needed for more common scenarios.
- Encourage the use of separate backing library and plugin
  targets.
- Automatically generate the plugin class .cpp file where
  possible.
- Specify .qml files directly through qml-specific API
  elements rather than assuming they can be extracted
  out of a set of resources.

[ChangeLog][QtQml] The qml CMake API has changed from 6.1
and is now out of Technical Preview status. The most
notable change is that .qml files should no longer be
specified as resources, there is dedicated handling for
them in the qt6_add_qml_module(). A related change is
that the qt6_target_qml_files() command has been replaced
by qt6_target_qml_sources(). More complete integration
with qmlcachegen, qmllint and qmldir generation is also
part of the CMake API.

Fixes: QTBUG-91621
Task-number: QTBUG-82598
Task-number: QTBUG-88763
Task-number: QTBUG-89274
Task-number: QTBUG-91444
Change-Id: I25aae1b0e89890394dfe2ba2824008164b2ca8d9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-06-04 16:54:52 +10:00
Craig Scott 63a601dc29 CMake: Remove unneeded *.pro and .prev_CMakeLists.txt files
The .pro files corresponding to the .prev_CMakeLists.txt files
have already been removed.

Change-Id: I254eafe4c7de1a516e33bd9cb3d9879e73fa83b4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-05-19 10:46:06 +10:00
Ulf Hermann 4cc91a6a0e Use functions as signal handlers when accessing parameters
Injected signal handlers are bad practice because they aren't declared.

Pick-to: 6.1
Task-number: QTBUG-89943
Change-Id: I3a691f68342a199bd63034637aa7ed438e3a037b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-12 10:30:20 +00:00
Fabian Kosmale 78ab4b8d8b Remove the qmake project files
Remove all qmake project files, except for examples which are used to
test that qmake continues to work.

Change-Id: Ic4abb72dc2dcd75df7a797c56056b6b3c5fe62ac
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-01-15 15:34:22 +01:00
Marianne Yrjänä ad0eaad7a1 Don't set properties on a host tool when cross compiling
Task-number: QTQAINFRA-3768
Change-Id: I2e2491e948e996921c068384012e689ab0762a76
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-01-15 16:33:10 +02:00
Li Xinwei e6e262da14 Use load(qt_tool) and qt_internal_add_tool for qmltime
The qmltime should be a tool, not a normal executable or an app.

Pick-to: 6.0 5.15 5.12
Change-Id: I64c76877907297a6a817ba5903786bcc7fba8fdd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-12-08 02:34:59 +08:00
Alexandru Croitor 08adbefa13 CMake: Regenerate projects to use new qt_internal_ API
Modify special case locations to use the new API as well.

Task-number: QTBUG-86815
Change-Id: I3b964e3baf0cc7040830156dac30358ea1152801
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-10-06 13:19:37 +02:00
Alexandru Croitor a7c7e7ceaa CMake: Don't install .qmltypes for Qt tests, examples and tools
that don't have an explicit QT_QML_MODULE_INSTALL_DIR path
specified. We don't want to pollute the Qt qml import path with
these files.

Task-number: QTBUG-84403
Change-Id: I768267e0e79daa8090d882c301648cce14e1a809
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-05-29 10:01:40 +02:00
Alexandru Croitor 14492ecee2 CMake: Regenerate and adapt to merge from dev
Change-Id: If8daa6152a563d4309d7342414780ef75b9f5589
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
2020-03-12 14:05:23 +00:00
Alexandru Croitor 26c5243491 Merge remote-tracking branch 'origin/dev' into wip/cmake
Conflicts:
	dependencies.yaml
	src/qml/qml/qqmlengine.cpp

Change-Id: I6a73fd1064286f4a2232de85c2ce7f80452d4641
2020-03-12 15:03:03 +01:00
Ulf Hermann aa20222e84 Tools: Convert to static type registrations
qml and qmltime were still using qmlRegisterType() for some internals.
Let's get rid of those.

Change-Id: I68c0e7213f3b5b28670364c4db1cdec41d299b7d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-02-20 15:08:29 +01:00
Alexandru Croitor ba494aaa24 Regenerate all projects with new CMake API version
Change-Id: Ie0db35f674137c229eaf049616f38f8e818f7092
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-15 12:24:51 +00:00
Alexandru Croitor e9cac99f37 Regenerate projects
Change-Id: I38044c382e4d84b5865a19cdd04cc8922bd72a77
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-14 10:22:26 +00:00
Alexandru Croitor c2f8b9535d Merge remote-tracking branch 'origin/dev' into wip/cmake
Removed dependencies.yaml because we don't use it yet in wip/cmake.
Fixed conflict in qmlcachegen.cpp.

Change-Id: Ie1060c737bee1daa85779903598e5b6d5020d922
2019-10-14 19:02:37 +02: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
Alexandru Croitor 13374ceb16 Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
Change-Id: I2963c1209316fb6755f572969f368970450d7991
2019-07-11 17:24:39 +02:00
Alexandru Croitor 5a3e668533 Port the declarative tools
Also fix up QmlDevTools module to not depend on QtQml,
but instead make it include the headers / cpp files as it is done
in the qmake project.

Change-Id: I240c52d5357db150a7c0c819892fb0a3708ceee4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-06-08 08:22:42 +00:00
Edward Welbourne 6d5a0a55d8 Convert uses of QTime as a timer to QElapsedTimer
Change-Id: Ia34d3980e48d2978c8c77e65b1ee2aa7f71fd985
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-06-12 18:32:50 +02:00
Shawn Rutledge 499ec43937 use nullptr consistently (clang-tidy)
From now on we prefer nullptr instead of 0 to clarify cases where
we are assigning or testing a pointer rather than a numeric zero.

Also, replaced cases where 0 was passed as Qt::KeyboardModifiers
with Qt::NoModifier (clang-tidy replaced them with nullptr, which
waas wrong, so it was just as well to make the tests more readable
rather than to revert those lines).

Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-02-26 07:13:18 +00:00
Kai Koehne fc3f8766d5 Adjust QMAKE_TARGET_PRODUCT, QMAKE_TARGET_DESCRIPTION
The product should be Qt5 (the default). The QMAKE_TARGET_DESCRIPTION is
actually less than a description but a beautified name, that is shown
e.g. in the task manager, crash reporting tool etc. Make it title case,
like most Windows applications do.

Change-Id: I570aee2c2016e78fdb7a93c2d7a66b70fdcb0cff
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-07-28 10:57:06 +00:00
Kai Koehne 11a664a752 Remove custom setting of qmake VERSION field in tools
qt_tool.prf sets the VERSION to MODULE_VERSION by default. Also,
qmake automatically makes it a quadruple for the .rc file metadata.

Change-Id: Ie2d0f2022c4416ce824a6786eef4a8c461ed70f1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-07-28 10:41:43 +00:00
Liang Qi b1fa22c168 Merge remote-tracking branch 'origin/5.8' into 5.9
Conflicts:
	src/qml/compiler/qv4ssa.cpp
	src/quick/accessible/qaccessiblequickview_p.h
	src/quick/items/qquickmousearea.cpp
	src/quick/util/qquickanimatorjob.cpp
	tools/qmlplugindump/main.cpp

Change-Id: I84474cf39895b9b757403971d2e9196e8c9d1809
2017-02-24 11:48:14 +01:00
Friedemann Kleint dc0a7d7021 Tools: Add product name, version and description to the .pro files
This information will then be visible in Windows explorer.

Change-Id: I9d2f936584308394b4e3246d57bed44083b3cbca
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
2017-01-31 08:44:36 +00:00
Robin Burchell 1d6bdb6ba0 qmltime: Reject 0 iterations
Causes a divide-by-zero. Low risk, but let's fix it anyway.

Coverity-Id: 161333
Change-Id: I7631abdca469a5dd9e2becf32cc9aa4f5cf515dc
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-01-18 17:53:50 +00:00
Friedemann Kleint 05e3cdd8ab Set Qt version on tools
Change-Id: I21d77b2eba7107528fc00db0cf5d87f8347b63be
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2016-11-09 09:18:44 +00:00
Liang Qi 68ba8fe3cc Merge remote-tracking branch 'origin/5.6' into 5.7
This change also fixes the build of two benchmarks, tst_affectors
and tst_emission.

Conflicts:
	src/plugins/qmltooling/qmldbg_native/qmldbg_native.pro
	src/qml/qml/ftw/qhashfield_p.h
	tests/benchmarks/particles/affectors/tst_affectors.cpp
	tests/benchmarks/particles/emission/tst_emission.cpp
	tests/benchmarks/qml/pointers/pointers.pro
	tests/benchmarks/qml/pointers/tst_pointers.cpp
	tests/benchmarks/qml/qmltime/qmltime.pro
	tests/benchmarks/qml/qquickwindow/qquickwindow.pro

Change-Id: I595309d1e183c18371cb9b07af6e4681059de3b2
2016-04-08 13:03:25 +02:00
Simon Hausmann 1a52f28bdf Add benchmarks to the "make benchmark" targets that are known to work
The qjsengine benchmark is one exception that is omitted because it crashes currently.

Change-Id: Ic93344dc864d0d6427d85faa12a2753126be808e
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-03-17 13:22:44 +00:00
Robin Burchell b4f476cf23 qmltime: Remove deprecation define.
Not needed, qmltime uses no deprecated stuff.

Change-Id: I349993b4974857d947ea014bedfc544aaf7c682c
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-03-15 08:20:38 +00:00
Robin Burchell c19590f720 Move qmltime out of benchmarks directory.
This is a tool, not a benchmark.

Change-Id: Ie6b4452a1235923e1663a8a525ddad8408d21545
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-03-15 08:20:36 +00:00