aboutsummaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* | 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>
* | Add API to get more information for each line in a QML Text elementTimur Kristóf2019-11-041-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously there was no way to know what area is occupied by each line in a QML Text element. This commit adds new API to expose implicitWidth and isLast on QQuickTextLine for use in the lineLaidOut signal. It also adds improved documentation to the lineLaidOut signal and an example usage of the new API to the text layout example. An example use case of the new API is eg. to allow embedding timestamps and indicators within a text paragraph, to enable creating more efficient layouts. [ChangeLog][QtQuick][Text] Added new API that exposes implicitWidth, and isLast on the QQuickTextLine for use in the lineLaidOut signal. This allows the user to layout other items relative to the lines of text. Fixes: QTBUG-78277 Change-Id: Ibc754db17c78efb01468106aba32e30d70d2f4df Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | 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>