aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/doc/snippets
Commit message (Collapse)AuthorAgeFilesLines
* Flickable: add positionViewAtChild, flickToChild, flickTo(position)Xavier BESSON5 days2-0/+64
| | | | | | Fixes: QTBUG-141747 Change-Id: Icc194fb35da84f580b3bdfcb64944f5834b766dc Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Doc: Fix qml lint binding warningsAndreas Eliasson2025-10-291-5/+5
| | | | | | | | | These snippets show up in the Qt Quick States documentation. Fixes: QTBUG-140487 Pick-to: 6.10 Change-Id: I897865e16a356c1c561715adc4daa97a4bd3dd67 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* IntValidator docs: Provide guidance on intermediate resultsFabian Kosmale2025-10-101-2/+1
| | | | | | | | | | | | | | | | | | | | | Validators in QML do not actually expose the three states (Valid, Invalid, Intermediate) directly, but only support their usage through TextField. This makes it slightly tricky to raise awareness about intermediate results. Nevertheless, we can expand the example to avoid confusion how IntValidator restricts input, and to encourage users to create a visual indicator based on acceptableInput. The color can also be a binding in the snippet. Amends 17a777a5dfa72e47d02c3e6b4c3a137d923d50bc Pick-to: 6.10 6.8 Fixes: QTBUG-85490 Change-Id: Ia3f7d21d6d7c13943cc2469c4ab8f3c00fd2eada Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Replace nokia.com logo URLs with something that works for nowShawn Rutledge2025-09-262-2/+2
| | | | | | | | | If only the qt.io website could be relied upon to have a Qt logo in the same path for eternity... Pick-to: 6.8 6.10 Change-Id: Ie221bd85152af42bdf36655083932ca8341c7d2a Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Create a Getting Started section for the Qt Quick moduleAlexei Cazacov2025-08-0129-0/+1026
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit moves the "Building UIs with Qt Quick" tree section to the Qt Quick module as a getting started subtree. Changes: qtquick-debugging.html - moved to concepts/Debugging qtquick-deployment.html - moved to concepts/Deployment qtquick-performance.html - moved to concepts/Performance qml-codingconventions.html - moved to guidelines/Coding Conventions scalability.html - moved to guidelines/Scalability qtquick-qml-runtime.html - moved to the qml module "Use Case" topics moved to Getting Started: Visual Elements In QML -> Visual types Positioners and Layouts In QML -> Positioners and layouts Responding To User Input in QML -> Handling user input Displaying Text In QML -> Displaying text Animations In QML -> Animations Style And Theme Support -> was deleted (it had almost zero useful info) Integrating JavaScript in QML -> Integrating JavaScript in QML Task-number: QTBUG-134130 Pick-to: 6.10 6.9 Change-Id: I14c8e4abadc587fbba788b7ce479c3a8364d0a42 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Support Flexbox layout in Qt QuickSanthosh Kumar2025-05-281-0/+47
| | | | | | | | | | | | | | | | The Flexbox component allows the arrangement of the items within the layout in a more flexible way. There is a CSS standard defined for the flexbox layout https://www.w3.org/TR/CSS3-flexbox/. This can be achieved in qt-quick using the yoga library (https://github.com/facebook/yoga.git). [ChangeLog][Third-Party Code] Added MIT LICENSE from the third-party Facebook yoga source (https://github.com/facebook/yoga/blob/main/LICENSE) to enable its usage in Qt QuickLayouts. Task-number: QTBUG-133633 Change-Id: I2187dba031cb4842baef1c5a84c7132eb8c63137 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* doc: Make transform snippets runnableShawn Rutledge2025-04-022-5/+18
| | | | | | | | | | | | | It's not clear at this point where qt.png was supposed to come from, but the modern Qt logo seems to work well enough. In the case of Item with two transforms, perhaps this was not tested before; that's the trouble with inline qml code. It's a little easier to visualize the effect with an Image of which you can see more than one edge (although parts of it remain hidden now too). Pick-to: 6.9 6.8 Change-Id: I64c685d4dc9568080b0ddb4921d987b07eb17c41 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Modernize some model/view/delegate snippetsUlf Hermann2025-03-133-13/+38
| | | | | | | | | Use required properties where possible and unclutter the formatting. Pick-to: 6.9 6.8 Change-Id: Ib170676892e4eed514fa025d0dc1fd9562ab1a08 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* PathRectangle: add bevel propertiesMitch Curtis2025-03-042-0/+70
| | | | | | | | | | | These are needed for the RectangleShape from QtQuick.Shapes.DesignHelpers. [ChangeLog][Shapes] Added bevel properties. Task-number: QDS-13283 Change-Id: I904d6bd9b02bc0fccd271cba5e764040f20de995 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Doc: Add example to QML IntValidator and DoubleValidatorDheerendra Purohit2025-02-242-0/+34
| | | | | | | | | | Add code snippet for IntValidator and Doublevalidator in Doc. Update with suggested improvements. Fixes: QTBUG-16051 Pick-to: 6.8 6.9 Change-Id: Ia34afb23338ca78a9b853b049f9959f2700b8334 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Make SafeArea.additionalMargins actually add to the margins, not unionTor Arne Vestbø2025-01-181-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The semantics of SafeArea.additionalMargins was initially to union the additional margins with the inherited margins, as this fit nicely with the case of adding margins for a header that lives in the non-safe area of the window. But for the case of a header that lives within the existing safe area, but wants to add additional margins for its container's children, the API was awkward, requiring the user to include the inherited margins explicitly. The name additionalMargins was also not correct given these semantics. We now follow the semantics of addition, which makes the use-case of a header that lives in the non-safe area a bit more explicit, but also clearer on exactly how much additional margins is added. The new semantics also match how AppKit/UIKit handles additional safe area insets, so the behavior should be familiar to anyone coming from those platforms. Pick-to: 6.9 Change-Id: I05e42e68da4237c0c7963457452ffea034ea3ae1 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* TreeViewDelegate: hasChildren should be bool, not intRichard Moe Gustavsen2025-01-091-1/+1
| | | | | | | | | The documentation and the manual test declares 'hasChildren' as 'int'. It should be 'bool'. Pick-to: 6.9 6.8 Change-Id: Ied8c66f3758e759b5803cf0e08135555644747b8 Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
* Doc: Add WheelHandler code snippets; override properties and signalsShawn Rutledge2024-12-042-0/+35
| | | | | | | | | | | | | Some of the docs are inherited from parent classes (such as QQuickPointerDeviceHandler). Override the property docs that have TapHandler snippets, and replace with WheelHandler snippets. Hide properties and signals that are not relevant for WheelHandler. Done-with: Andreas Eliasson <andreas.eliasson@qt.io> Pick-to: 6.5 6.8 Fixes: QTBUG-130266 Change-Id: I30423cd9c0c0810691a2a36171e65de0b44e0dc9 Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
* Doc: add "Hiding Delegates" section to ListView's docsMitch Curtis2024-11-281-0/+27
| | | | | | | | This comes up often online, so let's document the official advice. Pick-to: 6.5 6.8 Change-Id: I926326bc3b033d38746a508e5c448b5b055effeb Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Doc: add "Avoid Storing State in Delegates" section to ListView's docsMitch Curtis2024-11-282-0/+46
| | | | | | | | | | | This is mentioned in a couple of places, so add a dedicated section and link to it. Also add a section to the Qt Quick best practices page. Pick-to: 6.5 6.8 Change-Id: I0ba528e6c37b0c9c82ca1847817251f176b7f978 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add SafeArea attached propertyTor Arne Vestbø2024-11-283-0/+106
| | | | | | | | | | | | | | | | | | | | | | | | The SafeArea attached type provides information about the areas of an Item or Window where content may risk being overlapped by other UI elements, such as system title bars or status bars. This information can be used to lay out children of an item within the safe area of the item, while still allowing a background color or effect to span the entire item. The attached type also provides a writable property to add additional margins, which are reflected through the item's and any children's safe area margins. This is useful for informing child items about elements such as headers or footers, that may overlap the other child items. Task-number: QTBUG-125373 Change-Id: Id83e384f31f9770367c98e6455ec44e1086beb8a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Modify the Listview snippet to fix Unqualified access warningsMate Barany2024-11-181-2/+7
| | | | | | | | | | | | | | | | Probably has not been updated for a while now, copy pasting and running the example leads to unqualified access warnings. https://doc.qt.io/qt-6/qtquick-modelviewsdata-modelview.html "In most cases you should use required properties to pass model data into your delegates." Fix the snippet by using required properties. Pick-to: 6.8 6.5 Change-Id: I4a46f1ff29712238dd22bf4455a6674d8bdc0f49 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
* Modify snippet so the screenshot looks accurateMate Barany2024-11-081-1/+1
| | | | | | | | | | | | When using the example code in listview-decorations.qml the result does not look like as the attached screenshot: the gray highlight does not extend until the end of the line, it stops at the end of the name. Modify the snippet to match the screenshot. Change-Id: Ib1b810381427fc37052c70082a8b1bba1d2fb4a6 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Doc: Remove QML versioning from TableView code snippetsKai Köhne2024-08-212-2/+1
| | | | | | | | | | The versioning is irrelevant for the snippet purpose - see https://doc.qt.io/qt-6/qml-qtquick-tableview.html#example-usage Pick-to: 6.8 Change-Id: I5b6abb3334d66453689b10651ed0ddffaf9ab697 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Doc: Update Rectangle gradient code example; improve runnabilityAndreas Eliasson2024-07-041-13/+21
| | | | | | | | | | | | | | | | There was an example using rotation to create a horizontal gradient. Add a Rectangle that uses the Gradient orientation property (new in Qt 5.12). Also use Grid, to avoid setting explicit coordinates and avoid overlapping. Use two different gradient presets. Amends 1771d298f33543a3fe47decfe0fff10609b01ab1 Fixes: QTBUG-126432 Pick-to: 6.8 6.7 Change-Id: Iddb73a2b589395e4b4240a66ea7013709336f1e4 Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Doc: Override DragHandler.accepted* and marginShawn Rutledge2024-06-202-0/+148
| | | | | | | | | | | | | | | | | DragHandler docs have been showing TapHandler code snippets, because both DragHandler and TapHandler inherit properties from PointerDeviceHandler, which is abstract and uses TapHandler code snippets in some of its property documentation. Override documentation for acceptedDevices, acceptedModifiers, acceptedPointerTypes and margin by adding to the DragHandler class, and add testable snippets for a couple of them. draggableGridView is adapted from examples/quick/draganddrop/views/gridview.qml. Fixes: QTBUG-119866 Pick-to: 6.8 6.7 6.5 6.2 Change-Id: I9f98d831ec1691c84da6a38a7625f9aba086cebf Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
* Docs: Clarify the snippet about Editing Cells in a TableViewAlexei Cazacov2024-06-171-1/+1
| | | | | | | | | | This commit corrects the code snippet provided for editing cells in TableView. Fixes: QTBUG-125157 Pick-to: 6.8 6.7 6.5 Change-Id: I639926d7a1b4316dad84f8fbff35e9088e19fa95 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Doc: Add snippet for DragHandler.acceptedButtonsShawn Rutledge2024-06-131-0/+81
| | | | | | | | | | | | | | | DragHandler docs have been showing TapHandler code snippets, because both DragHandler and TapHandler inherit properties from PointerDeviceHandler, which is abstract and uses TapHandler code snippets in some of its property documentation. Override the acceptedButtons property documentation by adding it to the DragHandler class, and add a testable snippet. Task-number: QTBUG-119866 Pick-to: 6.8 6.7 6.5 6.2 Change-Id: Ic2c8ee98c33929fd90c8ec11509d510647c4a074 Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
* Doc: fix snippet markers in pinchHandler snippetVolker Hilsheimer2024-06-111-2/+3
| | | | | | | | | | | | | Rename the snippet file so that qdoc doesn't look into the example file with the same name (and where there is no snippet to quote). Also add space between //! and [tag], and an empty line after the SPDX header. Pick-to: 6.8 Change-Id: I013df640c2fea6c25fd459c8a3a46312d14a93de Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: MohammadHossein Qanbari <mohammad.qanbari@qt.io> Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
* Improve QQuickRhiItem introduction docsLaszlo Agocs2024-06-112-0/+25
| | | | | | | Pick-to: 6.8 6.7 Fixes: QTBUG-125720 Change-Id: I18b1bfa7da4e9ea3d6fbf1bfde8c0801fa6ef292 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Improve font documentationMitch Curtis2024-05-231-0/+22
| | | | | | | | | | | - Move snippets into a file so they are tested by tst_quick_examples. - Add snippet that shows how to construct a standalone font, which is useful for sharing fonts among Components, for example. Pick-to: 6.5 6.7 Change-Id: I87ef72c601060b6874d727aa4800f254c62f3eaf Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Doc: explain that Window doesn't apply palette.window automaticallyMitch Curtis2024-05-201-0/+2
| | | | | | | Fixes: QTBUG-124357 Pick-to: 6.5 6.7 Change-Id: Id899833d750fab69c0ca7c2a7a01d9e1f109e0e5 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Correct doc snippet licenseLucie Gérard2024-03-2215-15/+15
| | | | | | | | | | | | | | All file under doc/snippet should be license as Documentation snippets and according to QUIP-18 [1] thi is LicenseRef-Qt-Commercial OR BSD-3-Clause [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 6.7.0 Task-number: QTBUG-121787 Change-Id: Iee9bc9b8c2a81695c5825a36768b36db2726bd35 Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Add TextDocument.errorString propertyShawn Rutledge2024-02-271-5/+2
| | | | | | | | | | | | | | In bec8df96b7615c6ce419867254027773ea7fd6b1 we added status and removed the translated error string. But actually it's a common pattern to have the error string available too, so as to avoid needing to generate it from an enum value. Also, in the textEditStatusSwitch.qml snippet, setting textFormat is necessary after fdbacf2d5c0a04925bcb3aecd7bf47da5fb69227 Pick-to: 6.7 Change-Id: Ie880efa4bf347b70eb6cc4005283b1fc50e15508 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add imageSourceSize property to QQuickDragWang Zichong2024-02-242-0/+54
| | | | | | | | | | | | | | | | | | | | | | Currently we can only assign an image URL to QQuickDrag to represent the data during the drag and drop operation. We made it easier to load arbitrary images in ac78bf7074c4aa2414b4da38db5b574bec9e4b71 : it does not have to come from Item.grabToImage(). But the image size depended only on the image provider's default behavior. Now we give developers the ability to set a preferred image size when needed. The revision of this new property and its signal is omitted because of QTBUG-33179. [ChangeLog][Qt Quick][Drag] The attaching type Drag has a new imageSourceSize property, which can be used like Image.sourceSize to scale the drag image during loading. Fixes: QTBUG-122705 Task-number: QTBUG-120489 Task-number: QTBUG-33179 Change-Id: I92996b8f70b7ca1c9ab783d7ed9f21649d512ab9 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Accept mouse or touchpad in snippets with acceptedDevicesShawn Rutledge2024-02-211-1/+1
| | | | | | | | | | | | | | | This is a workaround for platforms (such as Wayland and macOS) that are sometimes failing to distinguish mouse and touchpad. It's better for illustrative purposes anyway, since a laptop user may really be using a touchpad rather than a mouse, and we hope to eventually distinguish them on as many platforms as possible. Task-number: QTBUG-63363 Task-number: QTBUG-112432 Pick-to: 6.5 6.6 6.7 Change-Id: Ic7a374f1257d4aa57f29385b44da85ccaf4f5ec6 Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io>
* Replace TextEdit.textDocument.error signal with status propertyShawn Rutledge2024-01-233-0/+180
| | | | | | | | | | | | | | | If we make loading and saving asynchronous later, we'll need the same sort of status property as in Image, Loader etc. to let the user QML know when it's done, or when it has failed. Bindings are more flexible than signal handlers; so we might as well have better-prepared API now. To make use of the Status enum in QML, we need to de-anonymize TextDocument and make it merely uncreatable. Anyway, it was already referred to as the TextDocument type in the docs. Pick-to: 6.7 Change-Id: Ia4354feba77995759797030382891308b941f0af Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* Remove qml locale and dynamicscene examplesLucie Gérard2023-11-281-0/+13
| | | | | | | | | locale example has no documentation dynamicscene example does not promote good behavior Task-number: QTBUG-119117 Change-Id: I782375e2ac50b73535d51a031711222efc15b3ad Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* TreeView: document how to implement expanding indicatorsRichard Moe Gustavsen2023-11-271-18/+51
| | | | | | | | | | | | | | | | | | | | Being able to rotate the expanded/collapsed indicator in a TreeView is assumed to be a normal request. But it's not very intuitive to implement, since TreeView will do a relayout when you expand or collapse a node, which will cause existing delegates to be reused. If a delegate has an ongoing animations at this point, it will look weird. In order to solve that, you need to use the TableView.onPooled/onReused signals, which is not intuitive. Until (and if) we have have a more explicit API to support this, at least show in the documented example how it can be done. Pick-to: 6.6 6.5 Change-Id: Ibf08fd8518d74ba12a4a6f7db71f3f56a8970fac Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* doc: Set Drag.imageSource before Drag.active to avoid race conditionShawn Rutledge2023-11-211-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | grabToImage() is asynchronous. 4b982c744f538a24e21a2af146c45f93d27dd1cb started it on mouse press, which generally gave it enough time before the QDrag became active; but 5971a6faaa1124f5ef3f0b42d4ed0298cf8096a3 changed it to call grabToImage() in DragHandler.onActiveChanged, which means waiting until the drag threshold is exceeded. (DragHandler doesn't offer a way to detect when the point is pressed. One could probably use a separate TapHandler or PointHandler just to detect the press; but that's also inefficient and inconvenient.) If we also bind Drag.active to DragHandler.active, it's very likely that the binding is updated before grabToImage() is done; and as documented, setting imageSource after the drag has started has no effect (that in turn is a limitation in QDrag and the platform support, probably a limitation on actual platforms). So just wait until the screen-grab is done before setting Drag.active, as a workaround for now. This is a step back in declarativeness, using JS rather than a binding. But setting imageSource to a screen-grab unfortunately requires JS anyway; so we might as well delay making the Drag active until the screen-grab is done. Fixes: QTBUG-112673 Fixes: QTBUG-115491 Pick-to: 6.2 6.5 6.6 Change-Id: I0317613aa0288ad99b55ebd8a470500432b2ea02 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QtQml: Document QML_ADDED_IN_VERSION and QML_REMOVED_IN_VERSIONUlf Hermann2023-10-161-1/+1
| | | | | | | | | | | | In turn, deprecate QML_ADDED_IN_MINOR_VERSION and QML_REMOVED_IN_MINOR_VERSION. These are dangerous because you don't quite know what major version they refer to. Pick-to: 6.6 6.5 Fixes: QTBUG-116895 Change-Id: I9d6d169430944e1dfa4e78bda74c8b71f739e331 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* doc: Move qmllint and qmlls docs out of qtquick folderSemih Yavuz2023-10-121-19/+0
| | | | | | | | | | | | The documentation for QML tools should live in qml/doc. As todo for next commit: Introduce qmltooling overview page and exhibit qml tools in categories like developer-tools, designer-tools, internal-tools etc. Task-number: QTBUG-116660 Change-Id: Ide3b0a306e34dd6c1466dfdfa836d073caf1c884 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Doc: Fix unqualified access in PathView exampleSze Howe Koh2023-09-131-2/+7
| | | | | | | Pick-to: 6.6 6.5 6.2 5.15 Change-Id: Idb7e0f0dea262592ca39e8d42298bb51c91281cd Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Mike Trahearn <mtrahearn@topcon.com>
* Add QQuickRhiItemLaszlo Agocs2023-08-141-0/+147
| | | | | | | | | | | | | | | Try to follow the QRhiWidget API in most ways. Implies that the rhitextureitem example is repurposed to be the QQuickRhiItem example. The qquickitemrhiintegration autotest is repurposed as the qquickrhiitem autotest. Task-number: QTBUG-113331 Change-Id: I045d87f82ace07c8571c72c78e193cd5201cad69 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* internal doc: Start "QQ Pointer event delivery" with single-drag caseShawn Rutledge2023-07-121-0/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is for doxygen, thus we use the .dox extension rather than .qdoc. It's hard to dive into event delivery even in a simplified way without starting with a scenario walkthrough, so that's how this starts, with UML Object diagrams showing the delivery scenarios for single touch press, move and release events to drag a DragHandler. Then we end with some UML Activity Diagrams: an overview of the generalized delivery process, neglecting all the complications like filtering and touch->mouse synthesis. Other scenarios will be described on different pages in following patches. \mainpage starts a top-level subtree in the main left-side TOC, and we need to specify a \subpage for each page to be added to that subtree; but each page's contents can (and will) be defined in a separate file, from which doxygen also generates a separate HTML file. We can also use \ref to link pages together, to hint to the reader what (s)he ought to read next. An alternative approach would have been \defgroup to start a subtree under Modules in left-side TOC, and other pages could use \ingroup to insert themselves there. Calling a set of pages a "module" seems a bit odd though. What is worse is that doxygen would then combine all the \ingroup pages into one big page; heading sizes for \section and \subsection get confusing; and it's hard to control the TOC subtree ordering. Process for generating scenario diagrams, AKA communication diagrams, https://en.wikipedia.org/wiki/Communication_diagram which resemble UML object instance diagrams with numbered arrows showing function calls: - build and install umlquick into your local Qt build - `$ qml ~/dev/umlquick/examples/objectInstancesTimer.qml ../../snippets/pointerHandlers/pinchAndDragHandlers.qml` - close the qml window after the .dot file is generated - use graphviz to render the generated .dot file to SVG: `dot -Tsvg -O *.dot` - open the svg file in Inkscape; add the arrows with numbered labels - use kcharselect to find the "circled number" unicode glpyhs for pasting into labels, and into the corresponding descriptive text in the .dox file Change-Id: I08c047610f08d3b91f556cdb37192963ecc5eb8f Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Doc: Don't use versioned Qt imports in QML snippetsKai Köhne2023-06-30162-171/+171
| | | | | | | | | | | We don't promote versioned imports anymore in Qt 6. Patch done by find . -path "*/snippets/*.qml" -exec perl -pi -e "s/import Qt([\.a-zA-Z]*) \d\.\d+/import Qt\\1/g" {} ; Pick-to: 6.5 6.6 Change-Id: I20a5bf52f7cdd99124626f85ce9794af74382977 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add page for responsive layouts to documentationMatthias Rauter2023-06-162-0/+77
| | | | | | | | | Some information of the recent blog post about responsive layouts fits well into the documentation. A summary is added with this patch. Change-Id: I6e452b774b877c60a68d5b9a3e6a1de45bcad9bd Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Introduction of LayoutItemProxyJan Arve Sæther2023-06-021-0/+62
| | | | | | | | | | | | | The LayoutItemProxy is a proxy for an arbitrary QuickItem that is intended to be used in Layouts. This allows to position a QuickItem in multiple layouts to build responsive layouts. [ChangeLog][Layouts] Added LayoutItemProxy, a helper item for writing responsive layouts. Task-number: QTBUG-71153 Change-Id: Ief2bdbf44b3b346157ce2c71a313cc1e132f49ac Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* doc: Add Window.visibility property snippet; link to Window exampleShawn Rutledge2023-05-201-0/+29
| | | | | | | | | | | | Probably we'll keep the Window and Screen example: it has walkthrough docs already. Snippets can be used to illustrate some simplified scenarios, while the example is a bit fancier. Likewise, link to the Window and Screen example from the Screen docs. Pick-to: 6.2 6.5 Change-Id: I20c803affd1f4b6d44b41520782e5ad3c69fc871 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* doc: Use part of window example for Window.flags property snippetShawn Rutledge2023-05-162-0/+57
| | | | | | Pick-to: 6.2 6.5 Change-Id: I5b5c1663f626ce3bfe4c01edbc5480729a1b91f6 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* doc: Make Window snippets testable; remove import versionsShawn Rutledge2023-05-172-0/+33
| | | | | | Pick-to: 6.2 6.5 Change-Id: I35ba013152628591d016c632828a1c4e64cf5978 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* doc: Clarify usage of palette; testable snippetsShawn Rutledge2023-05-171-0/+38
| | | | | | | | | | | | | | | | | - color groups are better shown with copyable monospace syntax rather than capitalized - clarify that using palette grouped-property syntax does not imply that you must define every color - Window has a palette property, inited from SystemPalette: it's not only ApplicationWindow - testable snippets - reuse part of the windowPalette snippet for the Window.active property (switching colors might be the main use case) - make more links Pick-to: 6.2 6.5 Change-Id: I5974351ba66fc9aeec34cb6a4aba1eb85289f536 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Doc: make grabToImage example snippet more usefulVolker Hilsheimer2023-05-091-2/+3
| | | | | | | | | | | | | The example doesn't work as is (when run with the qml binary) because by the time Component.onCompleted is called, there might not be a window yet. Use a key press handler instead (which then needs focus to be set). Fixes: QTBUG-113312 Change-Id: I2986334aca4ca670e206ceadf1093a87aa304e8e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Use correct names for QEventPoint::State, PointerDevice::GrabTransitionShawn Rutledge2023-04-141-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | Qt::TouchPointState is not the actual type here, and we should not encourage e.g. making a comparison between eventPoint.state and Qt.TouchPointMoved in an onGrabChanged handler. The equivalence is an internal detail; and eventPoint can come from any pointing device, not only from a touchscreen. QEventPoint is a Q_GADGET; we keep the registration to expose it as a value type (eventPoint). But such types cannot be created in QML, and we also need to give it an uppercase name to scope the enum values that it declares: that's a new foreign namespace called EventPoint. So it's possible to compare an eventPoint instance's state property against EventPoint.Pressed, and so on. Also show complete QML syntax in the \value tables where PointerDevice::GrabTransition is emitted to QML, namely PointerDevice::grabChanged and PointerHandler::grabChanged. Amends b43a873264d012dc0a0e574ea53335a40af8aa38 Task-number: QTBUG-102160 Change-Id: If1a97f21d8e005e3692298b8512f7f8b56a92c97 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* doc: Improve BorderImage; make snippets scaleable, detailed; screenshotsShawn Rutledge2023-03-286-35/+406
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - This started with QTBUG-112322: introduce the border property next to the first snippet where it's used. - Give declarative-scalegrid.png a white background rather than transparent, to be consistent with the screenshots and to look better with a dark documentation style. - Make the snippets resizable so that it's possible to test the effects of the horizontalTileMode and verticalTileMode properties. - Get the borderframe.svg and .png files from the qtdoc repo (which ought to have been in this repo already, but perhaps not). - Resize borderframe.svg to 120x120 and set document size to match (in Inkscape); this makes it possible to use the svg directly in BorderImage, to test that QTBUG-25244 is really fixed. - Make the snippets match the screenshots (all 182px wide, with grey rectangle borders as shown). - It seems our scaling is smoother (less jagged) than in the old screenshots, so the new ones make a better impression. - Add region index labels to snippets and screenshots to be a bit less confusing next to the paragraphs that are talking about "parts of image in regions 2 and 8" and so on. Too bad they have to be so tiny. - Use \value rather than \li for enum values. Amends 1a84b190bd1a2781d03f13fa43ab92bf34809041 Pick-to: 6.2 6.5 Task-number: QTBUG-25244 Fixes: QTBUG-112322 Change-Id: I697ae1356eee62990b7903601cc493a04d3647a2 Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>