aboutsummaryrefslogtreecommitdiffstats
path: root/examples/qml
Commit message (Collapse)AuthorAgeFilesLines
* qmlfunctions.qdoc: Add clarification to QML_FOREIGNMaximilian Goldstein2020-11-231-0/+4
| | | | | | | Fixes: QTBUG-87150 Change-Id: If99a06a07892bdfef7b6b1e8fa737480750992fe Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 56f428c360191230b571969a2651e85380030afa)
* 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>
* Doc: Fix minor typosSze Howe Koh2020-08-301-1/+1
| | | | | | | Change-Id: I4c51c40697e410d56b6a2d2446ed9f8ae218576d Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> (cherry picked from commit 024ec9c564abfbe9aadd2193deeaa0d37464119a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Examples: Fix double installation of .qml filesKai Koehne2020-06-025-25/+5
| | | | | | | | | | | qt_example_installs.prf already generates install rules for all example sources, including content of .qrc files. Fixes: QTBUG-84301 Change-Id: I3454b19849af489c5819c51867781cc97f1eb285 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 1f0b3a54ffa2ab0dc0cdff1345980ea68d749d24) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Examples: add .pro project for qml-i18n exampleAssam Boudjelthia2020-03-058-7/+101
| | | | | | | | | | | 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>
* Examples: Add *.pro projects for existing *.qmlprojectAssam Boudjelthia2020-03-043-0/+79
| | | | | | | | | 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>
* Doc: Update documentation for "extending" exampleUlf Hermann2020-02-191-0/+2
| | | | | | | It referred to qmlRegisterType() even though we don't call it anymore. Change-Id: Ib07e4428d032e789d705156ddc4c9589fd797c65 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Doc: Fix extension plugin examples and documentationUlf Hermann2020-02-183-3/+3
| | | | | | | | | | | | 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>
* 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>
* Doc: Fix "Extending QML" documentationUlf Hermann2020-02-111-1/+1
| | | | | | | It mentioned qmlRegisterType where that didn't exist anymore. Change-Id: If3e8c8ada746c720bff216df8c5f3fb618e09205 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Use the extended QQmlListProperty interface in a few placesUlf Hermann2020-02-0712-11/+39
| | | | | | | Task-number: QTBUG-79263 Change-Id: If518f644b5b9eddbacfb1cb16fbb557127ffcfb2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* examples: Make qmlextensionplugins example usable without installationUlf Hermann2020-01-142-6/+17
| | | | | | | | | | 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>
* Generate registrations for all examplesUlf Hermann2020-01-1348-192/+285
| | | | | | | | 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>
* Fix xmlhttprequest exampleUlf Hermann2019-11-141-1/+1
| | | | | | | | The "pressed" property belongs to mouseArea, not button. Change-Id: Ib35c520b75e30c2cb9a3a7dee0b482a2209040c8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Specify parameters of type registration in class declarationsUlf Hermann2019-09-2641-68/+93
| | | | | | | | | | | | | | | | | | | | | 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>
* i18n examples: Add en translation dummiesKai Koehne2018-07-171-0/+4
| | | | | | | | | | | | | | | | | We endorse using QTranslator::install(const QLocale&...), because it tries loading translations from all QLocale::uiLanguages() instead of the commonly used QLocale::system().name() setup. Anyhow, the first method requires an English translation - otherwise a second favorite language might be used. Pave the way to making the switch by adding (empty) English translations to our examples. Task-number: QTBUG-69196 Change-Id: Ie85be875e34e29e80c1693bbf477b962e35a7d87 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* i18n examples: Update .ts filesKai Koehne2018-07-173-6/+6
| | | | | Change-Id: I3c1987bac8251b087fab98d6caaaba267dcc4be8 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Doc: Add missing dots (qtdeclarative)Paul Wicking2018-06-194-14/+14
| | | | | | Task-number: QTBUG-68933 Change-Id: Ibb5aa227e82825085e7214e17dcffcb17fd44157 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Clarify ownership around QQmlEngine::setNAMFMårten Nordheim2018-04-261-1/+2
| | | | | | | | | | | We were leaking an instance of MyNetworkAccessManagerFactory in the "NetworkAccessManagerFactory"-example. To add to this the documentation around QQmlEngine::setNetworkAccessManagerFactory did not specify whether or not it took ownership, causing confusion. Change-Id: Ic9eee2c45682c752bcb4aa98943fc0af2b630795 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@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 the override keyword consistently and correctly (clang-tidy)Shawn Rutledge2018-02-272-4/+4
| | | | | Change-Id: If9e28d143f8cba3df3c757476b4f2265e2eb8b2a Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-2614-15/+15
| | | | | | | | | | | | | 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 FDL license headerKai Koehne2017-10-176-31/+31
| | | | | Change-Id: I76dccf547de40b5e72fd7abaa062fa96cb2c118a Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Fix outdated BSD license headerKai Koehne2017-10-17117-348/+1518
| | | | | Change-Id: Icc08925454445fc9497fb3bfd2c26efe90605983 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Doc: Fix capitalization in section titlesTopi Reinio2017-08-291-1/+1
| | | | | | | | ...and fix some section titles to be less confusing. Change-Id: If83c3faffead9e2e9be7fc0fb360f1c5b8b1bb51 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
* Fix GCC 7 warnings in examplesFriedemann Kleint2017-06-211-1/+1
| | | | | | | | | | | | | plugin.cpp: In member function 'virtual void MinuteTimer::timerEvent(QTimerEvent*)': plugin.cpp:85:28: warning: ignoring return value of 'QTime QTime::addSecs(int) const', declared with attribute nodiscard [-Wunused-result] time.addSecs(60); main.cpp: In function 'int qMain(int, char**)': main.cpp:71:1: warning: no return statement in function returning non-void [-Wreturn-type] Task-number: QTBUG-60630 Change-Id: I0c0002533aa28c480a4d9eb45856dd10753d2476 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Doc: make screen xmlhttprequest compatible with DesignerNico Vertriest2017-05-036-40/+150
| | | | | | Change-Id: Ieaf45a817d4568bd2cd7c3cbbfee62435c2e2594 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Merge remote-tracking branch 'origin/5.8' into 5.9Simon Hausmann2017-03-151-9/+9
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qqmltypecompiler.cpp src/qml/compiler/qqmltypecompiler_p.h src/qml/qml/qqmltypeloader.cpp src/qml/qml/qqmltypeloader_p.h Change-Id: I4894555ab7a0879b56bbda7a46d16d1c40c19e7c
| * Doc: added snippets to Extension Objects ExampleNico Vertriest2017-03-131-9/+9
| | | | | | | | | | Change-Id: Icbd2393d4b8523e24328f765e76869c86afb3e72 Reviewed-by: Topi Reiniö <topi.reinio@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-092-2/+11
| | | | | | | 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-092-4/+19
| | | | | | | Rearranged in logical order of example build up Change-Id: I6af8e39bd900d4ce058de46e0b3ebd5e368222c8 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: minor grammar mistakeNico Vertriest2016-12-211-1/+1
| | | | | Change-Id: If3aebd27e886181ebe0d41532935afdfb974586c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Get rid of most QT_NO_FOO usagesLars Knoll2016-11-291-8/+8
| | | | | | | | Instead use QT_CONFIG(foo). This change actually detected a few mis-spelled macros and invalid usages. Change-Id: I06ac327098dd1a458e6bc379d637b8e2dac52f85 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Turn the no-network support into a configurable featureLars Knoll2016-10-101-2/+3
| | | | | | Change-Id: Ic70f60c124fe166b37fbe9b853735be3c5e0d46d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.7' into devEdward Welbourne2016-08-022-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickshadereffect.cpp 5.7 had a bug-fix in code dev has replaced wholesale. src/quick/items/qquickwindow.cpp src/quick/items/qquickwindow_p.h One side changed a method's signature; the other side renamed a method declared adjacent to it and changed some code using it, moving some from the public class to its private partner. tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp One side added a blank line before a comment the other re-wrote. Kept the re-write, killed the stray blank. .qmake.conf Ignore 5.7's change to MODULE_VERSION. src/qml/compiler/qqmltypecompiler.cpp src/qml/compiler/qqmlpropertyvalidator.cpp 5.7 changed code in the former that dev moved to the latter. Reflect 5.7's changes there, adapted to dev's form. src/qml/qml/qqmlobjectcreator.cpp One side added new QVariant types; the other changed how it handled each type of QVariant (without git seeing any conflict); adapted the new stanzas to work the same as the transformed ones. tests/manual/v4/test262 dev had a broken sha1 for it; so used 5.7's 9741ac4655808ac46c127e3d1d8ba3d27ada618e Change-Id: I1fbe2255b97d6ef405cdd1d0cea7fab8dc351d6f
| * PieChart examples: initialize membersEdward Welbourne2016-07-152-2/+2
| | | | | | | | | | | | | | | | | | | | Coverity (CID 161680, 161678) pointed out that constructors don't initialize some members; getters would have returned drivel if called before setters. Unimportant but we should set a good example in our example code. Change-Id: Ia0483cfbe2cae379a0e84f10db1d8edc9cb5c52b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-247-3/+16
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4engine_p.h src/qml/jsruntime/qv4runtime_p.h src/qml/qml/qqmldelayedcallqueue.cpp src/qml/qml/qqmlvaluetypewrapper.cpp src/qml/qml/qqmlvmemetaobject.cpp src/qml/qml/v8/qv8engine_p.h tests/auto/quick/qquicktext/tst_qquicktext.cpp Change-Id: I3f0608c7beb88088cbbef4d0db59920f56deaea9
| * actually build and install the qml tutorialsOswald Buddenhagen2016-05-136-2/+11
| | | | | | | | | | | | Change-Id: Idf81981140e210b29239e91ff5b6b7c40e2f36de Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
| * fix example installsOswald Buddenhagen2016-05-131-0/+2
| | | | | | | | | | Change-Id: Ie6a219392a48fd6b1a32037cc215dc20d408e819 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
| * make use of COPIESOswald Buddenhagen2016-05-131-1/+3
| | | | | | | | | | Change-Id: I479c9523a89be1d64364e8205daa5860e16882cc Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>