aboutsummaryrefslogtreecommitdiffstats
path: root/examples/qml/referenceexamples
Commit message (Collapse)AuthorAgeFilesLines
* Polish the QML reference examplesFriedemann Kleint2021-11-0452-461/+279
| | | | | | | | | | | | | | - Use member initialization, which allows for using constructors from the base classes - Use qsizetype for indexes - Use qInfo() instead of qWarning() for printing - Add spaces/fix formatting Change-Id: Iebce1b810ce00f29395207d93303363b3b71e52e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit c442ed4d65b0319e4abd7a931cfb2f1f72842b84) Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Update qml examples for improved target path handlingCraig Scott2021-08-2511-198/+55
| | | | | | | | | | | | | 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 Change-Id: Ie3399410cf6df491eb1e7b4a589ca26c577d82a0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 9e1d2a0eb15487f8f2acb4d91b281568897fb4e1)
* Raise cmake_minimum_required to VERSION 3.16 in examplesJoerg Bornemann2021-08-1711-11/+11
| | | | | | | | Task-number: QTBUG-95636 Change-Id: I9f76b787533dad1c469fbb8c69df6c27b20a9aa3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit b4ab58d791167329259f5403e52ce6c85b5f0074) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Switch examples to build as isolated sub-buildsCraig Scott2021-05-271-11/+11
| | | | | | | Task-number: QTBUG-90820 Change-Id: Id9157526898ba72cb64ee8256639b37357f7bacf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* QQmlListProperty: Use qsizetype rather than int for sizesUlf Hermann2020-11-092-12/+12
| | | | | | | | | | [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>
* CMake: Regenerate examples to set the WIN32_EXECUTABLE propertyAlexandru Croitor2020-10-2611-0/+44
| | | | | | | | | 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>
* CMake: Regenerate examples to use qt_add_executableAlexandru Croitor2020-10-2011-11/+11
| | | | | | Task-number: QTBUG-87661 Change-Id: Ie5bba408000211b24694aa0143bdf79c4a298f42 Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
* Fix lineedit exampleUlf Hermann2020-10-051-1/+1
| | | | | | | | | | 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>
* Example: Pass QDate, QTime by value, not by const referenceEdward Welbourne2020-09-018-11/+11
| | | | | | | They're value types, packaging qint64 and int, repsectively. Change-Id: Icf18794466cd140e1384d6dd0de736fbb2c05a48 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Use QList instead of QVectorJarek Kobus2020-06-251-2/+2
| | | | | | Task-number: QTBUG-84469 Change-Id: I4c3353c00a566023503fbc178ba8454391dc334c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* CMake: Don't install .qmltypes for Qt tests, examples and toolsAlexandru Croitor2020-05-2911-11/+0
| | | | | | | | | | | 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>
* CMake: Regenerate qtdeclarative/examplesAlexandru Croitor2020-05-2911-11/+55
| | | | | | | | | Includes - new example installation paths - one case of QT_QMLTYPES_FILENAME addition Change-Id: I24423da9b04b6ecc8445017fa35f148dd43b1829 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2020-03-1213-12/+38
|\ | | | | | | | | | | | | | | Conflicts: dependencies.yaml src/qml/qml/qqmlengine.cpp Change-Id: I6a73fd1064286f4a2232de85c2ce7f80452d4641
| * Avoid discouraged patterns in examplesUlf Hermann2020-02-113-3/+3
| | | | | | | | | | | | | | | | | | | | | | 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>
| * Use the extended QQmlListProperty interface in a few placesUlf Hermann2020-02-0710-9/+35
| | | | | | | | | | | | | | Task-number: QTBUG-79263 Change-Id: If518f644b5b9eddbacfb1cb16fbb557127ffcfb2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Regenerate examplesAlexandru Croitor2020-01-2911-0/+88
| | | | | | | | | | | | Change-Id: I39564d4b644a7ee367d9ce92b85426a5c2a122a4 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Merge remote-tracking branch 'origin/dev' into wip/cmakeLeander Beernaert2020-01-1631-34/+66
|\| | | | | | | Change-Id: I0c5b939c70bdb91ccdf7068784308416dcaa5736
| * Generate registrations for all examplesUlf Hermann2020-01-1331-34/+64
| | | | | | | | | | | | | | | | 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>
| * Binding example: Fix type registrationFabian Kosmale2020-01-131-0/+2
| | | | | | | | | | | | Fixes: QTBUG-81335 Change-Id: Ie93c9b7ad49703bce245592e659ccdb6ea2b7ed9 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2019-10-1425-86/+107
|\| | | | | | | | | | | | | Removed dependencies.yaml because we don't use it yet in wip/cmake. Fixed conflict in qmlcachegen.cpp. Change-Id: Ie1060c737bee1daa85779903598e5b6d5020d922
| * Specify parameters of type registration in class declarationsUlf Hermann2019-09-2624-54/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using this technique we can automatically register all necessary revisions and minor versions of a type, using the metaobject system. This greatly reduces the potential for mistakes and resulting incompatibilities between versions of imports. We assume that for each type we need to register all revisions of its super types and its attached type, and that the revisions match. That is, if you import version X of type A, you will also get version X of its attached type and of any super types. As we previously didn't take these dependencies into account when manually registering the types, a number of extra revisions are now registered for some types. Potentially, we can now generate the qmltypes files at compile time, using moc. Change-Id: I7abb8a5c39f5e63ad1a0cb41a783f2c91909491b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Reference Examples: Fix calls to exec() and exit codesUlf Hermann2019-08-3011-32/+34
| | | | | | | | | | | | | | | | exec() is a static member of QCoreApplication and should be called as such. In case of errors we should return a non-0 exit code from main(). Change-Id: I0fefa006841b367d06a9de1fd1284cb7caf467bd Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Use qmlRegisterAnonymousType in examples and testsUlf Hermann2019-08-277-16/+16
| | | | | | | | | | | | Change-Id: I511d18ad8f73ea77a208e4448a8f86e5be5facc3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Regenerate ExamplesLeander Beernaert2019-10-1411-22/+22
| | | | | | | | | | Change-Id: I2fbfb44bbb6d667e022bffb480feaf74ff0d0a5e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-10-1143-65/+65
|\| | | | | | | Change-Id: I4a91928610f79c8e21a05781953ffa41508c828a
| * Reference Examples: Avoid static_cast on function argumentsUlf Hermann2019-08-201-1/+1
| | | | | | | | | | | | | | | | qobject_cast is safer and not very expensive here. Change-Id: Ie87219e2a5092e453d257064a95a790de31015f5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Reference Examples: Use override for overridden virtual functionsUlf Hermann2019-08-202-2/+2
| | | | | | | | | | | | Change-Id: I9f4225bf312856d08fd08431353f3cb36d0f7fa5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Reference Examples: Use nullptrUlf Hermann2019-08-2021-39/+39
| | | | | | | | | | Change-Id: I325cfdcf488e9d238e618ca23ef40aedf7c5eec1 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Reference Examples: Use auto for results of new and component.create()Ulf Hermann2019-08-2014-14/+14
| | | | | | | | | | | | Change-Id: Ibfd92fbc5a99b38cf8b31a11c0adfdfa69e2bb36 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Reference Examples: Use initializer lists to avoid repeating type naemsUlf Hermann2019-08-208-9/+9
| | | | | | | | | | Change-Id: Iff0b31d9b641a55ea246235ba1d7a066592ef0c0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Update Examples with lowercase qt6_add_resources()Leander Beernaert2019-09-2011-11/+11
| | | | | | | | | | | | | | | | Re-run pro2cmake on all exampls. Change-Id: Iafd1092beff023b407a8f29c2a5b651f2e534b75 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Convert ExamplesLeander Beernaert2019-08-2312-31/+506
| | | | | | | | | | | | | | | | This patch converts all examples in qtdeclarative except for a few exceptions which require a public facing qml plugin api. Change-Id: I2cd2b1bb455be8b48796893a8235dea7f8b35aa2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-07-111-28/+20
|\| | | | | | | Change-Id: I2963c1209316fb6755f572969f368970450d7991
| * Port from QLineEdit::getTextMargins() to textMargins()Marc Mutz2019-07-031-28/+20
| | | | | | | | | | | | | | getTextMargins() will be deprecated soon. Change-Id: I328f87553585fd1450c85191422013ebc0c8f7f8 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Initial CMake portAlexandru Croitor2019-06-032-0/+40
|/ | | | | | | | | Crude port of QtQml, QtQmlModels, QtQuick and a few tests and a few examples. Task-number: QTBUG-74136 Change-Id: I5de4d8215b33d1a4a72c2c0e7951e4b384f27e3e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Examples: remove bogus returnv5.11.0-beta3J-P Nurmi2018-04-031-1/+1
| | | | | Change-Id: I653974c80c6767d9af95b9157a73c09dbdeb76cc Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-2610-10/+10
| | | | | | | | | | | | | From now on we prefer nullptr instead of 0 to clarify cases where we are assigning or testing a pointer rather than a numeric zero. Also, replaced cases where 0 was passed as Qt::KeyboardModifiers with Qt::NoModifier (clang-tidy replaced them with nullptr, which waas wrong, so it was just as well to make the tests more readable rather than to revert those lines). Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix outdated BSD license headerKai Koehne2017-10-1766-198/+858
| | | | | Change-Id: Icc08925454445fc9497fb3bfd2c26efe90605983 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Replace QList<Person*> with QVector<Person*> and function pointersMichael Winkelmann2017-03-072-2/+39
| | | | | | | | | | The usage of the QQmlListProperty QList constructor is discouraged since QList violates QML's memory management rules. Replaced the QList with a QVector and passed the function pointers to the QQmlListProperty constructor instead, as officially recommended. Change-Id: I6d28a43530cc3edd5e7d89c351bad70deb721689 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Doc: added specs to Extending QML - Methods ExampleNico Vertriest2017-01-091-2/+2
| | | | | | | Change-Id: I7386c2bd738776455a71bde8cffdcedb9e292b24 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
* Doc: Rearranged order of Extending QML ExamplesNico Vertriest2017-01-091-0/+4
| | | | | | | Rearranged in logical order of example build up Change-Id: I6af8e39bd900d4ce058de46e0b3ebd5e368222c8 Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
* Port examples to new connection syntax.Friedemann Kleint2015-07-222-2/+2
| | | | | Change-Id: I121c59ac0ad56acb4cd54b99ecd37567368385ce Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Fixed license headersJani Heikkinen2015-02-1766-198/+198
| | | | | Change-Id: I4d5640ff95e1361ec7e65fb3e87d7726d8185ff5 Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
* Update copyright headersJani Heikkinen2015-02-1266-330/+330
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* the qmlextensionplugins example and a bunch of reference examples need QtQuickOswald Buddenhagen2014-02-211-5/+7
| | | | | | Task-number: QTBUG-36893 Change-Id: If1f937113b651fd2255f8004739f2c601e3826bf Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* the shell example and a bunch of reference examples need no QtGuiOswald Buddenhagen2014-02-215-5/+5
| | | | | | Task-number: QTBUG-36893 Change-Id: I51e402c90bd727cd3066788e0864e887ab8cb9e4 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* fix whitespaceOswald Buddenhagen2014-01-2218-27/+27
| | | | | | | remove trailing spaces and expand tabs Change-Id: Ieacb9d096b612c45d1a64700044c114d1f7522bc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-1066-66/+66
| | | | | | Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* make use of qtHaveModule()Oswald Buddenhagen2013-01-101-1/+1
| | | | | | | Change-Id: I23f11c944fafb5863a960dcc83bc1e57e189f662 Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com> Reviewed-by: Tasuku Suzuki <stasuku@gmail.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* centralize and fixup example sources install targetsOswald Buddenhagen2012-12-1012-49/+23
| | | | | | | | follow respective change in qtbase Change-Id: I27502eb7ebea973e19ec5f7c3ec0e2338556f6e0 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>