aboutsummaryrefslogtreecommitdiffstats
path: root/examples/qml/referenceexamples
Commit message (Collapse)AuthorAgeFilesLines
* 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. Task-number: QTBUG-87150 Change-Id: I2b5dfcea3e835d4e69d5fa4df179333a37ee1d6e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit e7d90fc5268cdca6aa10f422f00ad4a0049ea157) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* Fix installation of examples.Christian Kandeler2012-11-2212-33/+37
| | | | | | | | | | Enable examples to be built in the target tree. This entails installing the project files and possibly other missing stuff. Task-number: QTBUG-27977 Change-Id: I159fd8e3ebc7077e1d68e085c4947acc058ce594 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: hjk <qthjk@ovi.com>
* Install the Qt Quick 2 examples in the "qtquick" dirThiago Macieira2012-11-0911-22/+22
| | | | | | | | Leave the "qtdeclarative" dir for Qt Quick 1, which is where it used to be in Qt 4. Change-Id: I44997771d77617564fc608c1aba95e3ada8f9a69 Reviewed-by: Christopher Adams <chris.adams@jollamobile.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-2366-396/+396
| | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* More consistent examples directory structureAlan Alpert2012-08-1090-0/+5650
Under examples the next directory level distinguishes imports/modules and the next directory level distinguishes examples. Change-Id: Icabadaac6ccb9c1c424efa9c9e64a7d94bc7c0da Reviewed-by: Alan Alpert <alan.alpert@nokia.com>