aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick
Commit message (Collapse)AuthorAgeFilesLines
* Introduce threadedsonglist exampleOtto Ryynänen18 hours47-1/+1193
| | | | | | | | | | | A new example showcasing use of a worker thread for fetching data to a custom model based on QAbstractListModel. The pattern is a topic in Qt World Summit 2025. Fixes: QTBUG-135351 Pick-to: 6.9 Change-Id: If1fe04740206fa5bfbe1eea269e2bde1e217eaf9 Reviewed-by: Shawn Rutledge <[email protected]>
* Port away from QPairZhao Yuhang2025-04-122-2/+2
| | | | | | | | QPair is just an alias of std::pair anyway. Task-number: QTBUG-115841 Change-Id: I26fc90adcc775aac9955ad57304af914dc4ed48f Reviewed-by: Ulf Hermann <[email protected]>
* CMake: Use qt_internal_add_example for advancedtextAlexandru Croitor2025-04-071-1/+1
| | | | | | | | | | | Because it's an example project, not a subdir project that adds other example projects. Amends 0b23a68fabf6bfcb03d04db7119c2985d7b5d84d Pick-to: 6.8 6.9 Change-Id: Iaaab440d1b6e75d89f0948083e275b2d7e7009ef Reviewed-by: Alexey Edelev <[email protected]>
* Introduce threaded fetchmore exampleOtto Ryynänen2025-04-0414-2/+433
| | | | | | | | | | Added an example of combining QThread and QAbstractItemModel - a feat that our customers ask every now and then Task-number: QTBUG-135351 Pick-to: 6.8 6.9 Change-Id: I476e7121361e4d85c2d87eb663f0389a337a3085 Reviewed-by: Fabian Kosmale <[email protected]>
* VectorImage example: Fix qmllint warningsFabian Kosmale2025-03-171-2/+5
| | | | | | | | | | | | | | | Use required properties where needed, and properly qualify lookups. Use ComponentBehavior: Bound so that the delegates can safely refer to the ids in the same file. This does not fix the unqualified warning in Heart.qml, as that file is auto-generated, and the generator would need the fix instead. Task-number: QTBUG-134589 Pick-to: 6.8 6.9 Change-Id: I6ef213004e0bb3e905a831749e9f0c2c5ca92518 Reviewed-by: Sami Shalayel <[email protected]> Reviewed-by: Ulf Hermann <[email protected]>
* Examples: Add explicit 6.9 project setup for private library usersDennis Oberst2025-03-103-3/+3
| | | | | | | | | | Looking up private libraries requires version 6.9 or higher. Amends: f71e2f99556c59f6f75fcc420542a67cef917f22. Pick-to: 6.9 Change-Id: I3a22893aef4dda6825955157667bec38f7b82b96 Reviewed-by: Alexey Edelev <[email protected]>
* threadedanimation example: add missing DEPENDENCIES to QtQuickSami Shalayel2025-03-031-0/+1
| | | | | | | | | | | | Add a missing dependency to QtQuick so that qmlls stops complaining about Spinner's base type QQuickItem. Amends a86fd709dd4d315cfe4fea77ea0bc730131fe840. Pick-to: 6.8 6.9 Change-Id: I7e8af3ee053ecbe66074104be86359a006ed9a05 Reviewed-by: Fabian Kosmale <[email protected]> Reviewed-by: Ulf Hermann <[email protected]>
* Make module ready for source SBOM checkingLucie Gérard2025-02-211-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | This includes: - turning VERIFY_SOURCE_SBOM ON - adding rules to the licenseRule.json files - correcting the licensing given via REUSE.toml files - renaming license files not located in LICENSES folder. Their name needs to be prefixed with `LICENSE.` to be ignored by reuse and excluded from the source SBOM. The names are updated in the corresponding qt_attribution.json A lot of files are skipped during the license test, but all are present in the source SBOM. This is why corrections are needed before turning the source SBOM check on. [ChangeLog][Third-Party Code] Renaming the license files with prefix LICENSE. to have them ignored by reuse tool. Task-number: QTBUG-131434 Pick-to: 6.9 6.8 Change-Id: I2b3e4750405f13a97b350ee65def30f1330526a3 Reviewed-by: Joerg Bornemann <[email protected]> Reviewed-by: Ulf Hermann <[email protected]>
* CMake: Fix CMake Error: AUTOMOC for target neumorphicpanel_sharedAlexandru Croitor2025-02-181-0/+1
| | | | | | | | Pick-to: 6.9 Fixes: QTBUG-133481 Change-Id: Iea93f6599f73476cb42305a9fd1b6b48802176f8 Reviewed-by: Alexey Edelev <[email protected]> Reviewed-by: Volker Hilsheimer <[email protected]>
* Doc: Clarify use of QQuickWindow::beforeRenderingSafiyyah Moosa2025-02-021-3/+3
| | | | | | | | | | | | | | | | | | | The SceneGraph - RHI under QML example gives the impression that QQuickWindow::beforeRendering() is used with underlays and QQuickWindow::afterRendering() is used with overlays which is misleading. QQuickWindow::beforeRendering() can be used to upload data to buffers in both instances. Then, based on whether an underlay/overlay is required, the user can QQuickWindow::beforeRenderPassRecording() or QQuickWindow::afterRenderPassRecording(), respectively. This patch updates the documentation to make this distinction clear. Fixes: QTBUG-130570 Pick-to: 6.6 6.7 6.8 6.9 Change-Id: I3d086b9309d759a5e80f4abbd81d2fc1da55e9f0 Reviewed-by: Michal Klocek <[email protected]>
* CMake: Fix examples built as external projectsJoerg Bornemann2025-01-314-5/+5
| | | | | | | Usage of a private module needs a respective find_package call now. Change-Id: I20f7571e11ab9b2ca6d185b4834e72100d9ce2d6 Reviewed-by: Alexandru Croitor <[email protected]>
* Docs: Update the published QML code to reflect current best practicesAlexei Cazacov2025-01-243-4/+4
| | | | | | | | | This commit addresses the edit proposals mentioned in the QTBUG-131978. Task-number: QTBUG-131978 Pick-to: 6.9 6.8 Change-Id: Ib94379c6dc0778f5aee8e53c5f1015ad7b10779f Reviewed-by: Fabian Kosmale <[email protected]>
* Replace QImage::mirrored with QImage::flipped in rendercontrol exampleVolker Hilsheimer2024-12-021-1/+1
| | | | | Change-Id: I09e1ddc335ea77a6d15dcb160e58ab01919ceee1 Reviewed-by: Allan Sandfeld Jensen <[email protected]>
* Fix warnings in rendercontrol_rhi exampleShawn Rutledge2024-11-121-4/+4
| | | | | | | Task-number: QTBUG-130991 Pick-to: 6.8 6.8.1 Change-Id: Ie2afcc693ef13ab482229e77e62514183675e9e7 Reviewed-by: Oliver Eftevaag <[email protected]>
* Add RectangularShadow elementKaj Grönholm2024-11-0918-0/+964
| | | | | | | | | | | | | | | | | | | | | | | | Add a new element into QtQuick.Effects called RectangularShadow. This is a high performance shadow/glow for (rounded)rectangle shapes. Differences compared to QGE RectangularGlow: - Implemented in C++ and part of QtQuick.Effects module. - Different API, modelled based on CSS box-shadow. - Shader uses SDFs math for rounded rectangle. Reduced item size and properly rounding math (circle is a circle). - Allows offset and spread relative to item. - Default color is black (shadow) rather than white (glow). - Using "layer.enabled" for cache property rather than separate ShaderEffectSource. - Property "material" so shader effect can be customized. QQEM can contain RectangularShadow node for easier customization. Contains an example and lancelot tests. Task-number: QTBUG-128469 Change-Id: Ie3baa774a3294ba0c7fe11d1bee8cd7aae897505 Reviewed-by: Kaj Grönholm <[email protected]>
* QML Previewer Example: add QQuickWidgetMohammadHossein Qanbari2024-10-316-11/+62
| | | | | | | | | | Add QQuickWidget to display the list of errors. Previously, a QListView was used for this purpose. Introduce ErrorListView.qml file, which includes a ListView using the ErrorListModel. Pick-to: 6.8 Change-Id: I221b347e14305338219f5d8e8d2994497a0f20f5 Reviewed-by: Oliver Eftevaag <[email protected]>
* Add REUSE.toml files and missing licensesLucie Gérard2024-10-291-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | REUSE.toml files are read by reuse to complement or override the copyright and licensing information found in file. The use of REUSE.toml files was introduced in REUSE version 3.1.0a1. This reuse version is compatible with reuse specification version 3.2 [1]. With this commit's files, * The SPDX document generated by reuse spdx conforms to SPDX 2.3, * The reuse lint command reports that the Qt project is reuse compliant. In order to be reuse compliant all the licenses referenced in file or within a REUSE.toml files must be present in the LICENSES directory at the base of the module. The missing licenses are added. [1]: https://reuse.software/spec-3.2/ Task-number: QTBUG-124453 Task-number: QTBUG-125211 Change-Id: I5a83879a7fee1bba046b2c53d9727dc0cde05c25 Reviewed-by: Ulf Hermann <[email protected]> Reviewed-by: Joerg Bornemann <[email protected]>
* Examples: Make qquickwidgetvswindow depend on QtQuickUlf Hermann2024-10-241-0/+1
| | | | | | | | | It uses QtQuick types in C++. For that to transpire to QML tooling we need to declare a dependency. Pick-to: 6.8 Change-Id: Icede50c638428062f392351ba590cf0f8f2740ee Reviewed-by: Fabian Kosmale <[email protected]>
* QML Previewer Example: Prevent unnecessary state changesMohammadHossein Qanbari2024-10-094-8/+12
| | | | | | | | | | | | | | | | | | | Previously, when setting a new file address and pressing the close button, the focus would move to the quick widget due to QLineEdit::editingFinished() being called. This triggered an attempt to close the old file and open the new one, causing unintended state transitions. To resolve this, we now reload the file content and update the quick widget's source without transitioning to CloseState and OpenState. This is achieved by updating the file path and emitting stateChanged() from OpenState to OpenState in the StateController, notifying other widgets to reload their content. Pick-to: 6.8 Change-Id: Ic623d320fe1736e11fd538a6735632b19c507394 Reviewed-by: Jan Arve Sæther <[email protected]> Reviewed-by: Doris Verria <[email protected]>
* Improve the responsive layouts exampleShawn Rutledge2024-10-021-10/+14
| | | | | | | | | | | | | - range of useful resizing is greater - go from 2 to 6 columns during resizing - don't make the sidebar huge: assume the "content" is more interesting - required property index - minor syntax reordering Pick-to: 6.7 6.8 Task-number: QTBUG-119388 Change-Id: I55d684107e5fc972a1b328b12b4932a1fc85b382 Reviewed-by: Oliver Eftevaag <[email protected]>
* Examples: Disable QtC junction points for examples using 'shared' directoryKai Köhne2024-09-2719-0/+399
| | | | | | | Task-number: QTBUG-128914 Pick-to: 6.8 Change-Id: If01f7e17c1f6c033e601e2e012745461c71f2e13 Reviewed-by: Cristian Adam <[email protected]>
* QMLPreviewer Example: Fix compile error on AndroidMohammadHossein Qanbari2024-09-241-2/+2
| | | | | | | Fixes: QTBUG-129214 Pick-to: 6.8 6.8.0 Change-Id: I6f867244f8c21c911177e4b0adc5c7074951b470 Reviewed-by: Doris Verria <[email protected]>
* QMLPreviewer Example: More improvementsDoris Verria2024-09-195-14/+22
| | | | | | | | | | | | | | | | | | | - Don't set implicitHeight to controls as the style should choose valid default heights - Use a QPushButton instead of a QToolButton in order to show consistent styling between widgets and quick - Make the QLineEdit editable so that a focus frame is displayed around it (we don't show focus frames for read-only line edits in the macOS style) - Validate the URL when editing in the line edit is finished - Add a tooltip to the button that opens the file dialog to make its purpose more clear - Fix typo and improve some messages shown in the message boxes Pick-to: 6.8 6.8.0 Change-Id: I53095808a76e2615117039363be01cfa4d9f243f Reviewed-by: Jan Arve Sæther <[email protected]> Reviewed-by: MohammadHossein Qanbari <[email protected]>
* QML Previewer Example: Fix saving the default file's changesMohammadHossein Qanbari2024-09-191-1/+1
| | | | | | | | | | | | | | When changes to the default loaded file were saved, the address bar displayed an incorrect path and the view failed to update. The issue stemmed from an improper transition from the Dirty state to the Open state. The correct transition is changesSaved(). The setDirty(false) method is reserved for when changes are discarded (e.g., after an undo operation). Pick-to: 6.8 6.8.0 Change-Id: Iafee4bf7c0eeae6f2fc7fdb0d32a555a99824249 Reviewed-by: Doris Verria <[email protected]>
* QMLPreviewer Example: Use window container instead of qquickwidgetDoris Verria2024-09-193-17/+19
| | | | | | | | | | | Tab-focusing between widgets and the quick view works better when using qwindowcontainer instead of qquickwidget. Changes are still ongoing to make this work for qquickwidget as well, so change the example to use qwindowcontainer for now. Pick-to: 6.8 6.8.0 Change-Id: Ia01d34a4ebb0b8d9c607d1664b6cfc6df164e097 Reviewed-by: Jan Arve Sæther <[email protected]>
* Example for VectorImageEskil Abrahamsen Blomfeldt2024-09-119-0/+387
| | | | | | | | | | | | | | This introduces a small example of VectorImage and other ways to display SVG content in a Qt Quick application. Its purpose is to document the available APIs for this and explain what their differences are. The heart.svg is a public domain, no-attribution image which is also used in other examples and manual tests in Qt. Pick-to: 6.8.0 6.8 Change-Id: I457ffc01d7ea286a157a4a5bff0571098b852cef Reviewed-by: Eirik Aavitsland <[email protected]>
* QML Previewer Example: Fix bug when saving new fileMohammadHossein Qanbari2024-09-031-1/+1
| | | | | | | | | | | | | | | When saving content as a new file, the application saved the changes but nothing changed in the quick widget. The problem was that the state was not changed correctly, and the current state wouldn't transition to the open state. To fix this issue, when saving the content, the transition from the new state to the open state is `changesSaved()`, while `setDirty(false)` was incorrectly changing the new state back to the init state. Pick-to: 6.8 Change-Id: I20707046bc17044a18c95ce77e6e56c4a8c21627 Reviewed-by: Oliver Eftevaag <[email protected]>
* QML Previewer Example: Add Error List and Line NumbersMohammadHossein Qanbari2024-09-0214-40/+453
| | | | | | | | | | | | | | | Implement LineNumberArea to display line numbers, based on the Code Editor Example documentation. Introduce QListView with ErrorListModel to show errors and warnings. Double-clicking an error in the list moves the code editor's cursor to the corresponding position. Update shortcut functionality to work only on platforms where the feature is available. Related code has been modified accordingly. Fixes: QTBUG-128227 Pick-to: 6.8 Change-Id: Icb66280a5360b015280afc756f8a827247a2ebaf Reviewed-by: Jan Arve Sæther <[email protected]>
* Add the QMLPreviewer exampleMohammadHossein Qanbari2024-08-3017-0/+1068
| | | | | | | | | | | | | | | | | | | | | | | The example provides two sections including an editor and a view for QML codes. The QML codes can be written by the user from scratch and save to a file, or, it can be loaded from a file. Also, it is possible to save the changes and see the result in the view side. The application can detect any changes to the source file outside of itself and reloads the editor and the view sections. The editor is QPlainTextEdit and the view is QQuickWidget. The QQuickWidget is used to embed QML in the application which is a widget application. The implemented actions in the example are: - Open file: to open and load a (.qml) file - Save file: to save the changes into the opened file or into a new file - Close file: to close the opened file - Reload: to discard the changes and to reload the opened file Pick-to: 6.8 Change-Id: I3106dd78998c4b0e86e21803ccf1bb84205a13a4 Reviewed-by: Jan Arve Sæther <[email protected]>
* twotextureproviders example: Remove out-of-date todo commentLaszlo Agocs2024-08-301-2/+0
| | | | | | Pick-to: 6.8 Change-Id: I795e63e8823b2c57cef87728373732d8969b1643 Reviewed-by: Christian Strømme <[email protected]>
* Introduce example that shows advanced text featuresEskil Abrahamsen Blomfeldt2024-08-2910-0/+256
| | | | | | | | | | | | This example demonstrates how to use variable axis support in Qt to make text fit in a pre-defined layout. The example is given a non-specific name so that it can easily be expanded to show additional font features later. Pick-to: 6.8 Change-Id: Ic18b177f02a21fa9e7726bb35e94ed6ecc93bafd Reviewed-by: Volker Hilsheimer <[email protected]>
* VectorImage: Allow root items to be path containersEskil Abrahamsen Blomfeldt2024-08-287-152/+0
| | | | | | | | | | | | | | | | | When the generators were refactored to add special-handling of the root node, the path container logic from the structure node handling was not included there, causing some SVGs to get a lot of Shape items instead of combining them. This re-introduces the logic by adding a Shape item inside the root item if we see that we can make a root path container. (This is slightly different from structure nodes, where the structure node itself can be the Shape item. Since the root node has special requirements, we keep it and just add a new Shape level inside.) Pick-to: 6.8 Fixes: QTBUG-126716 Change-Id: If05fd38bad08749cf5c4b338ead104aa01672e49 Reviewed-by: Eirik Aavitsland <[email protected]>
* Update generated assets in weather forecast exampleEskil Abrahamsen Blomfeldt2024-07-2214-1146/+1433
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This have been regenerated with an updated svgtoqml. One change was needed in the example: The generator would previously added a subitem inside the main item which was transformed to fit the item to the requested size: Item { implicitWidth: foo; implicitHeight: bar Item { transform: ... Shape { ... } } } This was since removed, likely because it's dead weight (and removes the possibility of overriding it), so now the transform is set directly on the generated root object. But the weather forecast example had made the map labels children of the generated item, which means the scale was now also applied to them. This was easy to fix in the example, by creating the extra item ourselves in the case where it's needed. This patch also takes the liberty of fixing some minor whitespace issues etc. Pick-to: 6.8 Change-Id: Ic324815c71f990bb7e8e7caed659c14267b1777a Reviewed-by: Eirik Aavitsland <[email protected]>
* Add Expanding size policy to some controls and itemsJan Arve Sæther2024-07-172-12/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Applies to the following Quick items: * TextEdit * TextInput * Flickable and Qt Quick Controls: * ProgressBar * Slider * RangeSlider It follows the same Expanding size policies as the corresponding widgets Also enable size policies the following examples (and thus remove several lines of Layout.fill.*): * quick/layouts * quickcontrols/ios/todolist Task-number: QTBUG-117597 Pick-to: 6.8 Change-Id: Id4f552aa4c8e85a65b00ff1cf06f34dd7ddeb9fa Reviewed-by: Santhosh Kumar <[email protected]>
* Use best practices in the Quick Shapes exampleEirik Aavitsland2024-07-039-91/+39
| | | | | | | | | | | | | | | | Circles and ellipses can now be expressed simpler with a single PathAngleArc object, instead of two PathArcs. Similarly, use PathRectangle instead of four PathLines. Also fixes various minor qml issues flagged by qmllint. As a drive-by, improves the doc of the new fillTransform property with example code that matches one of the gallery examples. Pick-to: 6.8 Change-Id: I4529cca08c0cffc51d495f8ce815b50c053e4aa3 Reviewed-by: Hatem ElKharashy <[email protected]> Reviewed-by: Paul Olav Tvete <[email protected]>
* examples: Consistently require Qt 6.8Fabian Kosmale2024-07-0349-49/+49
| | | | | | | | | | | | This prevents policy warnings in a few cases, and we want people to opt-in to new policies, so make our examples copy'n'paste friendly. Pick-to: 6.8 Task-number: QTBUG-126201 Task-number: QTBUG-126468 Change-Id: Iefa666b61c2d2f767da3583f0f6efd8e4a2169e5 Reviewed-by: Ulf Hermann <[email protected]> Reviewed-by: Olivier De Cannière <[email protected]>
* wasm: Move OpenGLUnderQml to VertexBufferObject to satisfy WebGLEven Oscar Andersen2024-06-112-16/+16
| | | | | | | To make the example work under webassembly also Change-Id: I9eb7ab4503efcffa68d4de3008c8275f723ec659 Reviewed-by: Laszlo Agocs <[email protected]>
* Texture fill for shapesEskil Abrahamsen Blomfeldt2024-05-273-0/+55
| | | | | | | | | | | This introduces a "fillItem" property to ShapePath. Similar to gradient, this enables filling a shape with any texture provider item, such as an image, a ShaderEffectSource or a layer-enabled item. Fixes: QTBUG-104121 Change-Id: I8748a90c825e8eb4655a4ac90648c6ae74420527 Reviewed-by: Eirik Aavitsland <[email protected]>
* graph example: Do not use GLSL functions as uniform namesLaszlo Agocs2024-05-274-3/+3
| | | | | | | | | | | | | | | | | Using textureSize in the uniform block leads to renaming it to _textureSize when transpiling to GLSL. This is not reflected in the reflection metadata for some reason. For OpenGL this matters because the QRhi backend won't be correctly able to set up the uniforms when the names do not match. To overcome this, use a name in the shader that does not conflict with a built-in GLSL function. Strictly speaking the name (textureSize) is somewhat incorrect anyway. Use texCoordScale to express its meaning better. Pick-to: 6.7 6.6 6.5 6.2 Change-Id: I863e98c6d56cc46fad895763b9b5106a40e2952c Reviewed-by: Andy Nichols <[email protected]>
* Add PathRectangle, a PathElement for optionally rounded rectanglesEirik Aavitsland2024-05-265-6/+64
| | | | | | | | | | | | This new path element type is particularly useful for QuickShapes, where it can be used to mimic a Rectangle item. It provides the same API for specifying common and/or individual corner radii. [ChangeLog][QtQuick] Add PathRectangle, a PathElement for optionally rounded rectangles Fixes: QTBUG-123913 Change-Id: Ia0de252f70c665bd70f63aa31e3010584cc9cd8c Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
* Add fillTransform property to ShapePathEirik Aavitsland2024-05-144-0/+57
| | | | | | | This adds functionality corresponding to QBrush transform to QuickShapes. Change-Id: I2b5903f8c228adec65a6f5be64e3816143879302 Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
* Doc: Fix mentioning of QQW::createTextureFromNativeObject in exampleKai Köhne2024-04-191-3/+2
| | | | | | | | | | | | | The method got removed in Qt 6.0, and the example code was adjusted accordingly (commit fb96109bbc2ec5d). While at it, also remove the mentioning of the even older QQuickWindow::createTextureFromId(), as that is most likely not relevant for new users looking into this example. Pick-to: 6.6 6.7 Change-Id: I2ea3fcf3de78e13afec9e2b25aa8d4a6a9a9b571 Reviewed-by: Tor Arne Vestbø <[email protected]>
* Set correct shader version for CustomRenderNode exampleEven Oscar Andersen2024-04-191-0/+2
| | | | | | | | | | The custom rendernode example uses the default GLSL which is: "100es,120,150". The problem with this is that gl_VertexId only exists in OpenGL ES 3.00 or later, and GLSL 1.30 and later end result is that the shader compiles but does not run. Change-Id: I1ac18e381b1e8b28368f67e4140f4bb43bb17e62 Reviewed-by: Laszlo Agocs <[email protected]>
* wasm: CustomMaterial: Change shader program so that it is accepted by WebGLEven Oscar Andersen2024-04-183-5/+14
| | | | | | | | | | There are issues with for loops in GLSL, see for instance: https://learnwebgl.brown37.net/12_shader_language/glsl_control_structures.html The solution is to rewrite the shader so that it also works on WebGL. Fixes: QTBUG-123593 Change-Id: Ia9fd4d9ef3f1b99a29d4bbabae20ad779fe4fbba Reviewed-by: Lorn Potter <[email protected]>
* CMake: Add deployment API to our examplesAlexandru Croitor2024-03-2766-647/+723
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Projects were modified using the tool at: https://git.qt.io/alcroito/cmake_refactor A few examples had to be adapted manually, mostly those that build additional qml modules / plugins. The INSTALL_EXAMPLESDIR and INSTALL_EXAMPLEDIR assignments were removed, these are not needed anymore because example directory selection is handled by the qt_internal_add_example calls. The install(TARGETS) calls were modified according to our documentation snippets for qt_generate_deploy_qml_app_script. A qt_generate_deploy_qml_app_script call was added for each executable target. Note that the deployment step will be skipped in the CI for now, because: - we enable QT_DEPLOY_MINIMAL_EXAMPLES in the CI instructions and thus set QT_INTERNAL_SKIP_DEPLOYMENT to true - standalone examples feature is not yet enabled in the CI, which means we continue to build examples in-tree, and deployment is disabled for in-tree prefix builds. A small list of examples to deploy in the CI will be chosen in the future, to ensure deployment coverage, without slowing down overall CI times due to all the *deployqt invocations. Even if deployment is disabled in the CI, the install(TARGETS) calls for each example will still run, installing into an 'installed_examples' directory, which will not be archived by the CI. The QtBundleQmlModuleForMacOS and bundle_shared code was removed, because we can now depend on the MACOS_BUNDLE_POST_BUILD option of the deployment api, to ensure macOS bundle examples run properly in the build dir. This works even in prefix in-tree builds, when installation deployment is disabled. Finally, for all examples that build additional qml module libraries or plugins, the libraries / plugins must be installed into the bin dir of each project, along with a qmldir file. This is to support running the installed project for platforms that don't have deployment api yet, like boot2qt / yocto. If we want to have super clean install / deployment rules in the future, we won't be able to avoid adding ugly per-platform conditions. The current status quo is deemed an improvement over what we had before. Pick-to: 6.7 Task-number: QTBUG-101340 Task-number: QTBUG-102056 Task-number: QTBUG-102057 Change-Id: I843d934668c25dbcd1abca52495b393579633fc5 Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Alexey Edelev <[email protected]>
* Use new Qt configure feature for MetalTor Arne Vestbø2024-03-251-1/+1
| | | | | Change-Id: I603018d3f4c6a49c39f7daed25101c24edbbfc02 Reviewed-by: Alexandru Croitor <[email protected]>
* Correct license for examples filesLucie Gérard2024-03-2175-75/+75
| | | | | | | | | | | | | Example takes precedent over build system file type. According to QUIP-18 [1], all examples file should be 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: Ie8c2539e7659f53a1fd6b48f99ee883ee9aeb0a7 Reviewed-by: Kai Köhne <[email protected]>
* Correct a typo in the view list. Modify "a Object" to "an Object"Frédéric Lefebvre2024-03-181-1/+1
| | | | | | | | | Correct a typo in the view list. Modify "a ObjectModel" for "an ObjectModel" Task-number: QTBUG-119689 Change-Id: I96328df0d20bf264810ad9759c085d558ff600fc Reviewed-by: Axel Spoerl <[email protected]>
* wasm: rendercontrol example -background colorEven Oscar Andersen2024-03-161-1/+1
| | | | | | | | | | | | This fixes the background color of the rendercontrol example. Essentially we cannot assume the OpenGL background color is stored in the state, and need to set it every frame Change-Id: I5bb14f10c4049ca2e5657cceb4550e23fbf4d968 Reviewed-by: Laszlo Agocs <[email protected]> Reviewed-by: Piotr Wierciński <[email protected]>
* Fix duplicate HighScore when replaying SameGame ExampleWladimir Leuschner2024-03-121-4/+7
| | | | | | | | | | | | | | | | | The onClosed slot invokes SameGame.saveHighscore function in samegame.js. Also the startNewGame function in samegame.js is triggering the SameGame.saveHighscore function by calling Dialog.hide, which in turn calls the onClosed slot. This leads to duplicate highscore entries. Moving the closing of the dialog after the clearing of the board/score and additionally adding a condition that if the score is 0, no highscores are saved, the duplication is avoided. Fixes: QTBUG-119812 Pick-to: 6.7 6.6 Change-Id: I6aa433789f197a0d1e70abc82baf893934e53be5 Reviewed-by: Ulf Hermann <[email protected]> Reviewed-by: Oliver Wolff <[email protected]>