aboutsummaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-161-8/+8
|\ | | | | | | Change-Id: I6e69a235f50472b8f7ac19e133a3c071ea8c4d7a
| * Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-10-151-8/+8
| |\ | | | | | | | | | Change-Id: I7759f6b60f8fda6525b239c7ee2e034194d4ab85
| | * Doc: Add "Using" to other sections for consistencyNico Vertriest2019-10-111-7/+7
| | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-79061 Change-Id: I5d359d9a8ba48131a3aec5487604e30d3b0370ed Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| | * Doc: Rename section ObjectModel in Qt Quick Views exampleNico Vertriest2019-10-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - a section should not have the name of a QML type - caused links to ObjectModel to refer to the wrong page Task-number: QTBUG-79061 Change-Id: I92bbd00e02252d3eca2ad50deca7d573f53f549a Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | | Make twotextureproviders work on the rhi rendering pathLaszlo Agocs2019-10-1412-73/+274
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Involves porting away from the ill-fated QSGSimpleMaterial. This marks the first appearance of QSGMaterialRhiShader in any of the examples. Task-number: QTBUG-79086 Change-Id: I464e2bd06a6b5b19775b1b35265bb843979ec4b4 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-115-1/+9
|\| | | | | | | | | | | Change-Id: I1359574c7d89aaf3328958e2f667ba1e599ff7f1
| * | Merge "Merge remote-tracking branch 'origin/5.13' into 5.14"Liang Qi2019-10-101-1/+1
| |\ \
| | * | Merge remote-tracking branch 'origin/5.13' into 5.14Liang Qi2019-10-101-1/+1
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/scenegraph/openvg/qsgopenvgcontext.cpp tests/auto/quick/qquickpathview/tst_qquickpathview.cpp Change-Id: I117c8d62b21800329d1035021d312d9924f83a1b
| | | * Doc: Correct link error Package typeNico Vertriest2019-10-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-78803 Change-Id: Ideff1b3974dcb9ef833e5847e5a2df344105f241 Reviewed-by: Topi Reiniö <topi.reinio@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
| * | | Add guards in .pro of platform/api-specific scenegraph examplesLaszlo Agocs2019-10-104-0/+8
| |/ / | | | | | | | | | | | | | | | Task-number: QTBUG-78783 Change-Id: Icda60d4358c35de311552fd7562c3cf0c3425b7b Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-102-2/+5
|\| | | | | | | | | | | Change-Id: I2835748c27616103f275849141fbe5a93e3dfd8c
| * | Make rendernode example compile on iOSLaszlo Agocs2019-10-092-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without Metal support for now. The ifdef pattern is the same as in QRhi in qtbase. It is to be revised once Metal support is introduced for iOS. Task-number: QTBUG-78854 Change-Id: I10f37ddcb42c27958270bd3ca8bf9b8457a4bea3 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-0416-79/+115
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/qtquick2/plugins.qmltypes src/quick/items/qquickitemsmodule.cpp Change-Id: I841c65c9c131354788b4f3fcfe3d7ed27be316d5
| * | Examples: Avoid Qt.createQmlObject()Ulf Hermann2019-10-021-27/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We don't want to encourage Qt.createQmlObject(). It's the equivalent of eval() in JavaScript. This has the added benefit that the shapes actually react to changes in the parameters now. Before, once a shape was drawn, it didn't get updated when you manipulated the line width or fill controls. Change-Id: I8d5b7598799b52043f86fd1f617e31de09331891 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| * | Clean up GraphicsStateInfo after API reviewLaszlo Agocs2019-09-184-16/+16
| | | | | | | | | | | | | | | Change-Id: I715ad71153151a0e6521bc182227d9fa2dc0a3ea Reviewed-by: Christian Strømme <christian.stromme@qt.io>
| * | Rename textureinsgnode example to a more fitting nameLaszlo Agocs2019-09-129-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It shows QQuickFramebufferObject. "Texture in QSGNode" is ambiguous as it suggests another type of use case (where an existing texture is imported and used with the QQ scene - without rendering to it). This would conflict with upcoming future examples, so rename to fboitem, which is what this example is about. The link from examples.qdoc is already using the fitting title so that will just work. Change-Id: Ide7a563398a4b464c55f14e10fa9386432b3d06d Reviewed-by: Andy Nichols <andy.nichols@qt.io>
| * | Merge remote-tracking branch 'origin/5.13' into 5.14Liang Qi2019-09-122-25/+2
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4engine.cpp src/quick/handlers/qquicktaphandler.cpp src/quick/items/qquicktableview.cpp Done-With: Richard Moe Gustavsen <richard.gustavsen@qt.io> Done-With: Ulf Hermann <ulf.hermann@qt.io> Done-With: Shawn Rutledge <shawn.rutledge@qt.io> Change-Id: If9558a33f01693ce96420c094e0b57dfff0626cd
| | * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-08-281-23/+0
| | |\ | | | | | | | | | | | | Change-Id: I0ae0a162e133cffd8fb1a2c6b70826e50f06facd
| | | * Remove HACKING fileEskil Abrahamsen Blomfeldt2019-08-231-23/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This file ends up in release packages and contains some outdated documentation about where to put different types of examples, which should probably not be documented by random files in the source repository. Change-Id: If35ee6cd2b4084fc5763a0cab39b9ff3e44fa133 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | * | Doc: minor language issue in image elements documentationNico Vertriest2019-08-271-2/+2
| | |/ | | | | | | | | | | | | Change-Id: I5f3774ec4650dcc7eb316b4a15740e4a67504365 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
| * | Fix gcc warnings in vulkanunderqml exampleLaszlo Agocs2019-09-111-4/+4
| | | | | | | | | | | | | | | Change-Id: Iea81662f39d2a128cea0e83a766395e0fb1e9896 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* | | Specify parameters of type registration in class declarationsUlf Hermann2019-09-2674-85/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-09-1134-91/+1963
|\| | | | | | | | | | | Change-Id: Ic70e93d08aa91c00c9dec4e4557b871d3e8a2cae
| * | Clarify docs and comments regarding under and overlaysLaszlo Agocs2019-09-082-0/+10
| | | | | | | | | | | | | | | Change-Id: I8973798996b6c775f425819af1d6a09f1773a9dc Reviewed-by: Andy Nichols <andy.nichols@qt.io>
| * | Add metaltextureimport exampleLaszlo Agocs2019-09-0811-1/+878
| | | | | | | | | | | | | | | Change-Id: I499c21083faf6096a0dc3b8ee5682dd5cbcd3ce7 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
| * | rendernode example: Prevent gui-render thread data raceLaszlo Agocs2019-09-089-81/+114
| | | | | | | | | | | | | | | | | | | | | | | | By taking things like the item width and height in updatePaintNode() (while gui is locked). Change-Id: I840c6c858a0478eb6ceb09653fd1e033cb54372d Reviewed-by: Andy Nichols <andy.nichols@qt.io>
| * | Make vulkanunderqml work and update docsLaszlo Agocs2019-09-081-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | What we are doing for now is setting ExternalContentsInPass always. This way vulkanunderqml works as expected. For applications that do not integrate external rendering this means that there is now an additional secondary command buffer per render pass, but we can live with this for now. Later (Qt 6) there should be a way to declare this (that the application will want to issue native rendering stuff) up front in QQuickWindow or somewhere. Change-Id: I736741f9b0eee2f8295b046bacdce862e6a546f5 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
| * | Add vulkanunderqml exampleLaszlo Agocs2019-09-0814-9/+952
| | | | | | | | | | | | | | | Change-Id: I61e8b50f560d1f4c68731fb19eb13071992040c9 Reviewed-by: Andy Nichols <andy.nichols@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>
* | Move currentFrame and frameCount properties up to QQuickImageBaseShawn Rutledge2019-08-245-0/+170
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AnimatedImage already had these properties, but some typically non-animated image formats such as PDF, TIFF and ICO can also support multiple pages. In either case, the currentFrame property can be used to select a specific frame or page. However an AnimatedImage uses a QMovie to do that, whereas a plain Image uses QQuickPixmap. So the accessors need to be virtual in order to have these different implementations. [ChangeLog][QtQuick][Image] Image and BorderImage now have currentFrame and frameCount properties which can be used to step through the frames of multi-page image formats such as TIFF, WEBP and ICO. Task-number: QTBUG-77506 Change-Id: Id4d95a99a26a862957e44b1bd8ffe06d7eababef Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | rendernode example: Add support for MetalLaszlo Agocs2019-08-229-1/+513
| | | | | | | | | | | | | | | | | | | | | | | | Plus clarify QQuickWindow::begin/endExternalCommands() in combination with QSGRenderNode in the docs. As the example demonstrates, calling these functions is not necessary within render() of a render node. Also fix an issue with resetting the scissor in the renderer after calling render() of a QSGRenderNode. Change-Id: If8c2dab38d62aa444266d37901f062a51e767f68 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* | Add missing scenegraph example docsLaszlo Agocs2019-08-2212-1/+320
| | | | | | | | | | Change-Id: I72e18136a26cdfb52f204ce7d0491d14411956a4 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* | Implement QSGRenderNode for the rhi pathLaszlo Agocs2019-08-224-31/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The documentation is also refined and extended. Revise the rendernode example as well: make it possible to test and demonstrate both scissor and stencil based clipping. An implementation of the triangle for another graphics API should follow in a separate patch at a later point. For now only OpenGL is supported in combination with the RHI. Change-Id: I7ef9f6c6e0b44f1bdf44c9266ea3fa4736367a5d Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* | examples: Fix a few linter warningsUlf Hermann2019-08-203-7/+8
| | | | | | | | | | | | | | | | Unqualified lookup in the root object of a component is bad. Change-Id: I7772216fb81e68824519408998c73dbb1ca60c4d 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>
* | Fix docs to explain the new type syntax for QML methodsSimon Hausmann2019-07-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtQml] It is now possible to specify types for method parameters and their return value in QML (basic and object types), using TypeScript-like syntax with a colon separator. The syntax for QML declared signals supports the same style. This change also adapts the remaining snippets and docs to the "fresher" qml signal parameter syntax. Change-Id: I601781f01f696276951b04785584adab39fedfd9 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Make openglunderqml functional with and without the rhiLaszlo Agocs2019-07-043-29/+37
| | | | | | | | | | | | | | | | | | | | It has to be written following the new split approach (beforeRendering for resource setup, beforeRenderPassRecording to issue the actual underlay draw calls), but it will then work both with and without QSG_RHI=1. Change-Id: I9b7b35434aa0caec543cae268064b2684256382d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Add the graphics api independent scenegraph portLaszlo Agocs2019-07-0437-10/+1700
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Opt in via environment variables: QSG_RHI=1 -> enable using QRhi instead of GL QSG_RHI_BACKEND -> set to vulkan, metal, d3d11, gl to override the default (the default is d3d11 on Windows, metal on Mac, gl elsewhere) Or force a given rhi backend via the existing QQuickWindow::setSceneGraphBackend(). Otherwise the default behavior is the same as before, the rhi code path is never active by default. -no-opengl builds are supported in the sense that they work and default to the software backend. However, the rhi code path cannot currently be used in such builds, even though QRhi from qtbase is fully functional with Vulkan, D3D, or Metal even when qtbase was configured with -no-opengl. This cannot be utilized by Quick atm due to OpenGL usage being all over the place in the sources corresponding to the default backend, and those host the rhi code path as well. This will be cleaned up hopefully in Qt 6, with the removal all direct OpenGL usage. Other env.vars.: QSG_RHI_DEBUG_LAYER=1 -> enable D3D debug or Vulkan validation layer (assuming the system is set up for this) QSG_RHI_SHADEREFFECT_DEBUG=1 -> print stuff from ShaderEffect QSG_SAMPLES=1,2,4,... -> MSAA sample count (but QSurfaceFormat works too) QT_D3D_ADAPTER_INDEX=0,1,... -> D3D adapter index QT_VK_PHYSICAL_DEVICE_INDEX=0,1,... -> Vulkan physical device index QSG_RHI_UINT32_INDEX=1 -> always use uint index data (both merged/unmerged, convert when needed - with some rhi backends this is implicit) QSG_RENDER_LOOP -> to override the render loop as usual. The default with RHI is threaded for Metal, threaded for Vulkan on Windows, basic for Vulkan on Linux and Android (to be checked later), while the existing rules apply for OpenGL. Not supported when running with QRhi: - particles - compressed atlases (though this is transparent to the apps) - QSGRenderNode - QQuickRenderControl - QQuickFramebufferObject - certain QQuickWindow functionality that depends directly on OpenGL - anisotropic filtering for textures - native text may lack some gamma correction - QSGEngine applicability unclear - some QML profiler logs may be incorrect or irrelevant Change-Id: I7822e99ad79e342e4166275da6e9e66498d76521 Reviewed-by: Lars Knoll <lars.knoll@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>
* | Discourage having AsyncImageResponse inherit from QRunnableFabian Kosmale2019-06-251-26/+45
| | | | | | | | | | | | | | | | | | | | | | | | As the AsyncImageResponse is owned by the qml engine, it should ideally live in the same thread. Else, when we call destroyLater() on it in the qml engine, we can run into various race coditions. see also commit c8827b444c23656f67feee2e3ebd4f2868ab3db7 Change-Id: I6e21ca4527281445e5f6df082f60b60838bb2eac Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Register QRegularExpressionValidator in QtQuickUlf Hermann2019-06-121-5/+5
|/ | | | | | | | This should replace QRegExpValidator. RegExpValidator is deprecated now. Task-nunber: QTBUG-72588 Change-Id: I072deb382914fd322ce192509782b241824ccd7b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* doc: Clarify that DelegateModel is a kind of proxy modelShawn Rutledge2019-02-261-2/+3
| | | | | | | | | | | | | | | | | It was not quite clear in the GridView DnD example that the ListModel doesn't get reordered, so if new ListElements are inserted after reordering the DelegateModel by DnD, predicting the position where new delegates will appear becomes a bit of a riddle. Also: - the QQmlDelegateModelAttached::model is a model, not an int - disambiguate the properties that have the same names in QQmlDelegateModel and QQmlDelegateModelAttached, using \keyword for linking. Task-number: QTBUG-34891 Change-Id: I485fd632f67d607652428b4e3c9ca528e57f7348 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Remove old 'Getting started with Qt Quick' exampleKai Koehne2018-10-1522-1785/+0
| | | | | | | | | | | The example is actually not very easy to build, and arguably too complex for a 'getting started' example. qtdoc commit 1df7011858 therefore replaced it by the alarms example in the documentation. Task-number: QTBUG-66064 Change-Id: I2f2776c649410575aef71948f64b358d60233022 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
* Examples: Use XmlHttpRequest to fetch flickr public photosVenugopal Shivashankar2018-10-1111-85/+186
| | | | | | | | | | | | | | | | | | This change is to facilite moving the XmlListModel code to the qtxmlpatterns repo, but still keep all the Particles examples together. Also fixed: - the old TODO about darkening images according to depth, and make it generally look a bit better. - move the visualdatamodel examples to a directory called delegatemodel, since that's how they work now. And add them to the main "views" example launcher so that they become more visible to users. Change-Id: I78f9f19e1e110608580adedcf4cd3be554222515 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Replace more vestiges of VisualDataModel, *Group and VisualItemModelShawn Rutledge2018-10-032-2/+2
| | | | | | | | | | | | VisualDataModel, VisualDataGroup, and VisualItemModel are replaced with DelegateModel, DelegateModelGroup, and ObjectModel respectively (since 7cad0e52c5a020bd29635e9912fd8946a6b48124), so shouldn't be mentioned anymore, in preparation for removal. Task-number: QTBUG-37725 Change-Id: I9a01ec8db748f817efca638383b7a278c7b562cd Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>