aboutsummaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* Fix TypeError in dynamicview1 exampleSami Varanka2022-10-181-1/+5
| | | | | | | | | | Rectangle's parent was null when setting left and right anchors. Check for parent null before binding. Fixes: QTBUG-106645 Change-Id: I79c1375d12d0cc901c931890beeff4fc0d701b79 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix rendernode example wrt stackingLaszlo Agocs2022-06-161-1/+5
| | | | | | | | | | | | | | | | | | | | ...for OpenGL. This means that putting opaque content on top (which uses the opaque pass of the sg renderer) is now working as it should. Previously the custom rendering was not testing against the what was in the depth buffer, which was fine for geometry drawn in the alpha pass, but not for others. The associated bug report's example with adding a Button on top presumably triggers the latter. The software backend has no problems. The D3D12 and Metal code paths are no longer supported and will not be updated anymore. Those anyway feature various limitations, such as a lack of clipping support, so having limited stacking, depending on the content on top, is acceptable. Fixes: QTBUG-102954 Change-Id: I0ee97fb9790ee43f005b1de8226ef760c56c2573 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Fix indentation in positioners exampleIvan Tkachenko2022-02-041-14/+14
| | | | | | | Change-Id: I5a39ba9361503cd5d7ce2e6da59d7807d540bee5 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit e4308747d3a27a5b942c5b79fcbb77f7b327ae67) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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>
* Screen example: avoid shadowing final props with required context propsShawn Rutledge2020-09-081-3/+2
| | | | | | | | | | | Amends 90b4528b846542bfa6f0723487315140b9de17b4 to fix the error qrc:/window/AllScreens.qml:75 Cannot override FINAL property Fixes: QTBUG-85724 Change-Id: Ie6528f6c9ccc6648ec76b4d237973588450cc932 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 99215e04e32c2138282abde3f2dc329d2f073d53) Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Capitalize "GUI" correctlySze Howe Koh2020-08-311-1/+1
| | | | | | | Change-Id: I2230e2dcb7bc2497b5dbe71a22c21d84176b5e57 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> (cherry picked from commit fd105380eb4f43c08578b6fe5ce3e5c6dd4b35d6) Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* 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>
* Replace Qt's MidButton with MiddleButtonEdward Welbourne2020-07-221-1/+1
| | | | | | | | | | | 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. Change-Id: I2c5088d597dd7327cc5899d06afb180d0ec2893e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 3debb37250b2c57aaaf81940f9dfeb540fd4e380) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* simplematerial example: Fix double installation of main.qmlAlexander Volkov2020-06-231-4/+1
| | | | | | | | | | | qt_example_installs.prf already generates install rules for all example sources, including content of .qrc files. This commit amends bbb6071dc69a2513d2586faaf9896841bf724786. Task-number: QTBUG-84301 Change-Id: Idfef30501dfaaaddebf773aaa690206eedb458fc Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* 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>
* Resume AnimatedSprite playback when visibility changesLaszlo Agocs2020-05-191-6/+18
| | | | | | | | | | | | | | | | | | | | | | 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 Change-Id: Ieb6d046168a2132659848a36ee0b694c580159b1 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit af521a8df6caec41f626a4b3319601c20adff711) Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add missing include to d3d11underqml exampleLaszlo Agocs2020-04-071-0/+1
| | | | | | Change-Id: Ib1891a509dccdbe071ce71058aaa58887ddfeb8e Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add missing QPainterPath include in rendernode exampleUlf Hermann2020-03-101-0/+1
| | | | | | Change-Id: Idd8a0fb1f02ea6f226ffe4a6cee77f49aa947a84 Fixes: QTBUG-82791 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* 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-0446-0/+1050
| | | | | | | | | 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>
* Examples: enable HighDPI scaling for AndroidAssam Boudjelthia2020-02-242-0/+2
| | | | | | | | | 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>
* 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-184-4/+4
| | | | | | | | | | | | 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>
* Modernize type registration in new examplesUlf Hermann2020-02-119-12/+12
| | | | | Change-Id: I26671d47d663c126e2bff41e8db7b0945db78643 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Avoid discouraged patterns in examplesUlf Hermann2020-02-1178-421/+634
| | | | | | | | | | | 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>
* Avoid access to properties of parent in imagelements exampleUlf Hermann2020-02-062-8/+28
| | | | | | | | | 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>
* Use inline components for sharing exampleUlf Hermann2020-02-061-44/+38
| | | | | Change-Id: I9390982bfefa35e6db6c8516c62ba091c231be8a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix vertical position of PathTextEskil Abrahamsen Blomfeldt2020-01-291-1/+1
| | | | | | | | | | | | | | 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>
* Introduce PathText path elementEskil Abrahamsen Blomfeldt2020-01-214-1/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Upgrade qsb files to version 4Laszlo Agocs2020-01-216-0/+0
| | | | | Change-Id: Ic1a1f5ff49c34d72495bc74083f37db118c935c1 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@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-1394-443/+658
| | | | | | | | 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>
* Make draganddrop example less confusingUlf Hermann2020-01-103-44/+109
| | | | | | | | | | | | 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>
* Minimal documentation for new examplePaul Olav Tvete2019-12-122-0/+48
| | | | | | Task-number: QTBUG-80500 Change-Id: Ifdd13bc404dd3ee34d14b339e24a72d647b6796f Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add vulkantextureimport examplePaul Olav Tvete2019-12-129-1/+1126
| | | | | | | | | | 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>
* examples/quick/shared/FlickrRssModel.qml: Do proper error handlingMaximilian Goldstein2019-11-291-0/+6
| | | | | Change-Id: Ieaed0706965bbb259934fb83151856f3d5805331 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* examples/touchinteraction/multipointtouch: Fix broken score displayMaximilian Goldstein2019-11-292-8/+13
| | | | | | | Fixes the broken score display in "Bearwhack". Change-Id: I43581947f71e4c6dd3cca43068f6d220a058cc46 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* examples/quick/views/pathview: utilize required propertiesMaximilian Goldstein2019-11-291-3/+7
| | | | | Change-Id: I07c5068de9330236b2e593d9995fdfda3e019006 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* examples/quick/localstorage: Fix some linter warningsMaximilian Goldstein2019-11-282-7/+7
| | | | | | | | 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>
* examples/quick/animation/layouts: Avoid unqualified accessMaximilian Goldstein2019-11-281-3/+10
| | | | | Change-Id: I75f67b54d75840c215c2dfe592ff95c5cb962ff2 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* examples/quick/animation/easing: Fix some linter warningsMaximilian Goldstein2019-11-281-4/+25
| | | | | | | | Now explicitly importing QtQml and QtQml.Models. The example also utilizes required properties now. Change-Id: I819b03c0a0dc892683e680fee47a632f1e5b543a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix Metal usage on iOSLaszlo Agocs2019-11-274-6/+11
| | | | | | | | Also enable the two Metal-specific scenegraph examples on iOS. Change-Id: I0e1e6d527544ea4a5bfb0d08ca2d32c762d3c699 Reviewed-by: Andy Nichols <andy.nichols@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Avoid initializing QFlags with 0 or nullptr in further casesFriedemann Kleint2019-11-251-1/+1
| | | | | | | Amends 744e77b841878fb017c0f2d60607090008f28180. Change-Id: I16e37aaf503eb62f67fca0e48be4c92c4a72ae46 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Merge remote-tracking branch 'origin/5.14' into 5.15Liang Qi2019-11-222-1/+5
|\ | | | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlextensionplugin.cpp tests/auto/quick/qquicktableview/tst_qquicktableview.cpp Change-Id: Ic58d36a8532015bae30f2690063db9829b3bf372
| * fix rendernode example buildLorn Potter2019-11-121-0/+4
| | | | | | | | | | | | | | | | | | | | When not building developer mode, the install does not copy the files on other platforms Fixes: QTBUG-79781 Change-Id: Ibc8352c59d16b69618d53750511d5b5650ed5290 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| * Doc: Fix documentation warningsTopi Reinio2019-11-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were a lot of documentation warnings introduced by the separation of QtQml.Models and QtQml.WorkerScript modules from the QtQml documentation project into their own sub-projects. Fix the above, and also ensure that the experimental Qt.labs.qmlmodels QML types are listed in the documentation, and add them also on the QML module page for QtQml.Models. A few warnings remain, they may be indicative of issues not in the scope of this commit. Fixes: QTBUG-79812 Change-Id: Idc25c976e4c96feab4aae893519d6c9245f57a64 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | examples: Drop bogus referenceUlf Hermann2019-11-181-1/+0
| | | | | | | | | | | | | | Canvas doesn't have an "alpha" property. Change-Id: I7cedff568ec062d7586b6b7333e32a8e52d2e8a9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | examples: Add type safety to animation/behaviors exampleUlf Hermann2019-11-155-42/+126
| | | | | | | | | | | | | | | | | | As SideRect wants to access focusItem's "text" property, we should expose the fact that it exists. Therefore, move focusRect into a separate file that declares the property and reference that. Change-Id: Id9b1d1e7868ee5abb9de124bab8fad45ee1449a9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Remove binding to nirvana in accessibility exampleUlf Hermann2019-11-151-1/+0
| | | | | | | | | | | | | | | | parent.description doesn't exist, and the text is always overwritten via the alias anyway. Change-Id: If80c4b9b1afaaa488b8ac5c6917b413a462476ef Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | examples: Fix SimpleLauncherDelegate.qmlUlf Hermann2019-11-151-2/+2
| | | | | | | | | | | | | | | | | | Since the button is a simple Item, and the MouseArea is gone, the "pressed" property we're interested in is actually the TapHandler's "pressed". Change-Id: Idc7262325c9e2db761041b1ae1151e62702e3eb8 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Make QQuickFbo work with the OpenGL backend of QRhiLaszlo Agocs2019-11-145-14/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So no matter if Quick goes directly to OpenGL, or via QRhi, QQuickFramebufferObject will still work. Also fix up the fboitem example to use a ShaderEffect that works with both rendering paths. With graphics APIs other than OpenGL the item will be empty, as QQuickFbo is not something we can support there. Task-number: QTBUG-79222 Change-Id: I52177d3a75f619f7075a2fc829573c17031eded1 Reviewed-by: Andy Nichols <andy.nichols@qt.io>