Commit Graph

1734 Commits

Author SHA1 Message Date
Ulf Hermann 485416c9d5 Fix delegatechooser example to use QML modules
We need to rephrase the image source selection due to ListElement only
accepting literals. We can't just poke into the qrc file system of the
"shared" module without importing it.

Pick-to: 6.2
Change-Id: I54d3fa4daf304afc9a0a55ab8b590d9c5ad20aa2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-09-06 11:03:09 +02:00
Ulf Hermann be260ba529 Fix dynamicscene example to use a QML module
Pick-to: 6.2
Change-Id: I23b87b8ca98721cebc0dc948f0c9bbf741af6cd5
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-09-04 08:48:15 +02:00
Ulf Hermann a57d3a0beb Fix the canvas example to use a QML module
Pick-to: 6.2
Change-Id: I84445909adafbd2cf0f5654fa78a005ed243536f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-09-04 08:47:17 +02:00
Ulf Hermann 65b2e46423 Fix animation example to use a QML module
Pick-to: 6.2
Change-Id: Ic53194b43eb651438d3f89bbb5dfbb97aff8b606
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-09-04 08:47:07 +02:00
Ulf Hermann e11c320029 Update text example to use QML modules
Pick-to: 6.2
Change-Id: If1c8455aa823eb432f10586bdb31a65166ed915d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-09-04 08:46:56 +02:00
Ulf Hermann 23ddc51e5e Fix threading example to use QML modules
Pick-to: 6.2
Change-Id: I973244a0546e668ba8c65e573747e08f60a506c0
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-09-04 08:46:37 +02:00
Oliver Eftevaag 34bc389543 Fix ImageElements example to use a QML module
Removed the 'content' directory, and placed all images into a 'pics'
directory.

CMakeLists.txt is now also using qt_add_qml_module()

Pick-to: 6.2
Change-Id: I673b7adea1832f304003f95e171118b0822b3c83
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-09-03 17:10:32 +02:00
Ulf Hermann 633a85cd39 Install the "shared" example module into macOS bundles
If we build an application bundle we cannot rely on the relative path
between the application's and the shared module's output directories.

This is somewhat ugly, but as we don't have a comprehensive solution for
building application bundles, yet, it's the best we can do right now.

In order for the shared bundle to be loaded from the PlugIns directory,
we need to add the PlugIns directory to the import path on macOS.

Pick-to: 6.2
Change-Id: I5b952420b4bb60af74886a140fa2c6a263d2f730
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-09-03 13:04:55 +02:00
Craig Scott 920a5f727b Fix top level builds where AUTOMOC_EXECUTABLE was unset on some targets
The qt_example_build_end() command tries to recursively find all build
system targets by descending into all source directories. Some sets of
examples re-use the same source directory multiple times with different
build directories, but this hides all but one of those re-used source
directories from the recursive search. This resulted in some targets
being missed, which in turn prevented qt_autogen_tools() from being
called on them. In top level builds, this meant AUTOMOC_EXECUTABLE
wasn't set, so CMake tried to verify the moc it wanted to use, which
doesn't exist for the first configure of a top level build, resulting
in a fatal error. Since we can't find all targets reliably with a
recursive search, manually handle the ones that could be missed.

There was a similar problem with qt_autogen_tools() not being called
for a target created to compile a doc snippet. The error message is
the same as the case above, the cause is again AUTOMOC_EXECUTABLE
not being set, but for a different reason. Apply the same fix and
call it manually, which should have been the case originally.

Fixes: QTBUG-96118
Fixes: QTBUG-96159
Pick-to: 6.2
Change-Id: I079c696cf74f77d7caa2c59e6263d3fb1c55d20e
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-09-03 19:37:06 +10:00
Oliver Eftevaag 713bb3ce8f Clean up flipable example
Turning the project structure to be inline with Ulf's ideas.
Such as using qt_add_qml_module().

Previously the path to 5_heart.png and 9_club.png were broken.
This patch updates the path in the qml file, in order to make sure that
the resource is actually loaded.

It also adds a CMakeLists.txt, since it didn't already have one.

Pick-to: 6.2
Change-Id: I4b2ffbfcfff7d2d63d7aab9fd7b40f77c1a1073c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-09-03 10:52:09 +02:00
Oliver Eftevaag 5d751f3ce6 Simplify the XmlHttpRequest example
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>
2021-09-03 10:39:37 +02:00
Oliver Eftevaag b0e567e7e3 Fix localstorage example to use a QML module
Removing the directory 'localstorage' that is inside the top-level
'localstorage' directory, and moving the content one level up in the
file hierarchy.

Pick-to: 6.2
Change-Id: I97cf1ff92be9860d9a92bce66c88af927618e2b0
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-09-03 10:39:22 +02:00
Topi Reinio 5e6777be1d Doc: Fix documentation warnings in qtdeclarative
* QtLabsPlatform has its own documentation project, but its source
  directory was pulled into QtQuick docs, causing duplicate generation
  and warnings.

* Fix \snippet paths for files that were renamed/moved around.

* Clean up .qdocconf files, use the {,} syntax to set identical values
  for multiple variables.

* Fix incorrect \sa link.

Pick-to: 6.2
Fixes: QTBUG-96125
Change-Id: I4c83787ac23a5b40019c74d46ee87c968a8d4907
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2021-09-03 10:16:39 +02:00
Craig Scott 2e04ba2994 Disable quick examples currently breaking top level builds
The add_subdirectory("../shared" "shared") pattern used by these
examples seems to somehow trigger an AUTOMOC-related generation error.
The cause is not currently known, so this change temporarily disables
those tests until a proper fix can be found.

Task-number: QTBUG-96159
Change-Id: I2525b77d0a25c3e3191ae2956857acabc0aedbf5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit d83c303b95)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-09-01 21:28:34 +00:00
Shawn Rutledge 270a6f9bba Rename shapes example qml files according to what they demonstrate
The order they are shown in the grid is not important; but users should
be able to run any of these qml files directly without building the
example, and appropriate names make the "right one" easier to find.

Task-number: QTBUG-95739
Pick-to: 6.2
Change-Id: I9751b52ce80bc08e12919ca3396c9d428d700a04
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-09-01 18:11:54 +02:00
Ulf Hermann 2dfb912058 Fix dialcontrol example to use a QML module
Also move the QML files out of the "content" subdirectory in order to
avoid the directory import.

Pick-to: 6.2
Change-Id: I84a1f5ef1a45e5098ec3213c6fbce06346f3606a
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-09-01 11:49:15 +02:00
Ulf Hermann 66c011c558 Clean up shapes example
Drop the confusing alias mangling on all the QML files. Instead move
them into the base "shapes" directory. Also, use a QML module in CMake
and use the "shared" module as intended.

Pick-to: 6.2
Change-Id: I6a8fc3f2b2f86f58a54e188cf83ec7e2d4e8f468
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-09-01 11:49:06 +02:00
Oliver Eftevaag 9556a46743 Fix ExternalDragAndDrop example to use qt_add_qml_module()
Pick-to: 6.2
Change-Id: Ic368ce6e36ee41aff519a3ae106d18670c05bb54
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-08-31 23:19:51 +02:00
Ulf Hermann c10427bc04 Convert dynamicview tutorial to use QML modules
Pick-to: 6.2
Change-Id: I98069eea1bd4492aba661e4672ffe297f0dcc4c8
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-08-31 23:19:51 +02:00
Ulf Hermann 255d8a84b3 Fix shadereffects example to use a QML module
Pick-to: 6.2
Change-Id: I3787fdfebfa1e376c2891f16f3fcf4f29f0e26d4
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-08-31 21:20:14 +02:00
Ulf Hermann 405bbc1c0e Remove .prev_CMakeLists.txt
We don't need to use pro2cmake anymore here.

Pick-to: 6.2
Change-Id: Iba8bac70c1fe31e56bf9680608913cc2c336f946
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2021-08-31 11:26:11 +02:00
Oliver Eftevaag 71a781beb1 DynamicView4 tutorial: add forgotten file to qrc
The FileSelector.qml component for some reason were never added to the
qrc file, which meant that it didn't exist in the eyes of qmake.

It should now be possible to run the program.

Pick-to: 6.2
Change-Id: Iaab67860123e926456c99b775449648f5d8e7c3c
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2021-08-31 11:26:10 +02:00
Ulf Hermann a3ea7a9938 Fix samegame example to use QML modules
In this case it really makes no sense to use a shared directory because
we want to show the progressive changes between the different versions.
It's actually important to note that we're adding the pictures one by
one. Therefore, the shared directory is dissolved and the pictures added
duplicated into the respective versions of samegame.

Furthermore, moving the code into a "content" directory is a bad idea
because it complicates the import logic. We don't want to make the
"content" directory its own QML module. We might move samegame.qml into
the "content" directory, too, and apply some path wrangling to make it
work, but it's really not worth it here.

Pick-to: 6.2
Change-Id: Ifc45f48832596377c21bc6ef55e918ef487bc94e
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-08-31 11:26:10 +02:00
Alexandru Croitor 9cbf4d2cc8 CMake: qmake: Fix chapter6-plugins example to build in more configs
Before this change, I tested the following configurations / scenarios

 (1) shared Qt + qmake + macOS bundle -> works
 (2) shared Qt + CMake + macOS bundle -> broken
 (3) static Qt + qmake + macOS bundle -> broken
 (4) static Qt + CMake + macOS bundle -> works

 (2) was broken because the shared qml plugin is not located in the
 expected location (see below)
 (3) was broken because qmake needs a lot of error-prone boilerplate
 to ensure static qml plugin building and linking works.

The change fixes the example to build and run successfully in case
(2).

Tested the following scenarios on macOS with the change

  shared Qt + qmake + macOS bundle -> works
  shared Qt + CMake + macOS bundle -> works
  shared Qt + qmake + no bundle    -> works
  shared Qt + CMake + no bundle    -> works
  static Qt + qmake                -> still broken
  static Qt + CMake                -> works

To make shared qml plugins be found in a macOS bundle, we need to copy
the qmldir and plugin under the bundle's PlugIns subfolder, because
the application adds that as the expected qml import path for macOS.
This basically mimics what the qmake project does with
QMAKE_BUNDLE_DATA.

The change also cleans up the CMake projects a bit so they don't link
PUBLIC-ly against dependencies, install the plugin under a more
sensible location and don't needlessly setup package finding and other
boilerplate that's done in the parent project.

The change also cleans up the qmake projects to adjust to not pollute
the macos bundle dir with static plugin files.

Amends 9e1d2a0eb1

Pick-to: 6.2
Change-Id: I45bb699a67adf598587350a03f778291fad3f850
Reviewed-by: Craig Scott <craig.scott@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-08-31 14:51:25 +10:00
Craig Scott 784af37650 Fix warnings/errors from changes to paths in chapter6-plugins example
Amends 2d2750efc3b5a97a5f1cf09b4265a26fcc393499

Change-Id: Iab27efb7359cfcea9274dcbbc7ac64b647d3e71b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-08-31 14:51:22 +10:00
Laszlo Agocs d5700949ff Migrate to fixed add_shaders prefix handling
Change-Id: I6c5b0680d32bc3650983c64cc4583f790774da88
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-08-30 20:56:30 +00:00
Oliver Eftevaag 9454685db8 Add qsTr() around 2 strings in imageelements example
Making some strings translatable

Change-Id: I7a088e9e9966996ee20ab8bee29cf17c060120d7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-08-30 22:56:29 +02:00
Ulf Hermann 76a413bb11 Fix touchinteraction example to use QML modules
Remove the "content" subdirectories. They just add noise.

Pick-to: 6.2
Change-Id: Iae6bf7d91b6804294673be8966e30b11caae0654
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-08-30 20:34:57 +02:00
Ulf Hermann cb9cc7ca66 Update views example to use modules
The qmake and qmlproject files are adapted to use the "shared" module,
too.

Pick-to: 6.2
Change-Id: I5fc4895416357ba202528b155581b1b5a880a68d
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-08-30 20:34:49 +02:00
Ulf Hermann 7b6eea37ae Fix the qtquick/window example to use QML modules
The shared code becomes its own module. Due to the ${PROJECT_NAME} trick
it should be possible to include it multiple times, in different
examples.

Pick-to: 6.2
Change-Id: I78cc3211f67fae9a713320fae4041898e6a397ed
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2021-08-30 20:34:43 +02:00
Oliver Eftevaag 621e583f05 Fix coding style
Pick-to: 6.2
Change-Id: Icfcdcb306dbeb750c8ebad44b431c5364ef63c44
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-08-30 15:01:16 +02:00
Oliver Eftevaag 9e38f4da96 ShaderEffects example: replace custom slider with qqc2
Replacing a custom made slider component with a qqc2 slider.

Task-number: QTBUG-95738
Pick-to: 6.2
Change-Id: I407307a3769a0c9821d311189ed40b0d48dab4d3
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2021-08-28 17:25:28 +02:00
Oliver Eftevaag 5ae40afa97 Shapes example: use qqc2 components
Changing the example to use qt quick controls where it makes sense

Task-number: QTBUG-95739
Pick-to: 6.2
Change-Id: Id0df227657693234de4481c2316dc6c3e0545043
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2021-08-28 17:25:03 +02:00
Ulf Hermann 9cb0b528e3 Update the accessibility example to use QML modules
Pick-to: 6.2
Change-Id: Iec3dad42dd08ac230ffde15b422ae7f68d419e81
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
2021-08-27 17:09:50 +02:00
Oliver Eftevaag e771c12ae7 ImageElements example: Use QQC2 and update copyright
Updating the example to use qt quick controls 2 where it makes sense, as
well as copyright headers.

Task-number: QTBUG-95737
Pick-to: 6.2
Change-Id: Ie22ab8551926916abd0a478adc16d1d4daeb13ad
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2021-08-27 17:09:49 +02:00
Oliver Eftevaag dad9a15c9c Replace custom button component with QQC2 buttons
Now that we've moved qtquickcontrols2 into the qtdeclarative submodule.
We want our examples to simply use qqc2 controls, rather than custom
made buttons and other controls.

This example used a custom made button component, which this patch will
replace with qqc2.

It will also use qqc2 in other places where it makes sense, like replacing
a TextEdit with a qqc2 TextArea, and Text components with qqc2 Labels.

Task-number: QTBUG-95733
Pick-to: 6.2
Change-Id: Ic733cd592cd10ef2cf45058aaf08a0f6b2f5bd2c
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2021-08-27 17:09:48 +02:00
Oliver Eftevaag 8976c46f46 ExternalDragAndDrop example: Use controls from Qt Quick Controls 2
This patch changes the external drag and drop example to use qqc2
checkboxes instead of a custom made component.

It also changes the position of the checkbox in order to avoid having
the label text overlap with it.

Task-number: QTBUG-95736
Pick-to: 6.2
Change-Id: If3e798ea0ccd64921138690c7599876ec0584038
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2021-08-27 17:09:48 +02:00
Oliver Eftevaag 409019bc11 EmbeddedInWidgets example: Use QQC2 components
Replaces the TextBox custom component with a qt quick controls 2
TextField.

Task-number: QTBUG-95735
Pick-to: 6.2
Change-Id: Ic1fb47c8e57cd2d805d4a9941df9bc02a5e7bc17
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2021-08-27 17:09:47 +02:00
Laszlo Agocs 266b93c9f8 Use add_shaders with CMake in some examples
Take the most obvious candidates, to which users typically turn
when getting started with ShaderEffect or QSGMaterial:

shadereffects
scenegraph/custommaterial
scenegraph/twotextureproviders

As with the parent patch that ports and updates embeddedinwidgets and
quickwidget/qquickviewcomparison to use the proper CMake machinery, we
still need to keep the .qsb files for the sake of qmake. compile.bat and
similar scripts are however removed now. With CMake the .qsb files are
not needed and are autogenerated at build time. Once qmake support
disappears from the examples, the .qsb files can be removed as well.

Pick-to: 6.2
Change-Id: I879354eef2e2179dcd268c9ae9f1402e1eaef379
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-08-24 13:51:52 +02:00
Laszlo Agocs c7093e553c Port leftover effects in some of the examples
For qmake we have no choice but to ship the .qsb files, whereas with
CMake we now rely on qt6_add_shaders.

Pick-to: 6.2
Change-Id: I9bb64a3ffd01cda84fca5a0f7def270975bf71aa
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-08-24 13:51:52 +02:00
Craig Scott a86fd709dd Update quick examples to new QML CMake API
This is a pre-requisite to being able to make
qt6_qml_type_registration() an internal rather than public command.
Not all examples have been updated, only those that were using the
qt6_qml_type_registration() command.

Task-number: QTBUG-95093
Pick-to: 6.2
Change-Id: I3f1814a29af608461daa90477eca0aa2304eb9d1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-08-24 16:08:21 +10:00
Craig Scott 9e1d2a0eb1 Update qml examples for improved target path handling
Some examples were still using the old "add as ordinary resources"
approach for QML modules, others needed adjustment to the subdirectory
structure to better reflect the URI structure of the QML modules
involved.

Task-number: QTBUG-95144
Pick-to: 6.2
Change-Id: Ie3399410cf6df491eb1e7b4a589ca26c577d82a0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-08-24 16:08:21 +10:00
Shawn Rutledge ca89437d00 Use qEnvironmentVariableIntValue() instead of qgetenv().toInt()
The docs tell us that it's faster.

Pick-to: 6.2
Change-Id: Ib828ed9a10bbb617670a61e7525cbbe25704815d
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2021-08-17 16:14:53 +02:00
Joerg Bornemann b4ab58d791 Raise cmake_minimum_required to VERSION 3.16 in examples
Pick-to: 6.2
Task-number: QTBUG-95636
Change-Id: I9f76b787533dad1c469fbb8c69df6c27b20a9aa3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-08-17 13:48:14 +02:00
Luca Di Sera 6901fb779a Remove deprecation warning from QtQuickControls2 gallery example
In the "Delegates" page of the gallery example the user is allowed to
swipe over the available `SwipeDelegateComponent`s to show a 'remove'
button, which allows the removal of that item from the containing list
when pressed.

When this happens, an animation is played.
In the code, the animation was attached to the signal handler,
as follows:

```
ListView.onRemove: SequentialAnimation {
...
}
```

This form of attachment has been deprecated as of
Qt 6.1.0, in commit 6eb35df60e, in favor of creating a stand-alone
object and calling the relevant slot from the signal handler,
generating a series of warning when the attachment happens
during the creation of the page.

This patch updates the connection to the new format, avoiding
the generation of the warnings.

Pick-to: 6.2 6.1
Fixes: QTBUG-95562
Change-Id: Ib67cb9b8703dad427c49475c00791fdd5d1b0669
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-08-05 09:44:41 +00:00
Mitch Curtis 16436239cd Merge qtquickcontrols2 into qtdeclarative
Task-number: QTBUG-95173
Change-Id: I2cf31e30127e8cc2f10304cabf4ff7f5050633b8
2021-07-28 11:21:25 +02:00
Craig Scott 0c99c17761 CMake: Change the default of OUTPUT_DIRECTORY for qt6_add_qml_module()
The new default is now controlled via a new QT_QML_OUTPUT_DIRECTORY
variable. If that isn't set, the fallback assumes the source directory
structure follows the URI structure and uses
${CMAKE_CURRENT_BINARY_DIR} instead. This pattern means more projects
will have working import paths for qmllint and possibly other tools
out of the box. There should also be fewer cases where the
OUTPUT_DIRECTORY option needs to be used in calls to
qt6_add_qml_module(). The QT_QML_OUTPUT_DIRECTORY variable facilitates
the scenario where QML modules might be distributed across different
parts of the source directory hierarchy, but once collected under a
common base point defined by QT_QML_OUTPUT_DIRECTORY, they form a
coherent set of QML modules whose subdirectory structure below that
base point follows their TARGET_PATH.

Fixes: QTBUG-94164
Fixes: QTBUG-95081
Pick-to: 6.2
Change-Id: I82864c361a2b34f7f1484cdbda0d9b64b34b9950
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-07-20 16:33:48 +10:00
Ulf Hermann fff8d6120a Use "= default" rather than empty bodies for ctors and dtors
Change-Id: Idef0ebaa0074e1e4b6b74d20bd6c70cb22a04f93
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
2021-07-01 08:34:58 +02:00
Ulf Hermann 91e7009aec Use "auto" as type when initializing using "new"
The type is immediately visible from the right hand side then.

Change-Id: Ifc1a15e3eea9b5a91ff8647f759d207a0ee221b8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-07-01 08:34:54 +02:00
Ulf Hermann 83859221c1 Initialize members in declaration rather than ctor
Change-Id: I084a6865ae37c6612fbcfd44a233234f05e38814
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-06-30 14:17:12 +02:00
Ulf Hermann 213b890899 Add missing "override" keywords
Our examples should follow best practices.

Change-Id: Ice90a818ae46e921b421e8d297806d8f7200294b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-06-30 14:17:01 +02:00
Ulf Hermann b200fbe213 Do not call QGuiApplication::exec() on an instance
It's a static method. It should be called statically.

Change-Id: I15fc8948988b0a2c0a30f8699949e06c66d92fdf
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-06-30 14:16:55 +02:00
Ulf Hermann 1629fa0c6c Use nullptr rather than 0 for null pointers
Change-Id: I2921298ad2e04001bdee8824c56f01c203efb7d6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-06-30 14:16:49 +02:00
Eskil Abrahamsen Blomfeldt 07d646d1b0 Update imageelements example to Qt 6 url syntax
The imageelements examples depended on URLs being resolved
relative to the file where it was declared, but in Qt 6
this was changed. Since the source is actually resolved
inside MyBorderImage, which is in content/, we would end
up trying to resolve content/content/foo.png.

To avoid having code depend on the location of types it is
using, URLs have to be packed in Qt.resolvedUrl() in Qt 6.

Change-Id: I16e203e92b3b4c7c573dcdb85dcd556f2103ab80
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-06-17 14:20:01 +02:00
Laszlo Agocs d3412cddab rendercontrol examples: Exercise key event generation as well
Task-number: QTBUG-93489
Change-Id: Ife9db7b066add1f41de964d4c41309568f954320
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-06-15 11:12:21 +02: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 2422dd5a7a Switch examples to build as isolated sub-builds
Task-number: QTBUG-90820
Change-Id: Id9157526898ba72cb64ee8256639b37357f7bacf
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-05-27 21:08:14 +10:00
Joerg Bornemann 9ed32b292f Use fixed qt_add_resource BASE argument
Pick-to: 6.1
Task-number: QTBUG-86726
Change-Id: Ie638443a76623df0ec20fbcd5485af59866deee6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-22 21:12:26 +02:00
Joerg Bornemann 1917a868d9 Use fixed qt_add_resource BASE argument
Pick-to: 6.1
Task-number: QTBUG-86726
Change-Id: If6e1033642d98ccd40daeb57a453c0e5bc2985da
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-05-21 00:21:26 +02:00
Laszlo Agocs aab39f5d5d Enable rendercontrol_d3d11 example for MinGW
Pick-to: 6.1
Fixes: QTBUG-92839
Change-Id: Id17417b7ae010566b7f78ea1a6b2cc8fe6abc5e3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-05-19 14:41:08 +02:00
Maximilian Goldstein 3168111285 examples/qml/locale: Use inline component as a delegate
Modernize the code by using an inline component as a delegate in this example file instead of declaring the delegate inline.

Change-Id: I52c75f81c42362f858f63bdbbaf432c0966309fe
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-05-19 11:46:37 +02:00
Maximilian Goldstein f7856bc961 examples/quick: Explicitly cast Qt.application to (Quick) Application
Change-Id: Ib9ec9eb0e9f47d8ce758a3c93fee2d1a5abb73ac
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-05-03 13:10:51 +02:00
Maximilian Goldstein 63b418eb54 examples: Use template literals for multiline strings
Change-Id: I660a74730edf60d0b7760162b441e3e14749e930
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-05-03 10:17:18 +02:00
Maximilian Goldstein 30f9affd16 examples/quick/text/styledtext-layout.qml: Fix warnings
Change-Id: I7c0133d08f306dfb813d02e40f1987e278dd3f4d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-04-30 11:30:06 +02:00
Maximilian Goldstein d21561ca2c examples: samegame4/BoomBlock.qml: Do not use unqualified access
Change-Id: I6e7d6b82605271478bfba9ff614f5748b58fffb7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-04-30 10:57:33 +02:00
Maximilian Goldstein 9a7b31b736 examples/quick/views: Fix a few warnings
Change-Id: Iac5df82ff708e37a0cb985e0b83878e7f9b107e1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-04-30 10:55:58 +02:00
Mitch Curtis 23cad8990c Fix gallery example defaulting to Basic instead of the platform default
The example used to default to the Default style, and when that was
renamed to Basic and the default style behavior changed, we forgot to
adapt the style property in the QML Settings instance.

We should now not set any value as a default, and instead ensure that
the style is set on the QSettings in C++.

Pick-to: 6.1 6.0
Change-Id: Ia8654f28ae6adc9171d667c2c5c3603a15251cab
Fixes: QTBUG-91989
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-24 09:20:59 +01:00
Xiao YaoBing 073f3d23b2 make isRightAligned() const and setNoiseSource() const reference
Guessing the const specifier was accidentally forgotten

Change-Id: I88aaacbd9f8562c8a0b800013bb596c166fae6d7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-03-17 10:21:02 +08:00
Oliver Eftevaag 1d3cdac6e4 Update canvas example to use QtQuickControls2
The QtQuick examples should ideally have a more native look and feel.
Making them use controls from QtQuickControl will cause them to adapt to
the desktop style.

This patch replaces the previous Sliders from the 'shared' directory,
with Sliders from QtQuickControls2

Task-number: QTBUG-90880
Change-Id: I90521abf7059950521bc3d1a54994d2cca07259d
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2021-03-10 17:53:22 +01:00
Oliver Eftevaag 454da9f721 Update window example to use QtQuickControls2
Replaces the use of custom made components from the shared directory, with QtQuickControls2 components.

Fixes: QTBUG-90883
Change-Id: I6e659188aa75bfacf8181689f30580783bf280a2
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-02-23 13:49:51 +01:00
Oliver Eftevaag b2f89bbbb1 Make localstorage example independent of the 'shared' directory
Removed dependency to the components in the 'shared' directory from the
project files. The CMakeLists.txt is generated from the qmake project
file using the pro2cmake.py utility.

Task-number: QTBUG-90884
Change-Id: I4f52a065d02bdfc747a2bca89ad0c1707a7ef9ec
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2021-02-22 17:10:15 +01:00
Laszlo Agocs 21d9cd844e Fix custommaterial example with OpenGL
The member names in the "uniform block" (which is in practice
mapped to a struct uniform with GLSL) must match between the
vertex and fragment shaders, even if the member is not used in
one of the shaders. This is because OpenGL/GLSL's interface
matching rules, which would cause the shader program fail to
link due to a mismatch in the structs in the two shaders.

Pick-to: 6.1 6.0
Change-Id: I9a928b4b20fdff14530c16a93a52967ce6c328a3
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-02-19 10:17:08 +01:00
Oliver Eftevaag 7b263f7bf5 Improve visuals and usability
Usability has been improved when entering new rows into the database.
The user is now only able to write in the input form when editing
an exiting entry or creating a new entry. The warning message associated
with entering invalid input will now disappear after a few seconds.
The ListView delegate is now slightly larger, and looks slightly better.

Task-number: QTBUG-90884
Change-Id: Idf7ca9c0bb8b86ac06fed80e945800603f7b03d9
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2021-02-16 14:31:17 +01:00
Oliver Eftevaag 860928d5c8 Update localstore example to use QtQuickControls2
Removing MyButton.qml and replacing it with QtQuickControls2.

Task-number: QTBUG-90884
Change-Id: Ie1b22e817dedfd71593b074561bdfe2e7dc36008
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2021-02-16 12:32:52 +01: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
Nico Vertriest b67de9c660 Doc: Fix dead link Qt logo in example
Task-number: QTBUG-80412
Change-Id: Ib97033ec3729a4af2e7404a8ddbb860e574c928d
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-12-16 07:56:19 +01:00
Mitch Curtis 885abf6147 Fix build of some examples on Windows
ba2da7d745 fixed the build of some
examples when cross-compiling, but for whatever reason it breaks
regular builds on Windows.

This patch makes that fix more specific in the environments it affects.

Fixes: QTBUG-89290
Pick-to: 6.0
Change-Id: I5356a855e3b6f9c27ba05beb9dc11dc32920c6c5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-12-10 10:54:58 +00:00
Alexandru Croitor c1c4a874e3 CMake: Regenerate projects using pro2cmake one last time
And fix up some incorrect qmake project files

Pick-to: 6.0
Change-Id: Ia6d27ac68195635021fe7c4a5f06386a60f3f323
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-12-10 11:11:58 +01:00
Fabian Kosmale 6eb35df60e QML engine: Deprecate DefaultMethod
Assigning objects to signal handlers can be convenient, as seen in the
examples which use it together with ListView.onRemove.
However, that convenience makes it hard to reason about what actually
happens. Moreover, the only user of that functionality are the Animation
classes, and the usage of DefaultMethod is not documented anywhere.

[ChangeLog][QtQml] Assigning an object to a signal handler is deprecated.
Instead, create the object, give it an id, and call the desired slot
from the signal handler. For instance, instead of of
ListView.onRemove: SequentialAnimation {...}
use
SequentialAnimation {id: removeAnimation; ...}
ListView.onRemove: removeAnimation.start()
A warning will be printed whenever an assignment of an object to a
signal handler occurs. The warning can be controlled via the
qt.qml.defaultmethod logging category.

Change-Id: I001ddf4d7933871977f84a5e012d020fb043cc64
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-12-03 21:12:42 +01:00
Joerg Bornemann ba2da7d745 CMake: Make QT_BUILD_EXAMPLES build work with boot2qt
Work around QTBUG-86533 by adding explicit dependencies to
QuickTemplates2.

Change-Id: I293e6db652cbd6c7a699f778c0d45c6c1fd9bdc9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-12-03 17:52:45 +01:00
Andreas Buhr b5b36db63a Fix documentation links to High DPI documentation
The documentation on High DPI was recently rewritten, renaming
several sections. This patch fixes the links which were broken
by this change.

Task-number: QTBUG-88533
Pick-to: 6.0
Change-Id: Iae9f38d722a267ba5b21db6f2ef7394a6c675d4f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-12-01 15:48:55 +01:00
Mitch Curtis 71249db0cb gallery: don't store QQuickStyle::name() in settings on startup
It's no longer empty if not specified, so just skip that step
altogether. Add the desktop styles to the list of selectable styles,
but only on the correct platforms. Only set the style at startup if it
wasn't specified via QT_QUICK_CONTROLS_STYLE. I tried to detect if a
-style application argument was passed, but it doesn't show up in the
list of arguments.

Change-Id: I7c216372580a012693b7a01d138d79c8d46afe66
Fixes: QTBUG-88955
Pick-to: 6.0 6.0.0
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-11-30 15:12:47 +01:00
Friedemann Kleint 203acb1955 Fix building the d3d11underqml example with MinGW
Fix format mismatch
qtdeclarative/examples/quick/scenegraph/d3d11underqml/d3d11squircle.cpp:369:16: error: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'HRESULT' {aka 'long int'} [-Werror=format=]
          qFatal("Failed to create buffer: 0x%x", hr);
by casting to uint (as is done in an existing qWarning()).

Pick-to: 6.0
Change-Id: I9bed3066936af8a1831b695a76d40989a834fde9
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-11-26 20:29:37 +01:00
Venugopal Shivashankar 4fac3dd5b5 Doc: Drop the \excludefromcreator meta tag
The example does not depend on the
Qt Graphical Effects module now.

Pick-to: 6.0 6.0.0
Change-Id: Ia69bc16738f5f52aaea828409ef73bf0c68e371e
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2020-11-24 09:51:01 +00:00
Maximilian Goldstein 56f428c360 qmlfunctions.qdoc: Add clarification to QML_FOREIGN
Fixes: QTBUG-87150
Pick-to: 5.15 6.0
Change-Id: If99a06a07892bdfef7b6b1e8fa737480750992fe
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-11-23 14:29:02 +01:00
Mitch Curtis e783bb87b8 Remove glow effects from automotive example
For now there is no way to do this without writing them ourselves.
Since the effect was fairly subtle, we simply live without it for now.

Task-number: QTBUG-88202
Change-Id: Ic2556258461f657eddef3a597d928a7a0a7604c4
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-11-19 14:55:29 +01:00
Venugopal Shivashankar d220b4a8d0 Example: Drop "2" against "Qt Quick Controls" text
This should ensure that the examples give the same
message as the documentation. In addition,
dropped a phrase about Qt Quick Controls claiming
that it is designed for mobile and embedded. The
latest version of controls covers the entire spectrum.

Change-Id: Ia856fa47a6e6fc35f80bedc549378a00c7fbbc2a
Pick-to: 5.15
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-11-17 09:30:18 +00:00
Fabian Kosmale 20641edb37 Make text example work in static CMake builds
Task-number: QTBUG-87702
Task-number: QTBUG-86947
Change-Id: I9dd1b6ca633be60977109acf6b00123d4492b726
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-11-11 23:40:13 +01:00
Ulf Hermann d7008c79d4 QQmlListProperty: Use qsizetype rather than int for sizes
[ChangeLog][QtQml] The QQmlListProperty callback functions use qsizetype
now as type for the size of a list. This is in line with the containers
that you might use to back the list.

Fixes: QTBUG-88269
Change-Id: Ia38403cb32f241e6c70e1a580dbeff1d6d694331
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-11-09 18:09:30 +01:00
Mitch Curtis d430281112 Doc: use correct casing for Material style name
Change-Id: Ia2d10b9fd27c8e83bfd8ed8ae021391ba1df50f1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-11-09 12:58:42 +01:00
Venugopal Shivashankar e3a31e9d1e Doc: Fix qdoc warnings
Mostly broken links to types and
properties that are either dropped or
renamed.

Task-number: QTBUG-88141
Fixes: QTBUG-88141
Change-Id: I44789cdd1b8560a967b0b3868fd637deef488d88
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2020-11-06 15:06:25 +01:00
Venugopal Shivashankar 749debe64f Doc: Drop the automotive example from Qt Creator welcome screen
The example depends on QtGraphicalEffects which is
not part of the 6.0 release.

Task-number: QTBUG-88202
Change-Id: If266a0965bc3ca288d2ef45e130232cb1571462b
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2020-11-06 12:23:28 +00:00
Topi Reinio 0b12055548 Doc: Fix documentation warnings for Qt Quick
- Remove links to modules and examples that are not part of Qt 6.
- Remove links to entities marked as \internal
- Add missing enum value and QML property docs where it's trivial
  to do so.

Task-number: QTBUG-88156
Change-Id: I10a1c7bcc5fe0e2354ea69eaf24930362edb7415
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-11-05 09:00:48 +01:00
Kaj Grönholm 4fd12eef18 Fix CustomAffector example
Don't use particle.r which doesn't exist since the CustomParticle
removal. Make example a bit simpler without this.

Task-number: QTBUG-88173
Change-Id: Id994a9a58796e8194fdccd63c6439d4c19681a45
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-11-05 10:00:37 +02:00
Volker Hilsheimer cde1a8a10b Get rid of all instance usage of QFontDatabase
All QFontDatabase APIs are static, use them accordingly.

Task-number: QTBUG-88114
Change-Id: Iae40e1354eaa6a6098a9fdbce9e237a9f498cc7d
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2020-11-03 16:55:32 +01:00
Volker Hilsheimer ed92e44b61 Add includes to fix build errors in tests and examples
Change-Id: I47dcf16b1d207317985e303c626a121aa307704c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-10-31 16:19:20 +01:00
Shawn Rutledge 1469bac17c Add #include <QPainter> in textballoon example
It is not building in namespaced builds without this.
Others also needed this include, such as
qml/tutorials/extending-qml/chapter2-methods/piechart.cpp

Change-Id: Ifbb0557655d247b146ca2eddb07ea6813d9ffacb
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-10-31 09:45:31 +01:00
Mitch Curtis 8622862b00 Fix flatstyle example
Styles must now be proper QML modules; i.e. have a qmldir and be
available in the import path.

Fixes: QTBUG-87848
Change-Id: I07de491be31a24f2b07f68f389600450dc89561c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-10-30 12:04:22 +01:00
Alexandru Croitor 20d5e2d7ef CMake: Regenerate examples to set the WIN32_EXECUTABLE property
As well as the MACOSX_BUNDLE properties as necessary.

Task-number: QTBUG-87664
Task-number: QTBUG-86827
Change-Id: I46769fb543acb2cbeba122470b5e44ad478fbe4e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-10-26 23:38:39 +01:00
Alexandru Croitor edfb8943fc CMake: Regenerate examples to set the WIN32_EXECUTABLE property
As well as the MACOSX_BUNDLE properties as necessary.

Task-number: QTBUG-87664
Change-Id: I1113701f04a16b05b03fbb1a49f131c84659cdcb
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-10-26 21:20:04 +01:00
Laszlo Agocs fa9808bad0 Fix up shadereffect example docs
The screenshot has been out of date for years now. Update it
as well.

Change-Id: I2b9ae3b0c24b0de7f0cd8a2284d67023237f0944
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2020-10-23 07:51:59 +00:00
Alexandru Croitor 903252b240 CMake: Regenerate examples to use qt_add_executable
Task-number: QTBUG-87661
Change-Id: Ie5bba408000211b24694aa0143bdf79c4a298f42
Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
2020-10-20 09:32:34 +02:00
Alexandru Croitor a4445cf2f7 CMake: Regenerate examples to use qt_add_executable
Task-number: QTBUG-87661
Change-Id: I0d26db40fdb7bd35c92c8fd970b60ec580acc0e0
Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
2020-10-20 09:13:34 +02:00
Mårten Nordheim 3a9f84fb37 Update QStringConverter usage
Following fa8d021fa6fcb040fb702b6ffd2deee52a3b748a

Change-Id: Ifa08b5e1bceecb8657ce528eb315c19fa34a1e1f
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-10-09 11:44:18 +02:00
Tor Arne Vestbø 43dbc7cbd1 Adapt to platform API rename
Change-Id: I1f2171e18ec3df71f7eaec1be0e0e0d1442a3860
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-10-09 09:03:20 +02:00
Ulf Hermann e7d90fc526 Fix lineedit example
The default name created by QML_ELEMENT is the name of the local type,
not the one of the foreign type.

Pick-to: 5.15
Task-number: QTBUG-87150
Change-Id: I2b5dfcea3e835d4e69d5fa4df179333a37ee1d6e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-10-05 12:56:37 +00:00
Mitch Curtis 9219e86aa5 Rename "Default" style to "Basic"
[ChangeLog][Styles] The Default style was renamed to Basic to account
for the introduction of the platform styles (macOS, Windows), which
will be used by default (where possible) when no style is specified.

Fixes: QTBUG-85984
Task-number: QTBUG-68814
Task-number: QTBUG-86403
Change-Id: I22b3199c8662e4ee5d55a1be1a51c9856ac62376
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-09-24 13:48:49 +02:00
Volker Hilsheimer 38b9c4f327 Fix additional warnings from usage of deprecated APIs
Replace more QLibaryInfo::location with QLibraryInfo::path

Replace old event accessors APIs, including relevant comments.

Change-Id: Ie205fc93b6e1c0dfb3dca9100fbde417ab68fc9f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-09-16 16:24:21 +02:00
Volker Hilsheimer a15840a8df Fix additional warnings from usage of deprecated APIs
Replace QLibaryInfo::location with QLibraryInfo::path, and remove usage of
Qt::AA_EnableHighDpiScaling, which doesn't have any effect anymore.

Change-Id: I347e8a83e0f4c2b4405f2512e569ad3234f05a98
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-09-16 12:44:59 +02:00
Volker Hilsheimer 153c0ee3c4 Fix more compiler warnings from deprecated application attributes
Also cleanup documentation, with the exception of the "High-DPI
Support in Qt Quick Controls" page, which needs to be either
removed or rewritten after some fact checking.

Change-Id: I3cdf1f8554f8f26627a9a5f17c2ee0038c933468
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2020-09-16 10:32:15 +02:00
Volker Hilsheimer 0e0f7c0b7b Fix compile warning from deprecated application attributes
AA_DisableHighDpiScaling and AA_UseHighDpiPixmaps have been deprecated.

As of 90358f6042d1fe2db849e17e1b0c875fb0560b20
and 2dc46c09026362cc267b1183faf09fb29479ef93 in qtbase, respectively,
these settings are deprecated and have no effect.

Change-Id: I1eb1f77a64893dd077bd08216d26633d43e1e0e3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-09-15 17:45:04 +02:00
Laszlo Agocs a99fc26faa shadereffect example: remove unused legacy shader code
No point in exercising the file selector magic when there is only one
possible path in Qt 6.

Change-Id: I3b49b19d57a89855063e983ab0add13335840fb9
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-09-13 19:15:12 +02:00
Ulf Hermann b030b4a1f2 examples: include QQuickWindow in squircle headers
This is required because QQuickWindow is passed as a signal parameter.

Change-Id: Ied10beded7253558d080af4806d1b95880bf2d98
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-09-13 08:15:15 +02:00
Mitch Curtis bb33370005 Fix examples' usages of styles
After the type registration changes, importing a style explicitly
will cause that style's QML types to be used, so applications
should put style-specific code into file-selected directories if
they need to support multiple styles.

[ChangeLog][Important Behavior Changes] Due to the recent type
registration changes, importing a style explicitly (e.g.
"import QtQuick.Controls.Material") now registers that style's
QML types in addition to making its API (attached, singleton, etc.)
available. For this reason, it is now advised to have style-specific
code in a separate QML file and use file selectors if your application
supports more than one style. If your style only supports one style,
importing that style explicitly will work as expected.
For example, if you use Material.foreground in your QML code and your
application supports more than one style, you should refactor the code
that uses the binding into its own file; e.g.
+Material/MyComponent.qml.

Fixes: QTBUG-86263
Change-Id: I38e40ff4f20f61218550ad73945dafb912193466
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-09-10 12:31:45 +02:00
Laszlo Agocs df40607e8a Make twotextureproviders example functional again
Change-Id: I6a317fc8628b902e535a31daf4a3886fc87d08bc
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-09-07 12:38:25 +02:00
Laszlo Agocs 6cb48cb1da Regenerate graph example shaders
Change-Id: Id4fe4d0e177180fadd10f34b9ebad17c71e40314
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-09-07 12:38:23 +02:00
Laszlo Agocs 23ad0953ab Add CMake project file for custommaterial example
The name conflicts with a Quick3D example so try to use the same
approach as it was done for customgeometry.

Task-number: QTBUG-86205
Change-Id: Ie01cd6c0118d512b2f45d4c6e782ec6639e052c6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-07 11:48:26 +02:00
Laszlo Agocs 6f2f198aff Remove old GLSL code from fboitem example
There is no OpenGL path anymore in Qt 6, no point using file selectors.

Change-Id: I4b7afbbb193dfe1a6e912a909babab0aeb8dcdda
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-09-07 09:43:08 +02:00
Mitch Curtis f872cdde21 Fix qdoc errors
Change-Id: I83f21bd6b780daa545c57d050d0f7562e8c0a4ff
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2020-09-03 15:12:43 +02:00
Tor Arne Vestbø d0eb261836 Remove use of deprecated High-DPI application attributes
Change-Id: Ibfb50fdcbb51ba93d6e5d11f9e8ce0e7b3bfde79
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-09-02 17:17:33 +02:00
Edward Welbourne 572882fd67 Example: Pass QDate, QTime by value, not by const reference
They're value types, packaging qint64 and int, repsectively.

Change-Id: Icf18794466cd140e1384d6dd0de736fbb2c05a48
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-09-01 16:57:01 +02:00
Sze Howe Koh fd105380eb Doc: Capitalize "GUI" correctly
Pick-to: 5.15
Change-Id: I2230e2dcb7bc2497b5dbe71a22c21d84176b5e57
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
2020-08-30 09:59:51 +08:00
Sze Howe Koh 024ec9c564 Doc: Fix minor typos
Pick-to: 5.15
Change-Id: I4c51c40697e410d56b6a2d2446ed9f8ae218576d
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
2020-08-30 09:59:49 +08:00
Mitch Curtis 501bc44bb0 Use qmlRegisterModuleImport() to register styles
This patch completes the cumulative work done in previous patches.

- Uses qmlRegisterModuleImport() to register styles. This has some
  added requirements:
  - Each style must now be a QML module -- that is, it must have a
    qmldir file.
  - As a result of the above, the module must be available within the
    QML import path in order to be found.
  - The various forms of accepted style names have been reduced down to
    one ("Material", "MyStyle", etc). See below for an explanation of
    why.
  - The following API in QQuickStyle is removed:
    addStylePath(), availableStyles(), path(), stylePathList(). These
    no longer make sense now that we reuse the existing QML import
    system.
- Adds the tst_qquickstyleselector auto test back as "styleimports".

qmlRegisterModuleImport() vs resolvedUrl()

    Previously we would use QQuickStyleSelector to select individual
    QML files based on which style was set. We'd do this once when
    QtQuick.Controls was first imported.

    With Qt 6, and the requirement that each style be a proper QML
    module, qmlRegisterModuleImport() was introduced. This allows us
    to "link" one import with another. For an example of what this
    looks like in practice, suppose the style was set to "MyStyle",
    and the fallback to "Material". The "QtQuick.Controls" import
    will be linked to "MyStyle", "MyStyle" to
    "QtQuick.Controls.Material", and as a final fallback (for controls
    like Action which only the Default style implements),
    "QtQuick.Controls.Material" to "QtQuick.Controls.Default".
    This is the same behavior as in Qt 5 (see qquickstyleselector.cpp):

    // 1) requested style (e.g. "MyStyle", included in d->selectors)
    // 2) fallback style (e.g. "Material", included in d->selectors)
    // 3) default style (empty selector, not in d->selectors)

    This is a necessary step to enable compilation of QML to C++.

Reducing the set of accepted style names

    The problem

    In QtQuickControls2Plugin() we need to call
    QQuickStylePrivate::init(baseUrl()) in order to detect if the style
    is a custom style in QQuickStyleSpec::resolve() (by checking if the
    style path starts with the base URL). In Qt 5, init() is called in
    QtQuickControls2Plugin::registerTypes(), but in Qt 6 that's too
    late, because we need to call qmlRegisterModuleImport() in the
    constructor. qmlRegisterModuleImport() itself requires the style to
    have already been set in order to create the correct import URI
    ("QtQuick.Controls.X" for built-in styles, "MyCustomStyle" for
    custom styles).

    The solution

    By reducing the valid forms for style names down to one:

    ./myapp -style MyStyle

    we solve the problem of needing baseUrl() to determine if the
    style is a custom style or not, but needing to call it too early
    (since we now call qmlRegisterModuleImport() in
    QtQuickControls2Plugin(), which itself requires the style to have
    already been set). baseUrl() can't have been set before the
    constructor is finished.

    All of the various forms for _setting_ a style are still valid;
    environment variables, qtquickcontrols2.conf, etc.

[ChangeLog][Important Behavior Changes] Custom styles must now have
a qmldir that lists the files that the style implements. For example,
for a style that only implements Button:
---
module MyStyle
Button 1.0 Button.qml
---
In addition, there is now only one valid, case-sensitive form for style
names: "Material", "MyStyle", etc.
These changes are done to help enable the compilation of QML code to
C++, as well as improve tooling capabilities.

[ChangeLog][Important Behavior Changes] The following API was removed:
- QQuickStyle::addStylePath()
- QQuickStyle::availableStyles()
- QQuickStyle::path()
- QQuickStyle::stylePathList()
- QT_QUICK_CONTROLS_STYLE_PATH
This API is no longer necessary and/or able to be provided now that
styles are treated as regular QML modules.

Task-number: QTBUG-82922
Change-Id: I3b281131903c7c3c1cf0616eb7486a872dccd730
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-08-26 11:46:07 +02:00
Mitch Curtis d451cab0c8 Remove all version numbers from QML imports
As of Qt 6, the latest version will be used by default. This saves us a
lot of effort in terms of version bumps.

Task-number: QTBUG-82922
Change-Id: I74eba8185ec3ccc75bc293d4b2ea87d59e2d9928
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-08-26 11:46:00 +02:00
Alexandru Croitor a09e4c1aa9 CMake: Rename example conflicting with qtquick3d
Fixes: QTBUG-86205
Change-Id: I38992501abb86a4328527283ad8924ec886ea8c8
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-08-25 15:40:05 +02:00
Shawn Rutledge 0672882cab Support Markdown in the TextEditor example, including local paths
The example still loads an HTML file from resources by default, but now
it's possible to give either a relative or absolute file path on the
command line to load an html, markdown or plain text file. Alternatively
you can use the file dialog to load any of these types. We assume that
any resources (such as images) with relative paths are to be loaded from
the directory where the source text file is.

Pick-to: 5.15
Change-Id: I37bc2d6aa2306016453770dc2fd66efa41a16618
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2020-08-10 16:20:06 +02:00
Laszlo Agocs 28005c0c03 Switch to MTLTexture protocol in QSGTexture native access
Now only available from ObjC code.

Change-Id: I88df6c8839fc660ffd2b8e88a789ca73a9d4accd
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-08-04 14:29:30 +02:00
Laszlo Agocs fb96109bbc Add type safe native texture accessors
Following the pattern from QtGui.

Task-number: QTBUG-85239
Change-Id: I07b4456028d0f45223ad10e55ce65f423bab6a9b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-08-03 16:32:30 +02:00
Edward Welbourne 3debb37250 Replace Qt's MidButton with MiddleButton
The latter has been the preferred name since Qt 4.7.0.
Added a comment on where the old name is exposed to QML that it's only
for backwards compatibility.

Pick-to: 5.15
Change-Id: I2c5088d597dd7327cc5899d06afb180d0ec2893e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-07-22 11:16:08 +02:00
Laszlo Agocs d152bc5326 shadereffect example: change to relative file refs
Like with Image, this should work with ShaderEffect as well, and is the
better default approach to promote to users.

Change-Id: I9b8427297687db189045886fbaf17d2b4a517aba
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-06-30 12:43:15 +02:00
Laszlo Agocs ccb9eb0cc1 Follow QQuickGraphicsDevice changes in QQuickRenderTarget
They are not strictly related of course, but the API pattern should be
kept. We can also move away from the QSGTexture dependency which is good
since that was never directly related.

Change-Id: I9aedff5918443bda3d6e3ee1ea389071222d1ad7
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-06-26 21:08:06 +02:00
Jarek Kobus dd71c43b97 Use QList instead of QVector
Task-number: QTBUG-84469
Change-Id: I4c3353c00a566023503fbc178ba8454391dc334c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-06-25 07:54:07 +02:00
Paul Olav Tvete 2be6c85b80 New custom material example
Fixes: QTBUG-78577
Change-Id: I280ffeda4bba1a9c170feb1ffa4b6c95eb0e6d28
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-06-24 19:48:45 +02:00
Laszlo Agocs 4e266103ad Rename setSceneGraphBackend to setGraphicsApi
...and fix up the docs.

The string-based setSceneGraphBackend() stays of course (the docs have
been enhanced, however). The GraphicsApi enum-based overload is now
renamed to setGraphicsApi().

Using the same name for both functions is a historical artifact, reflecting
the evolution (5.0 - 5.8 - 5.14). In 6.0 we can give it a more appropriate
name, since it does not have much to do with "backends" from the user's
perspective.

Change-Id: Id75dbf81f50a148797e5b5de9be4000153737473
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-06-22 16:10:52 +02:00
Laszlo Agocs a86febf876 Fix GL_ constant usage in examples
Change-Id: Iecfa47845edb78928b388d150a3229f8c7a93d5d
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2020-06-17 17:42:02 +02:00
Karsten Heimrich 602bffd346 Port QtQuickControls2 from QTextCodec to QString{Converter|Decoder}
Task-number: QTBUG-75665
Change-Id: Ib66a260dc3bfc39e2e50c38db56ca72b8186a4ac
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-17 15:09:27 +02:00
Ulf Hermann 828cdcabf8 Remove QtQuick.Window plugin
We move all the types into QtQuick itself and retain QtQuick.Window only
as alias to QtQuick. This requires support for qmldirs that consist of
only an import statement.

[ChangeLog][QtQuick][Important Behavior Changes] The contents of the
QtQuick.Window QML module have been moved into the QtQuick module.
QtQuick.Window is merely and alias for QtQuick now. An explicit import
of QtQuick will override this alias. Therefore, if you import QtQuick
with a different version than QtQuick.Window, you will get the
QtQuick.Window types of the version given in the QtQuick import now.

Task-number: QTBUG-84639
Change-Id: Ia82afab0ac2faba70cfdaf53dc8dfe4261e1113f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-06-15 16:56:10 +02:00
Eskil Abrahamsen Blomfeldt 90bf30376c Anisotropic antialiasing for distance field text
For perspective transforms, we need to find the sample
range in the glyph cache per pixel. We can do this by
getting the gradient of the distance field at the
specific pixel.

This will ensure proper antialiasing with any
projection, but has the limitation that when glyph contours
become thinner than a pixel, they may disappear or become
too emphasized, because the hardware-gradient - based on
neighbouring fragments - is not reliable at that scale.
So we should only default to this when we detect that the
text is child of a 3D scene.

To make this smooth, we need to know the mode of the renderer
when creating the shader. So QSGMaterial::createShader()
now takes a render mode that we can use to customize behavior
based on whether it is rendering into a 2D or 3D scene.

[ChangeLog][QtQuick] The QSGMaterial::createShader() virtual
function has been extended to take a render mode argument,
which can be used for any customizations needed in the case
where the shader will be used in combination with 3D perspective
transformations.

Fixes: QTBUG-84695
Change-Id: I5a18a4edbdfa07e8f9d506c42bb20e8eb580927d
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-06-15 10:20:21 +02:00
Laszlo Agocs 9943181dcc Move resetOpenGLState() to QQuickFbo
QQuickWindow should not have OpenGL specifics in its API in Qt 6.

However, resetOpenGLState() is used by applications commonly in
combination with QQuickFramebufferObject (not the least because the
documentation recommends it!). This is no problem in practice because
QQuickFramebufferObject remains an OpenGL-only feature. So to minimize
the breaks, move the function into QQuickFramebufferObject::Renderer so
any application that calls the function can continue to do so by just
calling it on 'this' instead.

The rendercontrol_opengl example used to call this function as well, but
unnecessarily, it will still function the same way without it.

Note that there is a chance that there are applications that call
resetOpenGLState() in other contexts, for example in slots connected to
before or afterRendering(). For these it will need to be determined if
the call is necessary at all, and if it is, should be replaced by
(re)setting the appropriate OpenGL state manually instead.

Task-number: QTBUG-84523
Change-Id: I335599f77e8a84e347a44427eb1a1bf917796ee8
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2020-06-12 12:38:39 +02:00
Laszlo Agocs 69c7ed97c2 fboitem example: Request OpenGL explicitly
It wouldn't render otherwise.

Change-Id: I185459f2eccdffac4f7d7968e48aab4141e0908c
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2020-06-12 12:24:10 +02:00
Shawn Rutledge 212c2bffbb Replace calls to deprecated QEvent accessor functions
Several event accessors were deprecated in
qtbase/24e52c10deedbaef833c0e2c3ee7bee03eacc4f5.

Replacements were generated by clazy using the new qevent-accessors check:
$ export CLAZY_CHECKS=qevent-accessors
$ export CLAZY_EXPORT_FIXES=1
$ ../qt6/configure -platform linux-clang -developer-build -debug
  -no-optimize-debug -opensource -confirm-license -no-pch QMAKE_CXX=clazy
$ make
$ cd ../../qt6/qtdeclarative
$ find . -name "*.clazy.yaml"
$ clang-apply-replacements .

Task-number: QTBUG-20885
Task-number: QTBUG-84775
Change-Id: I1be5819506fd5039e86b4494223acbe193e6b0c9
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-06-11 22:00:19 +02:00
Laszlo Agocs de45522283 openglunderqml example: remove unnecessary resetOpenGLState call
Also request the OpenGL RHI backend explicitly, like all the other
similar examples (d3d11underqml, and so on) do.

Calling resetOpenGLState() in this example is pointless because it
happens before returning from the custom rendering function, and the
endExternalCommands() call achieves the same internally, i.e. the rhi
will know that cached state cannot be used anymore. There are other
valid uses cases for resetOpenGLState() but this example does not have
those.

Change-Id: Ifa7861b80c29c174d02cfe37fe8ef8eed7344195
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2020-06-11 18:13:59 +02:00
Jonas Karlsson 1ca74842e8 Remove rendernode and opengltextureinthread examples
Task-Id: QTBUG-84623
Change-Id: I786a7a8ee256d8c395dd0e828213c5d137ba20dc
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-06-10 12:51:53 +02:00
Laszlo Agocs c167fd58c2 Enable Metal-based scenegraph examples
Change-Id: Ib2734fb10feaac106bb6483a8a361c7b35af3348
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-10 07:18:06 +02:00
Mitch Curtis 31fbd97b0e ApplicationWindow: remove deprecated overlay API
[ChangeLog][Controls][ApplicationWindow] The deprecated overlay
properties and attached API were removed. Use the Overlay attached type
instead.

Task-number: QTBUG-84715
Change-Id: I0781ea55ea502ffe5277385e82492291724d2090
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-06-08 15:44:27 +02:00
Alexandru Croitor b343fb40d7 CMake: Fix duplicate "gallery" target name
This fixes top-level builds that include qtquickcontrols2 to
configure successfully.

Change-Id: Ia90669ac66c65fc20e16ecbf15507f17a19053d8
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-06-04 22:27:43 +02:00
Oliver Wolff 9cefaca1ea Remove winrt
Task-number: QTBUG-84434
Change-Id: If8f57f00726868a3540c877d07fca761618e4f08
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-06-04 15:51:51 +02:00
Jan Arve Sæther 3122236e7b Fix some bugs in the example that was introduced by moving over to QQC2
Most of the bugs was due to moving over to Qt Quick Controls 2, except
from the binding we had to explicitly break now. That should probably
have been done when we used Qt Quick Controls too.

Change-Id: Ic558679802ea35e727eadc570cf299f9da4a3604
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2020-06-04 08:50:28 +02:00
Laszlo Agocs b87b3d3d43 Make QSGMaterialRhiShader become QSGMaterialShader
After a symbiotic relationship in Qt 5.14 and 5.15, it is time for
QSGMaterialRhiShader to devour its older sibling and take its place.

This makes the direct OpenGL rendering path disfunctional. All
QSGMaterial Qt 6 TODOs are solved, the API is clean and straightforward
again: a QSGMaterial creates a QSGMaterialShader, no special flags and
options needed. (it's just that QSGMaterialShader now has a slightly
different API)

Task-number: QTBUG-79268
Task-number: QTBUG-82997
Change-Id: I545ca8d796c5535e81957c706e7832133be15b7d
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-06-02 15:16:46 +02:00
Kai Koehne 1f0b3a54ff Examples: Fix double installation of .qml files
qt_example_installs.prf already generates install rules for all example
sources, including content of .qrc files.

Pick-to: 5.15
Fixes: QTBUG-84301
Change-Id: I3454b19849af489c5819c51867781cc97f1eb285
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-06-02 14:44:26 +02:00
Eirik Aavitsland ff293f3afc Remove CustomParticle
The implementation is intertwined with the direct GL path and not
really portable to RHI.

Fixes: QTBUG-78574
Change-Id: I6ac8707544c19a24661f07e0e6d2fc405e49cbff
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-06-02 11:15:44 +02:00
Laszlo Agocs 8ac75dad2a Enable rendercontrol_d3d11 example in CMake builds
Change-Id: Ifd1526da4a792e783e47fc7bb952bdb188a6e5c1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-29 17:43:12 +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 965984771d CMake: Regenerate qtdeclarative/examples
Includes
- new example installation paths
- one case of QT_QMLTYPES_FILENAME addition

Change-Id: I24423da9b04b6ecc8445017fa35f148dd43b1829
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-05-29 10:01:22 +02:00
Jan Arve Sæther e76629dc33 Update to Qt Quick Controls 2
Qt Quick Controls will be deprecated in Qt 6

Change-Id: Ifca94d028b3fd71797816a22af4d896fb9ae2be3
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2020-05-29 08:45:40 +02:00
Mitch Curtis 0e18524a84 Remove Qt Labs Calendar
This is getting its own repository as part of the move to the
marketplace.

Task-number: QTBUG-84172
Pick-to: 5.15
Change-Id: I2f963c298d6ef95e0832f95aa1e1ea809f4867a2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-05-28 08:09:33 +02:00
Laszlo Agocs 756c4c9e6d Avoid truncating in QSGMaterial::compare() implementations
The Qt 5.0 pattern of subtracting pointers and returning them is not
suitable (on 64-bit archs) since the return type is an int.

There is also QSGTexture::comparisonKey() now which is a qint64.

Just return -1 and 1 as appropriate.

Change-Id: Iaf3377b484a8c4b19b0960f1e8def05e4fa68ce7
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2020-05-27 15:39:30 +02:00
Laszlo Agocs 201f28c7e3 Skip d3d rendercontrol example on MinGW
We will not invest into adding workarounds in the example code
as the boilerplate to keep such unofficial environments working is
not worth the effort and compromises readability in example code.
Just skip building on MinGW.

Change-Id: If33bd0382f8cab4713ad45fcaa126830e9760af3
Reviewed-by: Liang Qi <liang.qi@qt.io>
2020-05-27 12:17:08 +02:00
Laszlo Agocs 08f56c9830 Adjust QSGTexture comparisonKey type
The original choice was int, simply following textureId(). This was later
deemed insufficient: instead of a GLuint, the value is now often a 64-bit
value (on 64 bit systems), based on a pointer, since the identity of a texture
in the RHI world is the QRhiTexture* itself. In a custom texture implementation
it is likely that the value here is the value of a native object handle, either
a pointer or some 32 or 64 bit integer.

Inspired by the recent QSGTexture::NativeTexture struct change (void* -> quint64),
switch to a qint64 which is big enough to hold all these without truncation.

We choose a signed value here, in order to allow for the following pattern that
is widespread in material compare() implementations:
if (qint64 diff = m_texture->comparisonKey() - other->texture()->comparisonKey())
  return diff;

Fixes: QTBUG-83769
Change-Id: I8bdae8cd835282358ded53b3703142b8f26e4400
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2020-05-27 11:19:25 +02:00
Laszlo Agocs 16cb9dea7b Fix namespaced builds in rendercontrol example
Change-Id: Ic91d4c57e1d559d3ab2438e99c0c34ba2d1d9200
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-05-27 11:17:45 +02:00
Laszlo Agocs 0d80dbd8c2 Enable QQuickWidget with OpenGL over RHI
Also adapts to new NativeTexture format, where the actual
handle is passed around instead of a pointer to it.

[ChangeLog][QQuickWidget][Important Behavioral Changes] In
earlier versions, the returned value from QQuickWidget::quickWindow()
would persist for the life time of the widget. This is no
longer the case, so if you are connecting to its signals, make
sure you also connect to its destroyed() signal and update the
connections when it is destroyed.

Fixes: QTBUG-78638
Change-Id: I33cee8543ef1ff5d31555ed3ac18ba78c9c45102
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-05-27 10:45:45 +02:00
Eskil Abrahamsen Blomfeldt 5d4d598354 Adapt to changes in NativeTexture in qtbase
To make the API less error prone, we have changed the
void pointer to the texture handle to a 64-bit in
instead, since all handles are maximum 64-bit.

Task-number: QTBUG-78638
Change-Id: I9d995d6a883b3377f57d7c5b19d4bc4e15aa347b
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-05-25 13:39:32 +02:00
Laszlo Agocs de41077a57 Add missing CMake project for vulkantextureimport
...and enable vulkanunderqml and vulkantextureimport in the CMakeLists
one level up.

Change-Id: I91d659e028b0e7f53b5860bbfbdbb98c18e333c7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-25 10:15:25 +02:00
Ulf Hermann 19ea4e630c Clean up registration of QEasingCurve
We don't need to register the Type enum for both QtQml and QtQuick.
QtQml is enough. Removing this makes the whole manual value type
registration obsolete. Furthermore, we want QEasingCurve as QML_FOREIGN
as we have several classes with properties of that type. To keep it nice
and tidy, we make the uppercase-named enum holder class a separate type.

Unfortunately, the Type enums differ in one entry:
QEasingCurve::BezierSpline is called Easing.Bezier in QML. Therefore, we
need to keep the custom enum around. We can change all users in
qtdeclarative to use the name from QEasingCurve, though.

Change-Id: Ibbc78d8bbf8938e2a8722f8c09833a0c73394c3d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-05-19 08:36:04 +02:00
Laszlo Agocs 6ef31dfb48 Fix up the scenegraph/textureinthread example
Force OpenGL, remove the ShaderEffect (it serves no purpose in this
example) and remove deprecated API usage.

Finally, rename the example to opengltextureinthread.

Note that the example's performance is sub-par, but the same is true
with direct OpenGL.

Change-Id: I7eaa2349ffdb3d27bd9e8815d674e918bc709c03
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-05-18 16:09:55 +02:00
Laszlo Agocs 3475b5f3a8 Modernize the rendercontrol_opengl example
Make it work when using QRhi-on-OpenGL.

Some features like demonstrating a dedicated render thread, or targeting
the window with the Quick content ('onscreen' argument, not clear why
that was added in the first place), are now removed. Some of these could
be reintroduced in future examples, not necessarily in combination with
OpenGL. For now they are removed since the cost of porting and
maintaining all that is not reasonable at this point.

Task-number: QTBUG-84040
Change-Id: I67e5c7cc835c5cf5653cf827004ce66a4d300b36
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-05-18 16:09:55 +02:00
Mitch Curtis 5a61d637e0 Reduce dependencies on QtGraphicalEffects
- Make QtGraphicalEffects optional in tests
- Mention that QtGraphicalEffects is required for relevant examples

Change-Id: I3ac7d06add931e0a10c3df7edc4e458ba5519c75
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-05-13 09:47:09 +02:00
Mitch Curtis 456d26e97e Remove bindings to parent in delegates
Until we've decided whether to a) document that properties of parent
should not be bound to in delegates or b) fix the warning that results
from doing so after 8c72e634b3,
we can pre-emptively clean up a few places where it happens.

Task-number: QTBUG-81976
Task-number: QTBUG-82393
Task-number: QTBUG-82989
Pick-to: 5.15
Change-Id: I1e610613f6016ec1b9cf9ca33cdfb15d384731a8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-05-11 15:57:59 +02:00
Shawn Rutledge b97a2de222 Remove Screen.orientationUpdateMask
Now Screen.orientation works by default rather than filtering by default.

Task-number: QTBUG-83055
Change-Id: I0f49499ec25ceeebf19bc8ef1adc259023f1bc75
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-05-08 11:08:40 +01:00
Laszlo Agocs afd6c6b905 Remove textureprovider example
Task-number: QTBUG-83978
Change-Id: I8f26ae18dd09209cc1d6bee6e5f0b2f609ec667c
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-05-06 11:22:20 +02:00
Laszlo Agocs e25bd7a3b7 Remove leftover legacy shader files in scenegraph example
Task-number: QTBUG-82997
Change-Id: Icc328394154d7b352c9f47184c2f906d5afa4d44
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-04-29 08:42:17 +02:00
Laszlo Agocs af521a8df6 Resume AnimatedSprite playback when visibility changes
Amends f5e2783 that was made in 5.6 to avoid updating the AnimatedSprite
when not visible. The problem is, if the sprite was running, the
expectation is that becoming visible again resumes the playback.

It can be argued what the correct behavior is: do we expect the playback
to resume from the point when the sprite went invisible, or should it
take the time spent as invisible into account? This patch only corrects
the immediate problem and provides the former, i.e. playback will resume
from the point it had when becoming invisible.

The AnimatedSprite scene in the imageelements example is improved to be
able to test this. It can also exercise all the start/pause/resume/advance
functions now.

Fixes: QTBUG-63942
Pick-to: 5.15
Change-Id: Ieb6d046168a2132659848a36ee0b694c580159b1
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-04-24 10:24:58 +02:00
Mitch Curtis 9fd4160307 QQuickItem: rename geometryChanged to geometryChange
This brings it in line with the existing convention in this and other
modules, where virtual handlers are named "nounChange"; e.g.
itemChange. Signals are named "nounChanged".

This also allows adding a geometryChanged signal, which would enable
users to listen to one signal for all changes to x/y/width/height.

[ChangeLog][QQuickItem] Renamed geometryChanged to geometryChange
in order to follow existing naming conventions and have consistency
with existing API, such as itemChange.

Task-number: QTBUG-82994
Change-Id: I0547358c796a0047982ccfbf2c38bab952e7a634
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-04-23 12:13:20 +02:00
Laszlo Agocs bc1b6e73bb textureprovider example: Add comparisonKey() to the custom QSGTexture
This example will likely be removed as it is tied to directly using
OpenGL. In the meantime, make it follow the QSGTexture API change, and
provide the now-mandatory comparisonKey().

Change-Id: I66fb32a10bcec7a868fd264dfb4425a1bed1f4a4
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-04-16 09:59:12 +02:00
Laszlo Agocs 400d176760 Allow redirecting QRhi-based rendering via QQuickRenderControl
Implement the Qt 6 TODO for using an externally-provided render target
when rendering the scene via QRhi.

And say hello to QQuickRenderTarget. This class exists to allow
potentially extending later what a "render target" consists
of. Instead of hard-coding taking a single void * in the
setRenderTarget() function, it takes a (implicitly shared,
d-pointered) QQuickRenderTarget, which in turn can be created via
static factory functions - of which new ones can be added later on.

The new version of QQuickWindow::setRenderTarget() takes a
QQuickRenderTarget.

QQuickRenderControl gets a new initialize() variant, and a few extra
functions (beginFrame(), endFrame()). This allows it to, by using
QSGRhiSupport internally, create a QRhi under the hood.

As a bonus, this also fixes an existing scenegraph resource leak when
destroying the QQuickRenderControl.

The qquickrendercontrol autotest is extended, with a QRhi-based test
case that is executed for all of the QRhi backends that succeed to
initialize.  This is the internal verification. In addition, there is
a Vulkan-based one that creates its own VkDevice, VkImage, and
friends, and then uses Qt Quick with the same Vulkan device, targeting
the VkImage. This test verifies the typical application use
case. (sadly, life is too short to waste it on writing Vulkan
boilerplate for an on-screen version of this, but we have the D3D11
example instead)

What QQuickRenderControl loses, when used in combination with QRhi, is
the grab() function. This never made much sense as a public API:
QQuickWindow::grabWindow() call this when the window is associated
with a rendercontrol, so as a public API QQuickRenderControl::grab()
is redundant, because one gets the same result via the standard
QQuickWindow API. It is now made private.

More importantly, reading back the content is no longer supported,
unless the 'software' backend is in use. The reasoning here is that,
if the client of the API manages and provides the render target (as
abstracted by QQuickRenderTarget), it is then expected to be capable
of reading back the content in whatever way it sees fit, because it
owns and manages the resource (e.g. the texture) in the first
place. Providing fragile convenience functions for this is not
reasonable anymore, and was questionable even with OpenGL, given that
it is not future proof - what if the target is suddenly a floating
point texture, for instance? The software backend case makes sense
because that relies on private APIs - and has no render target concept
either - so there the same cannot be achieved by applications by
relying on public APIs only.

Another new class is QQuickGraphicsDevice. This is very similar to
QQuickRenderTarget, it is a simple container capable of holding a set
of of native objects, mostly in the form of void*s, with future
extensibility thanks to the static factory functions. (examples of
native object sets would be a ID3D11Device + ID3D11DeviceContext, or a
QOpenGLContext, or a MTLDevice + MTLCommandQueue, or a number of
Vulkan device-related objects, etc.)  This allows one to specify that
the QRhi created under the hood (either by QQuickRenderControl or by
the render loop) should use an existing graphics device (i.e. it is
basically a public wrapper for values that go into a QRhi*InitParams
under the hood).

QQuickRenderTarget and QQuickGraphicsDevice are both demonstrated in a
new example: rendercontrol_d3d11. We choose D3D11 because it is
reasonably simple to set up a renderer with a window, and, because
there is known user demand for Qt Quick - external D3D engine
interop. Passing in the custom engine's own ID3D11Device and
ID3D11DeviceContext is essential: the texture (ID3D11Texture2D) Qt
Quick is targeting would not be usable if Qt Quick's QRhi was using a
different ID3D11Device.

Task-number: QTBUG-78595
Change-Id: I5dfe7f6cf1540daffc2f11136be114a08e87202b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-04-11 18:23:55 +02:00
Qt Forward Merge Bot 2812184e1b Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	src/qml/jsruntime/qv4executablecompilationunit.cpp
	src/qml/jsruntime/qv4executablecompilationunit_p.h
	src/qml/qml/qqmlobjectcreator.cpp
	src/qml/qml/qqmlpropertycachecreator_p.h
	src/qml/qml/qqmltypecompiler.cpp
	src/qml/qml/qqmltypedata.cpp
	tests/auto/qml/qmlformat/tst_qmlformat.cpp
	tools/qmllint/scopetree.cpp
	src/qml/qml/qqmlapplicationengine_p.h

Adjusted tools/qmllint/findunqualified.cpp to use newer API

Change-Id: Ibfb4678ca39d626d47527265e3c96e43313873d4
2020-04-09 10:08:41 +02:00
Laszlo Agocs e2ac02e942 twotextureproviders example: rip out legacy OpenGL material impl
Leave only the RHI version in. Also add a temporary forcing of the RHI
rendering path for now. This will go away when purging the direct OpenGL
path in Qt Quick because RHI will be the default anyhow.

Now both graph and twotextureproviders follow the same structure and
approach, and together serve as a fairly good examples of creating custom
materials in the RHI world.

Change-Id: I4aafd440f70d13b8033fd4fdf0ecce71798c68d2
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-04-07 17:09:12 +02:00
Laszlo Agocs d7a42f580c Update graph example CMake
Also update OTHER_FILES in the .pro although that's not strictly
required for building.

Change-Id: Ib48e64b298c1a7b1600ecd1f13580398679b72a2
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-04-07 17:08:52 +02:00
Laszlo Agocs fd4f121fca Remove QSGSimpleMaterial
And port the graph example to QSGMaterial and the RHI. We will not anymore add a
direct OpenGL path (that would mean using QSGMaterialShader) for the example because
the upcoming purge renders that useless anyway.

Task-number: QTBUG-82988
Change-Id: I137575ed5df45b6bfc34a11d73dc5100945081c5
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-04-07 17:08:39 +02:00
Laszlo Agocs 02d35ec094 Remove sgengine from scenegraph examples CMake project file
Change-Id: Ifb2f986ec9d4fd0bfdd35f2e59d7d1d916ac2098
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-04-07 11:52:29 +02:00
Laszlo Agocs 07d1dbcf7f Remove QSGEngine and move QSGAbstractRenderer back to private
QSGEngine goes away. Same for the associated example, which is the only
place this is used anywhere in Qt.

As a consequence, the renderer base class can be moved back to private:
there is no use for it to be public anymore, since that made sense only
in combination with QSGEngine. With the RHI-based rendering path driving
a renderer directly is more complicated than before so it is not
reasonable to allow the QSGEngine-style access anymore.

Instead, one has QQuickRenderControl, which allows redirecting and
manually driving the rendering of a QQuickWindow, thus providing an
alternative to the legacy QSGEngine approach.

Task-number: QTBUG-78596
Change-Id: If57c6b657b2053da1c4e545e517026382a71d998
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-04-07 11:37:32 +02:00
Laszlo Agocs 6387fdd329 Add missing include to d3d11underqml example
Change-Id: Ib1891a509dccdbe071ce71058aaa58887ddfeb8e
Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-04-07 10:28:29 +02:00
Samuli Piippo 014736755e Add special case for escaping quotes
<command-line>: warning: missing terminating " character
<command-line>: error: stray ‘\’ in program

Change-Id: Iab23419a707a105a9789b8d7af3740e320d54119
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-03-31 12:52:32 +03:00
Shawn Rutledge 99215e04e3 Screen example: avoid shadowing final props with required context props
Amends 90b4528b84 to fix the error
qrc:/window/AllScreens.qml:75 Cannot override FINAL property

Change-Id: Ie6528f6c9ccc6648ec76b4d237973588450cc932
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-03-24 23:11:31 +00:00
Laszlo Agocs 1a1028a1e4 Move legacy rendercontrol example into a subdirectory
...called rendercontrol_opengl under examples/quick/rendercontrol. This
example is going to be migrated to support operating with RHI-on-OpenGL
later on.

Additionally, we can this way introduce more rendercontrol examples in
the future, for example to show how to do things with Vulkan, Metal,
D3D.

Task-number: QTBUG-78595
Change-Id: I7f5243b1f86e62949400107bf12bfa07b17b1031
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-03-24 17:03:12 +01:00
Alexandru Croitor e558d0794b CMake: Regenerate projects
Change-Id: Ifd6b2289de6465a010f5f2a32789221767b4d5be
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-17 14:39:47 +00:00
Tor Arne Vestbø a5df29201f CMake: Update Apple platform defines after rename in qtbase
Change-Id: Ia0a075e3199eab735f9b289873beeb8730ebc47e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-03-17 10:42:00 +01:00
Alexandru Croitor f52b95a96c Merge remote-tracking branch 'origin/dev' into wip/cmake
Change-Id: Ieb9bcfba9651d646509afd065ce2389ef74448cc
2020-03-17 09:54:04 +01:00
Eskil Abrahamsen Blomfeldt 0820315bb5 Update dependencies.yaml to latest SHA1s
Required three updates to examples due to some changes in
the dependency graph.

Change-Id: I48dc9bf6d4fa82395bdf25deb1a768c354097bdc
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2020-03-13 14:07:03 +01:00
Alexandru Croitor 92dc998f6d Fix build failures as a result of QMetaType changes in qtbase
moc now stores the QMetaType of properties as a result of
46f407126ef3e94d59254012cdc34d6a4ad2faf2 in qtbase, which requires
full type information about the property type inside the moc generated
source file.

Many of the property types were forward-declared, and this resulted
in build errors like
  "invalid application of 'sizeof' to an incomplete type 'QQuickTransition'"

Make sure to explicitly include the moc files inside the counterpart
.cpp files, so that full information is available from included headers.

Fixes: QTBUG-82774
Change-Id: I5971713864992398daed72ce9f6ab866668cf8e1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2020-03-12 15:48:31 +01:00
Alexandru Croitor 8592ae4096 Merge remote-tracking branch 'origin/wip/cmake' into dev
Conflicts:
  dependencies.yaml

Change-Id: Ifff48b9d0e7962d481e63c49399e2d304e1011e5
2020-03-12 15:28:15 +01: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
Qt Forward Merge Bot 9bd034ea01 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I0d32fc5b99f8c9e4acb922fffe4dd5f3c5be553c
2020-03-11 01:00:07 +01:00
Simon Hausmann 3f3e82fb05 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	src/imports/controls/qtquickcontrols2plugin.cpp

Change-Id: Ifc09ea9f71fdba119fe8eed99f0bdcb402444f27
2020-03-10 14:24:28 +01:00
Ulf Hermann 4916189492 Add missing QPainterPath include in rendernode example
Change-Id: Idd8a0fb1f02ea6f226ffe4a6cee77f49aa947a84
Fixes: QTBUG-82791
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-03-10 12:20:02 +01:00
Fabian Kosmale b1fc5666de vulkan examples: fix missing include
Change-Id: Ib60218f59fc04a93aa6b7923c4b0ceb875cf78ad
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-03-09 18:50:47 +01:00
Fabian Kosmale 12aabcf2a1 fix duplicated properties resulting from bad merge
Change-Id: I26fa7d603d8097aab45a26e0c57a10d86491a840
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-09 18:50:25 +01:00
Olivier Goffart f3dccc334f Adapt to the the new QMetaType change
Fixes: QTBUG-82453
Change-Id: I7e5682945a07c3af183becd3947a69568f139d16
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-03-09 10:54:37 +01: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
Assam Boudjelthia 069afedec9 Examples: add .pro project for qml-i18n example
Currently only the .qmlproject is available for this project, which
won't deploy on Android, thus adding .pro project files. Also, since
the translation won't work without the *.qm files being present as
resources, those files are included by default with example.

Task-number: QTBUG-80717
Change-Id: I86ac6c4097e4207b7f62d628f9a72439e78639db
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-03-05 11:18:50 +02:00
Assam Boudjelthia 1fef24732b Examples: Add *.pro projects for existing *.qmlproject
The *.qmlproject won't deploy and run on Android, thus adding
normal .pro projects to allow deploying to Android.

Task-number: QTBUG-80717
Change-Id: I8a79a56bec57add315c08088a2fca5995df76912
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-03-04 12:13:06 +02:00
Assam Boudjelthia a962681a11 Examples: enable HighDPI scaling for Android
These examples show very tiny UI elements on Android devices,
thus enabling HighDPI.

Task-number: QTBUG-80717
Change-Id: Id3b4184bef74faf9f7d165ac211bd39375d67f62
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-02-24 12:12:34 +02:00
Qt Forward Merge Bot f6808f89a8 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	tests/auto/quick/qquickmousearea/BLACKLIST

Change-Id: I3de2c6377d57f5f9204d2cfc688d50a7a0b4150c
2020-02-21 09:00:37 +01:00
Ulf Hermann 8ccc86d319 Doc: Update documentation for "extending" example
It referred to qmlRegisterType() even though we don't call it anymore.

Change-Id: Ib07e4428d032e789d705156ddc4c9589fd797c65
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-02-19 11:26:05 +01:00
Qt Forward Merge Bot 440d699f83 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ia15cd13ed7014db80e02ba8b7e0588e3c53f832c
2020-02-19 01:00:06 +01:00
Johan Klokkhammer Helsing 872dc18e65 Quick: Don't qualify OpenGL includes (part two)
406f15ce0e only removed the "QtGui" prefix from some includes, but we are
trying to move (almost) everything OpenGL related from QtGui.

This removes prefixes for additional QOpenGL includes (QOpenGLShaderProgram,
versioned opengl functions etc.).

Task-number: QTBUG-74409
Change-Id: I91e1feac0676859f11de9b75301a0a4e81db50d9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-18 09:51:27 +01:00
Ulf Hermann 8bc51b89a1 Doc: Fix extension plugin examples and documentation
We advertise the usage of QQmlEngineExtensionPlugin, as registerTypes()
should be avoided if possible. The actual source code of the examples
already does this, but some of the includes and the documentation was
lagging.

Task-number: QTBUG-81615
Change-Id: Ibbee60ad55114bf6dc07875080c963e727f49e6b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2020-02-18 09:45:16 +01:00
Qt Forward Merge Bot 3e758800b4 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	src/imports/qtqml/plugin.cpp
	src/qml/qml/qqml.h
	src/qml/qml/qqmlmetatype.cpp
	src/qml/qml/qqmlmetatype_p.h
	src/qml/qml/qqmltypeloader.cpp
	src/qml/types/qqmlbind.cpp
	src/quick/items/qquickitemsmodule.cpp
	tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp

Change-Id: I52548938a582cb6510271ed4bc3a9aa0c3c11df6
2020-02-17 10:21:59 +01:00
Alexandru Croitor 1d4fa26a70 Regenerate qtdeclarative
Change-Id: I48d7fd306f3d1b161a8e73029282ee591b1ef612
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2020-02-12 17:30:34 +00:00
Mitch Curtis b7bbde88d0 Gallery: simplify the code for the help feature
Use existing data from the model rather than adding new properties.

Change-Id: I77f9b079d4ceefd1a0b9936b4250c2470c68836e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-02-12 14:21:42 +01:00
Ulf Hermann c398e6701d Modernize type registration in new examples
Change-Id: I26671d47d663c126e2bff41e8db7b0945db78643
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-11 19:26:44 +01:00
Ulf Hermann 90b4528b84 Avoid discouraged patterns in examples
In particular, use required properties where applicable, explicitly
import QtQml where we use it, avoid unqualified access into the root
scope of a component, use JavaScript functions with explicit parameters
as signal handlers.

Change-Id: I3eaaba47cc3c7a2a12d488e36f9eec145cedbb0e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-02-11 19:26:05 +01:00
Ulf Hermann 38c0370923 Doc: Fix "Extending QML" documentation
It mentioned qmlRegisterType where that didn't exist anymore.

Change-Id: If3e8c8ada746c720bff216df8c5f3fb618e09205
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-11 19:25:53 +01:00
Qt Forward Merge Bot 271fd0924e Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I4b20284eb05b6277c758a1ab5579b803db9a84ca
2020-02-08 03:04:16 +01:00
Ulf Hermann 6d0a453f41 Use the extended QQmlListProperty interface in a few places
Task-number: QTBUG-79263
Change-Id: If518f644b5b9eddbacfb1cb16fbb557127ffcfb2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-02-07 09:37:53 +01:00
Ulf Hermann b5a6b4c938 Avoid access to properties of parent in imagelements example
ImageCell's parent is not guaranteed to have these properties.
Therefore, rather pass them from the outside.

Change-Id: Ib42d1b9087d8757633b14c3a25cb638abb70fb21
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-06 12:11:03 +01:00
Ulf Hermann 461ecc535a Use inline components for sharing example
Change-Id: I9390982bfefa35e6db6c8516c62ba091c231be8a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-02-06 12:10:57 +01:00
Alexandru Croitor b134476cdb Post-merge fixes
Change-Id: I2350df5368ee34d6c7072d456806e518ce533839
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-30 20:45:49 +00:00
Qt Forward Merge Bot 5be153af99 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I1e1d9585d876a8eacd4c24afc894a33075f51a13
2020-01-30 01:00:57 +01:00
Alexandru Croitor b684ba2194 Merge remote-tracking branch 'origin/dev' into wip/cmake
Conflicts:
        dependencies.yaml

Change-Id: Ie3e9dc62031a85e5e81cbdf04694b95159d49fca
2020-01-29 16:52:58 +01:00
Alexandru Croitor 97a5cf8634 Regenerate examples
Change-Id: I39564d4b644a7ee367d9ce92b85426a5c2a122a4
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-01-29 15:39:22 +00:00
Eskil Abrahamsen Blomfeldt 19a74ba56e Fix vertical position of PathText
The PathText would always translate to y=0, regardless of what y
was set to. We should obviously get the y coordinate of the shape
*before* translating it into position to find the distance from
the baseline.

This change also updates the example, which had not been updated
to the changed origin of the PathText, and it adds a Lancelot test
for keeping track of the PathText shape rendering.

Change-Id: I940ac956af5229842739f8d8751a1f13bb86b8e7
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-01-29 14:45:41 +01:00
Ulf Hermann 406f15ce0e Quick: Don't qualify OpenGL includes
The headers are moving from QtGui to QtOpenGL. By avoiding the
qualification we can keep them compiling either way. Also, add
opengl-private to make the types available.

Also removed the QGraphicsRotation hack to get access to the projected
rotation function of QMatrix4x4. The function is public now.

Task-number: QTBUG-74409
Change-Id: I216e8ca09f8e247f96627b081308e3a57c55c29c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-01-27 13:03:18 +01:00
Qt Forward Merge Bot 9893e71cea Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Icb61522fb41a35303bb3d201b344a0407f67f9a0
2020-01-25 01:00:11 +01:00
Leander Beernaert 7c229d3cf8 Post merge fixes
Change-Id: Ie8aca222809f35174fb6c6488832ec3ff5432272
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-01-24 12:30:00 +00:00
Ulf Hermann 87e7203532 Use required properties to fix some more qmllint warnings
Change-Id: I4489bd55e8777b7bf591c41a21e2b6dfdf9ea996
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-23 10:38:14 +01:00
Eskil Abrahamsen Blomfeldt 1ee5fed75f Introduce PathText path element
For text rendering in Qt Quick, we currently have the limitation
that when rendering text at such a large size that the distance
fields start showing artifacts, the only option is to use
NativeRendering, which will look nice, but which will use a lot
of texture memory for the glyph cache, since it will actually
cache the glyphs at the requested size.

A suggested approach would be to fall back to using triangulated
paths when the font gets large enough, but the work on this was
never completed.

It turns out that we can get this now, basically for free, since
we already support rendering arbitrary QPainterPaths using
Qt Quick Shapes. The only thing missing is the ability to add
the path of a given text to the shape. This patch fills in that
gap.

Note that this is currently not supported by nvidia renderer.

[ChangeLog][QtQuick] Added PathText path element which can be
used together with Qt Quick Shapes to get text rendering that
does not cache glyphs in a texture, but triangulates the
outlines of the glyphs instead.

Change-Id: I436e1476b129b324cf7a54f89a1b18e0579e8185
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-01-21 11:48:54 +01:00
Laszlo Agocs fd272b60c3 Upgrade qsb files to version 4
Change-Id: Ic1a1f5ff49c34d72495bc74083f37db118c935c1
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-01-21 10:41:32 +01:00
Eskil Abrahamsen Blomfeldt 15ea475b40 Make FontLoader.name read-only
Being able to set the name of a FontLoader seems to have been made to
allow for some alternative coding patterns, but it doesn't really
provide any convenience over other ways of customizing font names,
and it definitely adds confusion for users, as well as as a possible
race condition if both the source and name of the same FontLoader is
set at unpredictable times.

[ChangeLog][QtQuick] FontLoader.name property has been made read-only
to reduce confusion about its use and precedence over conflicting
properties.

Fixes: QTBUG-80031
Change-Id: I0dd0e76ff376402c0b458ed7e5c57ec017bbc92d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-01-21 07:27:30 +01:00
Leander Beernaert 1d333d3375 Merge remote-tracking branch 'origin/dev' into wip/cmake
Change-Id: I0c5b939c70bdb91ccdf7068784308416dcaa5736
2020-01-16 16:25:06 +01:00
Qt Forward Merge Bot 499c6ed78d Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I3058a6b9347d7ca2a0c04a58cb030ae5c47de415
2020-01-15 12:18:57 +01:00
Qt Forward Merge Bot 8a22c92b55 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	src/imports/folderlistmodel/plugin.cpp
	src/imports/layouts/plugin.cpp
	src/imports/localstorage/plugin.cpp
	src/imports/models/plugin.cpp
	src/imports/particles/plugin.cpp
	src/imports/qtqml/plugin.cpp
	src/imports/qtquick2/plugin.cpp
	src/imports/shapes/plugin.cpp
	src/imports/statemachine/plugin.cpp
	src/imports/testlib/main.cpp
	src/imports/wavefrontmesh/plugin.cpp
	src/imports/window/plugin.cpp
	src/imports/workerscript/plugin.cpp
	src/qml/jsruntime/qv4sequenceobject.cpp
	src/qml/qml/qqmlengine.cpp
	src/qmlmodels/qqmlmodelsmodule.cpp
	src/qmlmodels/qqmlmodelsmodule_p.h
	src/qmlworkerscript/qqmlworkerscriptmodule.cpp
	src/qmlworkerscript/qqmlworkerscriptmodule_p.h
	src/quick/items/qquickitemsmodule.cpp

Change-Id: I5f1fbc3d00e8f583d2c89afc5389de84d68633a7
2020-01-14 11:24:11 +01:00
Ulf Hermann da4cdfec98 examples: Make qmlextensionplugins example usable without installation
The qmldir file as well as the .qml files have to be placed next to the
plugin, the import path has to be added to the .qmlproject, we want the
.qmltypes file added to the same place, and the plugins.qml should also
be available in the destination directory.

Change-Id: I82b369693e612779c6213345cc8f6a30b16d41b4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-14 09:44:15 +01:00
Ulf Hermann 2c3419e127 Generate registrations for all examples
Now that we can generate all QML type information at build time, we
should also use it.

Change-Id: I647c72bbe38fdb2deb565b75c86a696af3d15b61
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-13 16:47:57 +01:00
Fabian Kosmale 4eff729950 Binding example: Fix type registration
Fixes: QTBUG-81335
Change-Id: Ie93c9b7ad49703bce245592e659ccdb6ea2b7ed9
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-01-13 13:27:36 +01:00
Ulf Hermann 8550dff55c Make draganddrop example less confusing
Use required properties, rather than context, use direct binding rather
than Binding elements, clarify that we're using the drag passed as
parameter, not the drag property of DropArea, move Icon to a different
file so that we get a distinct type for it. Give the icon a defined
color while it is being dragged.

Change-Id: I0e8b77abaedb9fc52660dfd4ddef1a4161f1323a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-01-10 12:04:33 +01:00
Friedemann Kleint 492586930b Gallery example: Add "Help" menu and shortcut
Add a property "control" identifying the control to be demo-ed
to the page and add a help shortcut and menu item displaying
its help.

Change-Id: Ic3c7c31f5a44fccd57ee018fd3681dc6bdffee58
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2020-01-10 10:04:09 +01:00
Laszlo Agocs 0b9fcb8293 Remove D3D12 scenegraph backend
Task-number: QTBUG-79925
Change-Id: Id3f0a688f47efaf1653c85d23ef49618ed09c931
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2020-01-06 18:13:37 +01:00
Liang Qi ec686af14f Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	.qmake.conf
	tests/auto/controls/data/tst_combobox.qml

Change-Id: I8471cdac4397f77a8e58140d58c6b50d3c437928
2019-12-30 11:44:50 +01:00
Leander Beernaert bb1450c1a8 Rename example target to avoid conflicts in super build
Change-Id: I974329c52b24134638fbf86a44c1d949ce41b547
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-12-17 16:05:08 +00:00
Mitch Curtis bcdd38074b clang-tidy: fix cppcoreguidelines-pro-type-member-init
Ensure that all members are initialized and remove an unused member.

Change-Id: Ibfb3ea86b7791cd6f8683b68e7cd3bc4256b33f7
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-12-12 15:41:00 +01:00
Paul Olav Tvete a7325668a2 Minimal documentation for new example
Task-number: QTBUG-80500
Change-Id: Ifdd13bc404dd3ee34d14b339e24a72d647b6796f
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-12-12 13:51:16 +01:00
Paul Olav Tvete f2a727eb84 Add vulkantextureimport example
This is essentially the rendering code from vulkanunderqml put
into the structure of metaltextureimport with some added memory
barriers.

Task-number: QTBUG-80500
Change-Id: If38301c039b38e3798ff482625daa5f63e8d6fb2
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-12-12 13:51:07 +01:00
Maximilian Goldstein 265a6dc6e2 examples/quick/shared/FlickrRssModel.qml: Do proper error handling
Change-Id: Ieaed0706965bbb259934fb83151856f3d5805331
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-11-29 10:34:51 +01:00
Maximilian Goldstein c2f6a4cf63 examples/touchinteraction/multipointtouch: Fix broken score display
Fixes the broken score display in "Bearwhack".

Change-Id: I43581947f71e4c6dd3cca43068f6d220a058cc46
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-11-29 10:34:41 +01:00
Maximilian Goldstein 6efdefda28 examples/quick/views/pathview: utilize required properties
Change-Id: I07c5068de9330236b2e593d9995fdfda3e019006
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-11-29 10:34:27 +01:00
Maximilian Goldstein c8b7318299 examples/quick/localstorage: Fix some linter warnings
Also fixes MouseArea using anchors within a Layout and relying on
properties that might be null.

Change-Id: I9078ded60870019c8ac9f8ff5d52d9924b51c49c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-11-28 14:07:10 +01:00
Maximilian Goldstein a6fe62fcb4 examples/quick/animation/layouts: Avoid unqualified access
Change-Id: I75f67b54d75840c215c2dfe592ff95c5cb962ff2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-11-28 13:43:27 +01:00