locale example has no documentation
dynamicscene example does not promote good behavior
Task-number: QTBUG-119117
Change-Id: I782375e2ac50b73535d51a031711222efc15b3ad
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
You cannot use the qmldom example without private API, so it is not
really suitable as a public example. Move it to manual tests.
Change-Id: I365b32c1ba1bf4414e439f16ab7df7ae5643d20f
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Now that we load the QML file from a different resource directory we
have to adapt the resource paths in qmake, too.
Amends commit 69fce1185f.
Pick-to: 6.6 6.5
Change-Id: I25f3e0f1f77ad365426b859c5adc08b429976da3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
We shouldn't use NO_RESOURCE_TARGET_PATH. Instead we can put the
translation into the QML module directory. This highlights that
qt_add_qml_module needs an option for adding translations.
Task-number: QTBUG-116588
Task-number: QTBUG-116589
Pick-to: 6.6 6.5
Change-Id: Ib60ec5eedbb395674fdcb9da8fd00ae2663620cc
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Instead of specifying .ts files, we specify languages now.
The i18n/base.ts file is not supposed to be part of the project. It
serves as template for new translations. See the qml-i18n example's
documentation page.
Task-number: QTBUG-117463
Change-Id: I232c1a856e652fc6a31233e7119a1508fba49987
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Serg Kryvonos <serg.kryvonos@qt.io>
Exclude advanced1-Base-project, advanced2-Inheritance-and-coercion and
advanced3-Default-properties, because of missing Qui and Quick
dependencies.
Task-number: QTBUG-111933
Pick-to: 6.5 6.6
Change-Id: Ia472807f9eda3bd6248ff7515d1ca13bc0bde6cf
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Outdated documention has been removed.
Task-number: QTBUG-111036
Change-Id: I8db138ff71615a6ed6ac4cebdb365c27252fa5ee
Pick-to: 6.5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This allows for more meaningful checks for identical assignment in
Person::setShoe().
Amends: 405bd42998
Pick-to: 6.5
Change-Id: Id731f3f9163fb311ff9b04e2bbf4786a3022a11b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Use e.g. Qt6::Core instead of Qt::Core. This is better matching the
find_package(Qt6 ...) call, and also avoids issues that the versionless
targets have.
Pick-to: 6.5
Task-number: QTBUG-113277
Change-Id: Ib80f885e9f73fb9ad54b9e9b22cae2318877dc07
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
The examples in the "Extending QML" series were often redundant with the
information of the "Writing QML Extensions with C++" tutorial, had
outdated code and sometimes had no documentation. The examples that
covered topics not mentioned in the first tutorial were revamped into a
second "advanced" tutorial extending the first one. The others were
removed. The remaining examples were largely based on the same example
code of a birthday party. This code was slightly adapted and separated
into 7 states, each building upon the previous, with the code change
illustrating the associated feature. A tutorial page, in the style of
the first one, was added documenting the different QML features and
the required code changes in the example project.
Links in the documentation from and to the affected pages were update
as best as possible.
Pick-to: 6.5
Fixes: QTBUG-111033
Change-Id: I9d97e8b32b128c1624d67525996fa14d493909d3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
The loadFile overload (in DomItem, DomEnvironment and DomUnivers) for
different files (in-memory files and files that needs to be loaded from
disk) are either copypasted or just calling the other overload.
Encapsulate the file-related arguments of all loadFile overloads into a
new struct called FileToLoad, such that the copypasted overloads can be
removed. Use the static factory function FileToLoad::fromMemory and
FileToLoad::fromFileSystem to create the FileToLoad struct.
In addition, FileToLoad allows to specify the environment in which a
file should be loaded. Prior this commit, myEnv.loadFile() was creating
a new environment for each loaded file.
Change-Id: I3b6acb681cb77faefdaa447d985bdfbe4f6a9ce2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
We did not document it anywhere, the code is rather dated, and if we
want to promote QML as a scripting engine/an interpreter, we would need
to invest quite a bit more effort into a showcase.
Thus, remove the example for now.
Pick-to: 6.5
Task-number: QTBUG-110649
Change-Id: Ie23b26379e7ea72271d793a6928a3757cde2cb12
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
The XmlHttpRequest is poorly documented, and should have its own
documentation page, instead of being part of the qml global object page.
The XmlHttpRequest example might as well be converted to a snippet, that
can be present on the new doc page.
Fixes: QTBUG-110003
Pick-to: 6.5 6.5.0
Change-Id: I0ffee43046d4fb71e64f04008b444e11dc8b21ff
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Instead of linking the example to a standalone build, link it
directly to a normal (=non-standalone) Qt qmldom library.
Link the qmldomloadeditwrite example to the qmldom library (instead of
including the qmldom library as a subfolder in the CMakeLists.txt) and
fix the includes to point to <QtQmlDom/private/<headers>_p.h>.
Change-Id: I6f20ac51199d89b4b3ca03b34e090ac6e495715f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Every instance of AUTO_RESOURCE_PREFIX has been replaced by either
qt_standard_project_setup(REQUIRES 6.5) or with
qt_policy(SET QTP0001 NEW), mainly in tests.
In addition, I added a warning message for the case where
AUTO_RESOURCE_PREFIX is used.
Pick-to: 6.5
Task-number: QTBUG-96233
Change-Id: I323a15e9d0bb5fe6ba649365314af9fc2ad67bda
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Instead of fetching data from the view, we should rather fetch it from
the model, which avoids a bug with casting when the currentItem is null.
Use the opportunity to use a typed list for the model instead of a plain
JS array.
Original-patch-by: Kai Köhne <kai.koehne@qt.io>
Pick-to: 6.4 6.5
Change-Id: Ib23fb31b3d0a2c309c98bf762cea1a8c05080c38
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Writing AUTO_RESOURCE_PREFIX in every qt_add_qml_module call seems
rather pointless.
In addition:
- Add documentation for QTP0001.
- Adjust some of the examples to use QTP0001 policy.
- Improved the error message.
Pick-to: 6.5
Task-number: QTBUG-96233
Change-Id: I6e19a491acba97493893bf1953fca3462296c1ea
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Also, drop all the VERSION 1.0 lines from the examples and tests. 1.0 is
actually a bad default version since it's before all the Qt versions.
[ChangeLog][QML] You can now omit the VERSION argument to
qt_add_qml_module(). This will automatically generate the highest
possible version.
Pick-to: 6.5
Task-number: QTBUG-99146
Change-Id: Ic10ec69b87c224e0e94e1785f65653815d4c778c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Describe the use of qsTr() and QQmlApplicationEngine, as well
as the CMake qt_add_translations command.
Task-number: QTBUG-110009
Change-Id: I7d2244a772fdb132acdb5f9f66294a7d772e0d36
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Running qmllint on extending-qml examples raises a plenty of warnings
due to a missing dependency declaration to QtQuick. Simply add it. Also
add FINAL to all properties exposed from C++ to disable (possible) property
shadowings.
Pick-to: 6.4 6.2
Fixes: QTBUG-106602
Change-Id: I7b12a804f8f3ca64bd8f2f312a9e53dfe02b0a4c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Currently, it's rather hard to find the documentation on how to write
attached properties. The page that gets found first in most search
engines seems to be the example - so link from it to the actual
documentation pages.
Pick-to: 6.2 6.4
Change-Id: I78c9949d62863b5c11ffcd97413084ab03b0bc33
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
We need to deploy qmldir to make the example work also for remote targets.
Pick-to: 6.4 6.3 6.2
Change-Id: Id0b7bf4a48bd163ddf5e44a5a68ca3edbbcc008e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
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>
Examples that don't explicitly set NO_RESOURCE_TARGET_PATH get the
AUTO_RESOURCE_PREFIX now.
Task-number: QTBUG-103452
Change-Id: I6b41e96ce5620079f60ca2f967b0a2e611c1f738
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Sami Shalayel <sami.shalayel@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>
The header file has two snippets with the same id. Rename to unique
values and link to the correct snippet id from the qdoc file.
Fixes: QTWEBSITE-1051
Pick-to: 6.3
Change-Id: I9003916f831898026f520fd86d60ab1c0230e6c4
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
It shouldn't be "dynamicscene" as that URI is already used by a
different example.
Change-Id: I35ac6b7ea70703f24304f640252f922d6a5b2371
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
- Revise grammar
- Fix so that example project can be built from the command line using
CMake
- Add tabs on example page
Pick-to: 6.3
Task-number: QTBUG-102330
Change-Id: Ic6bdcadec66850f5e811dcaac23a8cb59a6c3f94
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Use VERBATIM option to prepare the correct command line for the
add_custom_command. This especially sensitive when using build
directories with names containing special symbols, that cannot be
handled by shell correctly.
Change-Id: Ic6ea2a557fe4e7ccc1d2a0c5c4ab707223c0b91a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
qml-i18n needed to be ported to CMake first. It uses qt_add_translations
introduced in 6.2
As a drive-by, move find_package calls from examples' CML to the top
level CML, and make the QtSql dependency optional. Also make sure that
we only add the dynamicscene example when the Quick target is available.
Pick-to: 6.2 6.3
Fixes: QTBUG-90964
Change-Id: Id357eb14e4704753386e01393300966eb89b4e86
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
- Remove # generated from xyz.pro comment from pro2cmake
- Remove "# special case" markers for pro2cmake
- Remove automatic use of CMAKE_AUTORCC
- Only opt into CMAKE_AUTOUIC if .ui files are involved
- Remove explicit setting of CMAKE_INCLUDE_CURRENT_DIR
- Combine multiple find_package(Qt6 ... calls)
- use REQUIRED COMPONENTS
- sort components alphabetically
- Fix wrong indentations
- Use (only) one empty line after multi-line commands
Pick-to: 6.3
Change-Id: I0d6bfb06c4b25e9921d3d2bf31d977150f12b31b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Internally they've been called "value types" all along. Now that we are
adding the ability to define your own value types the "basic" name is
not really fitting anymore. Value types can be quite complex.
Change-Id: I5fb4abec1dd2f0bbf7fb7f08b02db0882490e983
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
load and rewrite example using the standalone build of the dom and
compiler libraries
Change-Id: Ib7823712aea2164291c21b07956dcec734bc9542
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
- Use member initialization, which allows for using
constructors from the base classes
- Use qsizetype for indexes
- Use qInfo() instead of qWarning() for printing
- Add spaces/fix formatting
Pick-to: 6.2
Change-Id: Iebce1b810ce00f29395207d93303363b3b71e52e
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
We deprecated qmlscene in a9c93e2716
so we should stop recommending it in docs, too.
Task-number: QTBUG-53219
Pick-to: 6.2
Change-Id: Ic729624a8ef849bd13f38087e20b5a410c5c5756
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
The XmlHttpRequest example contains a lot of unnecessary code, and I
felt that most of it could just be removed.
The point of the example project is to showcase how to use the
XMLHttpRequest javascript object to make requests.
Which is why I felt that we could remove any outside dependencies for
the project (like the LauncherList from the 'quick/shared' directory),
and reduce the amount of components down to the minimum.
Fixes: QTBUG-95734
Pick-to: 6.2
Change-Id: I9b062f4d7e942db4a2669a8c65f7488aa4a54740
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>