aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick
Commit message (Collapse)AuthorAgeFilesLines
* android: Fix compilation of weatherforecast and vectorimage examplesEskil Abrahamsen Blomfeldt5 days2-2/+2
| | | | | | | | | | For some reason, the QuickTools package is not implicitly included when building for Android like it is on desktop platforms. Pick-to: 6.11 Fixes: QTBUG-142665 Change-Id: Icdc5afab85ed6061f47e976d5189879b5d47c083 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Restore multi-threaded OpenGL path in rendercontrol_opengl exampleJiDe Zhang5 days5-5/+591
| | | | | | | | | | Porting from the Qt5. Pick-to: 6.11 Task-number: QTBUG-102301 Change-Id: Ic4aa3e4c3f759ccd6e04ef77ed5c2f888e7f9aa0 Reviewed-by: JiDe Zhang <zhangjide@uniontech.com> Reviewed-by: Liang Qi <liang.qi@qt.io>
* Use ApplicationWindow in responsive layouts exampleTor Arne Vestbø6 days1-1/+1
| | | | | | | | The Window type doesn't handle palette changes automatically. Fixes: QTBUG-134767 Change-Id: I039f2bda7aeb1ba534c357bca30b1cfa693362a2 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Doc: Overhaul the descriptions of examples about hybrid UIAlexei Cazacov8 days7-40/+118
| | | | | | | | | | | The examples that demonstrate hybrid UI approaches lack proper descriptions. This commit restructures and enhances the descriptions for these. Task-number: QTBUG-134102 Pick-to: 6.11 6.10 Change-Id: I5cf604fee932024cbe73347696e19f9c6e22d5b7 Reviewed-by: Alexei Cazacov <alexei.cazacov@qt.io>
* Port Q_{ENUMS,FLAGS} to Q_{ENUM,FLAG}Ahmad Samir8 days1-1/+1
| | | | | | | | | | | | | | | | | | Q_{ENUM,FLAG} does what Q_{ENUMS,FLAGS} did plus declaring two friend functions, so the behavior should be the same. For enums that are declared as flags (with Q_DECLARE_FLAGS(Es, E)), use Q_FLAG(Es) which will register each enum value with the meta-object system. Q_FLAGS usage in tests/auto/qml/qmlcppcodegen/data/enumproblems.h is testing Q_FLAGS itself. Q_ENUMS/Q_FLAGS have been deprecated since at least Qt 6. Pick-to: 6.11 6.10 6.8 6.5 Change-Id: Id21b6e3205a786b3a5fa04bd09dfee2a6c1c2a86 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Examples: Stop using version numbers with QML modulesSze Howe Koh2025-10-282-9/+2
| | | | | | | | | | | | | | | | | | | | | Continues 2d44365f69b9bc946d085c6b149e2ac319700265 and b7f448f8647a9a118cee2d79d446194b20d4b335 * Qt 6.0 enabled and encouraged users to import QML modules without specifying a version number * Qt 6.5 enabled and encouraged users to create QML modules without specifying a version number With this approach, there is little benefit in specifying QT_QML_SOURCE_VERSIONS, especially in an example module that is not consumed by external software. It does not need to worry about compatibility/versioning. Task-number: QTBUG-89033 Task-number: QTBUG-140406 Change-Id: I7f83dc7430180b79b70c75e7ce7b3aef46a028ae Pick-to: 6.10 6.8 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Don't use JS placeholders inside qsTr() callsJan Arve Sæther2025-10-271-1/+1
| | | | | | | | Using JS placeholders inside qsTr() is a bad practice, and makes translations impossible Change-Id: I08dffd1a718a7112a8e426a013419578ec2f16f0 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* RectangularShadow: Add support for individual corner radiusKaj Grönholm2025-10-2311-69/+240
| | | | | | | | | | | | Add API for specifying individual corner radius values similar to Quick Rectangle. Try to keep the overhead minimum when not used, by storing data in lazily allocated extra and using separate shader. Use the API in the neumorphicpanel example. Task-number: QTBUG-141110 Change-Id: I90e558526dff01c88fb2d163a33704b8f73aa1fc Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Ensure that the right grid at least have one columnJan Arve Sæther2025-10-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | If the initial window width was so large that the inital layout was determined to be the "largeLayout" (wider than 450 pixels), then the binding columns: Math.min(Math.round(width / 130), 6) initially resulted in 0 columns because the width was initially evaluated to be 0, which caused the grids implicitWidth to be 0 (because it couldn't fit any items when columns was 0). Hence, it was "deadlocked": it didn't add items because columns was 0, and it didn't increase columns because it's width was 0. An item in a layout with implicitWidth == 0 will always have lower priority to grow than items with a larger implicitWidth - hence the grid was stuck at width == 0 Pick-to: 6.10 6.8 Fixes: QTBUG-140533 Change-Id: I558463ac33db36fa7eb8df4c70adc94f90c69e8f Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Adapt to reuse version 6Lucie Gérard2025-10-201-0/+8
| | | | | | | Task-number: QTBUG-140916 Pick-to: 6.8 6.10 Change-Id: I7c3e50c277f28a9af9347fcf61e205187334be2f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Account for safe margins in scenegraph vulkan exampleAssam Boudjelthia2025-09-301-1/+5
| | | | | | | Fixes: QTBUG-140544 Pick-to: 6.10 6.10.0 Change-Id: I951d3bae73157ccf2cfcf549b506a44651719243 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* CMake: Guard examples that use Svg in a qt build without SvgAlexandru Croitor2025-09-162-5/+11
| | | | | | | | | | | | | | | | | | Otherwise one gets errors like the following in standalone examples build: CMake Error at tools/svgtoqml/Qt6SvgToQmlMacros.cmake:65 (add_custom_command): Error evaluating generator expression: $ No target "Qt6::svgtoqml" Because the examples now use the new qt_target_qml_from_svg() function, which will try to reference a non-existent svgtoqml tool target. Change-Id: I16b10c4fa31bd73d0d95bbad371cde54f17c236a Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Doc: Add some notes about PathText usage in Quick ShapesEirik Aavitsland2025-09-051-0/+1
| | | | | | | | | Note the expected fill rule, as defined by TrueType, and explain that if the stroked outline looks bad, it's the font's fault. Pick-to: 6.10 Change-Id: I8c4c7d319c96d2514c3b11f27a7e85b7c408a79d Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Build flexboxlayout example when building examplesJan Arve Sæther2025-09-053-0/+17
| | | | | | | | | Disable for INTEGRITY AND VXWORKS as it is currently not supported for these two targets Pick-to: 6.10 Change-Id: I7eb21d5c348f7e29c2c99cede30a8e627036b220 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Use new qt_target_qml_from_svg() function for examplesEskil Abrahamsen Blomfeldt2025-08-2124-2381/+104
| | | | | | | | | | | | | | | | This updates weatherforecast and vectorimage examples to use the automatic svgtoqml build steps instead of manual conversion. Removes .pro file for weatherforecast. This is a new example after the move to CMake and it should have never had a .pro file to begin with. We aren't going to implement the svgtoqml build step with qmake, so we can't keep this working. Task-number: QTBUG-128915 Change-Id: I2e2506316d4fc8fb35c227309f50e0c92f2a0e38 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Rename flexboxlayout example directory in consistent with othersSanthosh Kumar2025-08-153-0/+0
| | | | | | Pick-to: 6.10 Change-Id: Ie189960af25a33f0dee54fbd49213f9d5eab5891 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix runtime error in the flexboxlayout exampleSanthosh Kumar2025-08-121-1/+1
| | | | | | | | | | The Text::wrapMode has been referenced incorrectly as Text::wrap and its corrected in this patch. Fixes: QTBUG-137733 Pick-to: 6.10 Change-Id: Ieb1ab02e19bc929f103443f0845a8980daceb245 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Update svgtoqml generated examplesEskil Abrahamsen Blomfeldt2025-08-1212-14/+378
| | | | | | | | | | The svgtoqml tool has been updated, so we need to update its generated files as well. Pick-to: 6.10 Change-Id: Ie58653c35e99e0c1119a9bf64d803371d31261e5 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
* graph example: use qt_add_shaders with CMakeLaszlo Agocs2025-08-051-6/+14
| | | | | | | | | | | | Like other examples already do. It would have prevented (at least when CMake is used, not qmake) problems like in the associated bug report where .qsb files from newer versions were cherry picked to older Qt branches that cannot load them. Pick-to: 6.10 6.9 6.8 Task-number: QTBUG-135407 Change-Id: I25bf69139de13a70e3682865dd779e0a5ab05e28 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* sg: Fix culling in layersLaszlo Agocs2025-07-221-4/+7
| | | | | | | Pick-to: 6.10 6.9 6.8 Fixes: QTBUG-136611 Change-Id: If2a0a0365ca24360d850ffce98c0bec4a3961976 Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io>
* Support Flexbox layout in Qt QuickSanthosh Kumar2025-05-283-0/+135
| | | | | | | | | | | | | | | | 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>
* Introduce threadedsonglist exampleOtto Ryynänen2025-05-0247-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 <shawn.rutledge@qt.io>
* 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 <ulf.hermann@qt.io>
* 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 <alexey.edelev@qt.io>
* 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 <fabian.kosmale@qt.io>
* 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 <sami.shalayel@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* 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 <alexey.edelev@qt.io>
* 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 <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* 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 <joerg.bornemann@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* 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 <alexey.edelev@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* 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 <michal.klocek@qt.io>
* 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 <alexandru.croitor@qt.io>
* 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 <fabian.kosmale@qt.io>
* Replace QImage::mirrored with QImage::flipped in rendercontrol exampleVolker Hilsheimer2024-12-021-1/+1
| | | | | Change-Id: I09e1ddc335ea77a6d15dcb160e58ab01919ceee1 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* 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 <oliver.eftevaag@qt.io>
* 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 <kaj.gronholm@qt.io>
* 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 <oliver.eftevaag@qt.io>
* 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 <ulf.hermann@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* 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 <fabian.kosmale@qt.io>
* 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 <jan-arve.saether@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io>
* 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 <oliver.eftevaag@qt.io>
* 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 <cristian.adam@qt.io>
* 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 <doris.verria@qt.io>
* 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 <jan-arve.saether@qt.io> Reviewed-by: MohammadHossein Qanbari <mohammad.qanbari@qt.io>
* 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 <doris.verria@qt.io>
* 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 <jan-arve.saether@qt.io>
* 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 <eirik.aavitsland@qt.io>
* 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 <oliver.eftevaag@qt.io>
* 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 <jan-arve.saether@qt.io>
* 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 <jan-arve.saether@qt.io>