summaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* Improve QtSensors maze example applicationJuha Vuolle2021-07-022-155/+152
| | | | | | | | | | | | | | | | | | | | | | | The original problem was that the example accesses tilt sensor readings even if such sensor is not present, which yields errors. In addition to fixing that, few other concerns are addressed as well. As a summary: - show a screen blocker if tilt sensor is not found - run tilt read / game timer only when the game is running - display the tilt sensor identifier - remove the use of nonexistent TiltSensor::enabled property - separate initial element instantiation from new game generation - remove unnecessary start timer - log dynamic element creation errors, and remove unnecessary component 'ready' checks (as only local QML is used) Task-number: QTBUG-72328 Task-number: QTBUG-92514 Change-Id: I6a1589297c3c34b85e2876ede52eab31e07dd950 Reviewed-by: Lorn Potter <lorn.potter@gmail.com> (cherry picked from commit d28e4c588ba454001299b99183576f6b3b0b38b8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove QML import versions from QtSensor examplesJuha Vuolle2021-07-0118-30/+30
| | | | | | | | | | QML import versioning is optional and often unnecessary in Qt 6. Task-number: QTBUG-92505 Change-Id: I60acf84d8c75560396b896597b143dad283a2e5b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 763b64cca21817af24d944d631c0fb676da8ba23) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Replace Q_FOREACH with ranged for loopsJuha Vuolle2021-06-081-1/+1
| | | | | | Task-number: QTBUG-92505 Change-Id: I1e8334473c883f76285736f6a26138ea882f5351 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Fix and simplify sensor_explorer exampleJuha Vuolle2021-06-0220-1302/+486
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit strives to both fix and simplify the application and bring its intended demonstrative purpose more forward, consequently hopefully also making the example easier to understand and maintain. First, the sensor_explorer example used QQC1 functionalities which are no longer available in Qt6. The removed elements were such that the datamodels needed to be redesigned. This commit changes the example to use bit more standard Qt model-view approach. Second, the sensor_explorer application has not worked in years on Android due to missing QML plugin installation. While this could be fixed, in the name of simplicity the example is now a single binary. Third, the explorer allowed editing of sensor values. While this could be a feature of the example, it perhaps deviates from the gist of the example making it more difficult to understand. Thus the editing was not added as part of the example rewrite. It can be added later though. Task-number: QTBUG-92514 Task-number: QTBUG-92505 Task-number: QTBUG-63054 Change-Id: Icd620ea605a87ba74a42cd1309a3c02d05b146ac Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* QtSensors: Fix backend loading in examples on static buildsTamás Martinec2021-05-192-0/+4
| | | | | | | | | | Added explicit sensors entry and plugin entries to the .pro files as the sensor plugins won't be linked on static builds (for example on iOS) otherwise. Task-number: QTBUG-92508 Change-Id: I6d7364ee2094be5a79bddd12ba041a69057dc070 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Rename subclass static variable which shadowed baseclass methodJuha Vuolle2021-05-193-9/+8
| | | | | | | | | | | The 'type' static variable shadowed the 'QSensors::type()' method of the baseclass. While this is easy to workaround it is better to remove such naming clash. Task-number: QTBUG-60246 Change-Id: Id0ddae978377ea4d4d0202a572c554c2541f9364 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* QtSensors: Fix the sensorgestures example on iOSTamás Martinec2021-05-111-0/+2
| | | | | | | | | Added explicit plugin entry to the .pro file as the gesture plugins won't be linked on iOS otherwise. Task-number: QTBUG-92508 Change-Id: I6d84a4ea706bd7f67d51c247588d3cc80e99ac98 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Android: Fix build error issue in examplesJukka Passi2021-05-052-1/+3
| | | | | | | | | | | Added android branch to qtsensors example to get correct library architecture for the build Fixes: QTBUG-56322 Pick-to: 5.15 Change-Id: I6d15a423efdf232d7f187b39cd81606bb64f9a00 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
* Enable sensor_explorer example standalone buildJuha Vuolle2021-04-273-9/+10
| | | | | | | | | | | | | This commit enables building of the example outside of the source tree. Currently the example does not work with Qt 6.2 but requires more "content work" that shall be done under QTBUG-92514 Also removed the Widgets related code as the example is a Quick application. Task-number: QTBUG-92502 Change-Id: I016cf6697dc4603c77437c7f20601937b1fca293 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add cmake support for two examples missing itJuha Vuolle2021-04-264-11/+65
| | | | | | | | | The grue example remains commented out, it will be addressed with a separate commit as part of the QTBUG-92514 Task-number: QTBUG-92502 Change-Id: Ieb1a61b942ac6adc6880e33478059893a9492730 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QtSensors initial cmake supportLorn Potter2021-04-1916-0/+617
| | | | | | | | | | | | | | | | | This commit introduces the bare minimum cmake support that should unblock the CI and allow further verification and development on most platforms: macOS, Linux, Win, iOS and Android. Some clarifications: * The support for sensorfw backend is very preliminary and can be enabled later if needed (no Qt6 version of the sensorfw). * The simulator backend is dropped as obsolete / unnecessary. * Three examples are currently commented out and shall be ported with a later commit. Task-number: QTBUG-92502 Change-Id: Id523d43ed3ef177010dc73afc5812ed374cff0dd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Base commit to make QtSensors runnable on WindowsJuha Vuolle2021-04-193-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Fair amount of work remains after the commit still, but this should allow further development as a compilable baseline: code compiles, autotests pass, and most example applications at least start. The changes: -Change examples to use QtQuickControls 2 as per removal of v1 -Fix ambiguous conditional expression compilation error -Link against runtimeobject library (previously part of winrt QPA?) -Change the .pro file rule to win32 as winrt moniker does not exist anymore -Remove references to deleted winrt event dispatcher -Fix error handling: getdefault may be successful even if there is no default sensor -Fix QCOMPARE failure output (toString has changed in Qt6) -Remove qtimestamp alias which was deprecated already in Qt5 -Remove unit test hook that does not seem to be used anywhere -From typedef to ‘using’ for readability -Q_ENUMS -> Q_ENUM as the former has been obsoleted by the latter -Add qt6 changes qdoc page Task-number: QTBUG-88616 Change-Id: I92c168228ba76106b2c636c88f54331c76c3d2e6 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Android: rename the java package name in manifestsAssam Boudjelthia2021-02-122-4/+4
| | | | | | Task-number: QTBUG-86969 Change-Id: I11bad2d6945e27a859b68471816ef428d3834189 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* sensor_explorer: Fix warnings about deprecated QQmlListProperty APIv5.15.0-beta1Friedemann Kleint2020-02-132-2/+2
| | | | | | | | | | | Pass the list by pointer, fixing: sensors/sensor_explorer/import/explorer.cpp:120:64: warning: ‘QQmlListProperty<T>::QQmlListProperty(QObject*, QList<T*>&) [with T = QSensorItem]’ is deprecated sensors/sensor_explorer/import/sensoritem.cpp:328:62: warning: ‘QQmlListProperty<T>::QQmlListProperty(QObject*, QList<T*>&) [with T = QPropertyInfo]’ is deprecated: Use constructor taking QList pointer, and gain improved performance [-Wdeprecated-declarations] Change-Id: I0652e806354d3ba43c551e4a3733bafd73f0ddfe Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Update AndroidManifest.xml to be compatible with Qt 5.14Eskil Abrahamsen Blomfeldt2019-10-252-8/+4
| | | | | | | Necessary changes to be compatible with AAB changes in Qt 5.14. Change-Id: Ic574ac5d2401e9241eeb48061959c069a5c0e725 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* Enable shadow-building the sensor_explorer example on WindowsFriedemann Kleint2019-10-253-19/+74
| | | | | | | | | | | | When package-testing, a shadow-build of the example fails due to the import plugin not finding "main.moc", which is apparently caused by the directory structure and using DESTDIR = ./ Add header "main.h" to avoid having to deal with "main.moc". Change-Id: I04024c8d282b4f56d9942c0c8414d0b6ff9b1d20 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Remove usages of deprecated APIs from QDateTimeSona Kurazyan2019-06-271-2/+2
| | | | | | | | | | | | - Replaced QTime by QElapsedTimer, because of the usage of QTime::start() and QTime::elapsed() methods, which are deprecated. - Replaced the deprecated QDateTime::toTime_t() with QDateTime::toSecsSinceEpoch(). Task-number: QTBUG-76491 Change-Id: I625ce6bbc2718cd3c1b4905fecef9d75fdbab618 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Fix building maze example on AndroidAlex Blasche2019-04-261-1/+1
| | | | | | | | Qt 5.13 raised the minimal SDK version of Qt for Android to v21. Change-Id: I4c15254ef3aa2d5898c0ce7f5f6b8ffe62202fb9 Reviewed-by: Daniel Smith <Daniel.Smith@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Update accelbubble android SDK versionAlex Blasche2019-04-251-1/+1
| | | | | | | | | | | The example requires a specific AndroidManifest. Unfortunately the manifest hardcodes the SDK version too. Since Qt 5.13 increased the minimal SDK version to 21, building this example failed. Fixes: QTBUG-75379 Change-Id: Ieb5e26e759521fbb712bf24e5d336d8a22906b85 Reviewed-by: Daniel Smith <Daniel.Smith@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-09-011-7/+38
|\ | | | | | | Change-Id: I651a9760973757fb2d88bf2a5df8e75fd67dff69
| * Update AndroidManifest in accelbubble exampleEskil Abrahamsen Blomfeldt2018-08-301-7/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This example has an AndroidManifest.xml in order to force the orientation to portrait, but it had become outdated, setting the target version to android-14, which has not been supported since Qt 5.7. This updates the manifest to the latest template, while also still setting the orientation to portrait. [ChangeLog][Android][Examples] Updated AndroidManifest.xml in accelbubble example to be compatible with Qt again. Task-number: QTBUG-70159 Change-Id: I80a34c34837682c3ff2a7d232d527820fb9f4ca4 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* | Revert "Don't try to call Math.hypot() until V4 implements it"Edward Welbourne2018-08-221-2/+2
|/ | | | | | | | | This reverts commit dce96572f6e073cdf8eed916365c2cc81e9da4a4, thereby restoring use of Math.hypot(), now that V4 supports it. Change-Id: I27fed3fff8cf2863257a15e906e55ab907b70078 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Don't try to call Math.hypot() until V4 implements itEdward Welbourne2018-06-011-2/+2
| | | | | | | | | | We'll be adding that in dev (where I'll then revert this) but I was mistaken when I simply assumed V4 had it while updating this example before. Task-number: QTBUG-68277 Change-Id: Idb3b45317bfb410cea12c3795e82670db79c18b5 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Merge remote-tracking branch 'origin/5.10' into 5.11Liang Qi2018-02-121-0/+1
|\ | | | | | | Change-Id: I666569a09a42196d834e9aa97be706cc2551e7bf
| * qtlite: Skip building examples when configured with no-feature-itemviews5.10Rainer Keller2018-01-241-0/+1
| | | | | | | | | | | | Task-number: QTBUG-53141 Change-Id: I98086d0c1877b8345ee76553eea19738023aebae Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Add missing override and remove redundant virtualAlexander Volkov2017-11-148-17/+17
|/ | | | | Change-Id: I51c0fc424f44ae68c3c1c4cf6377e7701ee5a0dd Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Be consistent about values related to pi (radian / degree ratio)Edward Welbourne2017-07-062-5/+5
| | | | | | | | | | | | | | | Use JavaScript's Math.PI to compute 180 / pi (the number of degrees in one radian), rather than a hand-coded value for this constant. Store the result in a readonly property double to avoid repeating the computation. Tweak the pitch and roll calculations to use more apt Math methods: use hypot rather than sqrt of a sum of squares, and use atan2 instead of a tan of a ratio (whose denominator is always positive, so this doesn't change which angle we get). Task-number: QTBUG-58083 Change-Id: Ic3f865dfcbd9b02a0b93f065995d850386aef18c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Fix sensor explorer build on macOSEike Ziller2017-05-291-1/+3
| | | | | | | | | The QML module is looked for next to the application binary, which on macOS is within the application bundle. Task-number: QTBUG-56669 Change-Id: I18abfcaf383fb075fec4d3158db58e7ea68ee280 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Fix grue sensor example building on macOSEike Ziller2017-05-295-7/+19
| | | | | | Task-number: QTBUG-33875 Change-Id: Idd72b689aaae727df77daecb616d5c47b9bb809c Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Fix licensingJani Heikkinen2017-05-1057-173/+593
| | | | | | | | | | | | | | | | | - Remove unused old license files - Update BSD and FDL license headers - Unify licensing * Examples are nowdays licensed under BSD, update correct license header to there * Tools and tests are nowdays licensed under GPL-EXCEPT, update correct license header to those * Src is nowdays licensed under LGPL, update correct license header to there Task-number: QTBUG-57147 Change-Id: I5d9d7a3bc5e360f01ec73fb6a2a873f3173b5918 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Example: use atan2 for simpler angle calculationsEdward Welbourne2017-01-161-15/+1
| | | | | | | | | This replaces calls to sqrt, acos and asin (plus some arithmetic and fix-up) with a single call to atan2; it also avoids dividing by a potentially zero length. Change-Id: I694fa9e3e2bcdbcf1a4eb4c5d428e2c53ea21732 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix loading of QML pluginsv5.8.0-alpha1Simon Hausmann2016-08-262-2/+2
| | | | | | | | | | Since commit 709f6370884b110def2e4665df8fa7bbf5fae734 the plugin loader is strict about requiring the correct interface id, to avoid loading unrelated plugins in the loader thread (which they may not be prepared to do). Change-Id: I84e4d927489f9a14615db399b560af4b352bf045 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Merge remote-tracking branch 'gerrit/5.6' into 5.7Alex Blasche2016-05-1914-26/+31
|\ | | | | | | Change-Id: Ie2002a0be7fcb6bd9b81792a1e50b4ffb6c1acc3
| * fix example installsOswald Buddenhagen2016-05-1010-2/+21
| | | | | | | | | | | | Change-Id: Id7b94644f9db10bce3ef3539f4ff275f5f6f37b0 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
| * make plugin .json naming better follow the project structureOswald Buddenhagen2016-05-106-4/+4
| | | | | | | | | | | | | | | | it's more intuitive that way, and easier to deal with for the example source install magic. Change-Id: I547717463756c4b0bb86e401abfb5ddf7a605020 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * make use of COPIESOswald Buddenhagen2016-04-282-20/+6
| | | | | | | | | | Change-Id: I1df10894b0d0e4adba411db2dfc818f8bd39f6df Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-03-0710-0/+0
|\| | | | | | | | | | | | | Conflicts: src/sensors/doc/src/compatmap.qdoc Change-Id: I7bd464cbd506f630798091fef3896050ade7b3f8
| * Purge sRGB chunks from PNGs in documentation.Edward Welbourne2016-03-013-0/+0
| | | | | | | | | | | | | | | | Subjects each *.png file that matched grep -law "sRGB" to: pngcrush -ow -brute -rem allb -reduce -force Change-Id: Ie54ce7153b23632cf2673f6f82ae8b3e4dec6e67 Reviewed-by: Lorn Potter <lorn.potter@canonical.com>
| * Purge sRGB chunks from PNGs in examples.Edward Welbourne2016-03-017-0/+0
| | | | | | | | | | | | | | | | Subjects each *.png file that matched grep -law "sRGB" to: pngcrush -ow -brute -rem allb -reduce Change-Id: I4e15dcbf74334985f4a3e366443b2be7016e76a3 Reviewed-by: Lorn Potter <lorn.potter@canonical.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7v5.7.0-alpha1Liang Qi2016-02-191-9/+9
|\| | | | | | | | | | | | | | | Conflicts: .qmake.conf src/sensors/doc/src/compatmap.qdoc Change-Id: I4049bc3c335a8a9db5c935032207d0bcfba78480
| * Fixed qmlqtsensors exampleOliver Wolff2015-12-031-9/+9
| | | | | | | | | | | | | | | | | | | | There were API changes, that broke the current version. Both the tilt sensor's value and the ambient light sensor's enum value are now part of the reading's instead of the sensor's API. Change-Id: I774ecbcacdcce537358fdb0f3a6794a89572742d Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Updated license headersAntti Kokko2016-01-207-112/+231
|/ | | | | | | | | | From Qt 5.7 -> examples are lisenced under BSD license, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new BSD header instead of LGPL21 one (in those files which will be under BSD) Change-Id: Ife4aff1bffc18ca3094f6dd3c1c3d00e2898d237 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Purge spurious execute permissions from a graphic.Edward Welbourne2015-09-291-0/+0
| | | | | | Change-Id: I270fdd3681cbfedef6ccd05a7391b57821524b30 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* iOS: update Info.plist so that app runsv5.5.0-beta1Richard Moe Gustavsen2015-04-271-7/+6
| | | | | | | | | Some extra fields added, and some removed, so that the app runs on device. Also added iPhone6/6+ support. Change-Id: I7e2d0337a162a45f1ba37f16ad8ef902b61c7719 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-1757-265/+265
| | | | | | | | | 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: I141862df4ed2475c05ebbeb8fe447c4a6e736849 Reviewed-by: Antti Kokko <antti.kokko@theqtcompany.com>
* Remove unnecessary \inqmlmodule parameterAlejandro Exojo2014-12-081-2/+2
| | | | | Change-Id: I23232dcb9d13605f973144f64ffb93b0d9013c65 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* Remove cube exampleAlex Blasche2014-09-1814-665/+0
| | | | | | | | | | The example doesn't offer much example value. The accelerometer is presented by the accelbubble example too but doesn't have all the Qt3d dependencies. Cutting those dependencies is much cleaner. Task-number: QTBUG-31076 Change-Id: I074b24974cbd630d7b6ccc9eb21d8cabc96da86c Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Fix a couple of issues in the maze exampleAlex Blasche2014-09-184-10/+65
| | | | | | | | | | | | | | | | | | | 1.) Remove dependency on QtSystemInfo. The module is not officially supported at this stage and screen saver related code is not really required for the example. 2.) Add AndroidManifest.xml to lock the screen orientation in portrait mode. Since the example depends on the tilt sensor a rotating UI is messing the game up. 3.) Port app to current TiltSensor API. The game works but its biggest problem remains the UI. It uses fixed-size UI elements which makes it tiny on High DPI screens. Task-number: QTBUG-31076 Change-Id: I73df9361b5171da930df66072e8ee9eba89b71ad Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* Update license headers and add new licensesJani Heikkinen2014-08-247-133/+77
| | | | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I99c601a398559886c2900f3e04833acfceba8263 Reviewed-by: Antti Kokko <antti.kokko@digia.com> Reviewed-by: BogDan Vatra <bogdan@kde.org> Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
* Merge remote-tracking branch 'origin/release' into stableJani Heikkinen2014-04-233-0/+45
|\ | | | | | | Change-Id: I0a9d2e3cbcbe5adcbfc1dbcef3a9d3e7f52d4b90