Commit Graph

1098 Commits

Author SHA1 Message Date
Alexandru Croitor 1e5a63f7a3 CMake: Guard examples that use Svg in a qt build without Svg
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>
2025-09-16 09:03:29 +02:00
Eirik Aavitsland 815cd44fbb Doc: Add some notes about PathText usage in Quick Shapes
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>
2025-09-05 18:38:17 +02:00
Jan Arve Sæther fbd10cac80 Build flexboxlayout example when building examples
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>
2025-09-05 18:38:17 +02:00
Eskil Abrahamsen Blomfeldt 35f6faf56e Use new qt_target_qml_from_svg() function for examples
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>
2025-08-21 12:55:54 +02:00
Santhosh Kumar 5b21e3c72b Rename flexboxlayout example directory in consistent with others
Pick-to: 6.10
Change-Id: Ie189960af25a33f0dee54fbd49213f9d5eab5891
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2025-08-15 11:24:29 +02:00
Santhosh Kumar c2ce31c44f Fix runtime error in the flexboxlayout example
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>
2025-08-12 18:19:53 +02:00
Eskil Abrahamsen Blomfeldt b7a05428d4 Update svgtoqml generated examples
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>
2025-08-12 07:12:57 +02:00
Laszlo Agocs d6878e0a27 graph example: use qt_add_shaders with CMake
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>
2025-08-05 13:35:20 +02:00
Laszlo Agocs e32d335c8f sg: Fix culling in layers
Pick-to: 6.10 6.9 6.8
Fixes: QTBUG-136611
Change-Id: If2a0a0365ca24360d850ffce98c0bec4a3961976
Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io>
2025-07-22 14:17:21 +02:00
Santhosh Kumar 6617c64b8f Support Flexbox layout in Qt Quick
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>
2025-05-28 03:29:34 +02:00
Otto Ryynänen 7621e1c082 Introduce threadedsonglist example
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>
2025-05-02 20:32:28 +03:00
Zhao Yuhang 60297d4d1e Port away from QPair
QPair is just an alias of std::pair anyway.

Task-number: QTBUG-115841
Change-Id: I26fc90adcc775aac9955ad57304af914dc4ed48f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2025-04-12 05:39:59 +00:00
Alexandru Croitor cff02c1852 CMake: Use qt_internal_add_example for advancedtext
Because it's an example project, not a subdir project that adds other
example projects.

Amends 0b23a68fab

Pick-to: 6.8 6.9
Change-Id: Iaaab440d1b6e75d89f0948083e275b2d7e7009ef
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2025-04-07 18:31:45 +02:00
Otto Ryynänen 0e92a8e068 Introduce threaded fetchmore example
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>
2025-04-04 19:31:49 +03:00
Fabian Kosmale 704ce91ebd VectorImage example: Fix qmllint warnings
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>
2025-03-17 13:08:13 +00:00
Dennis Oberst a2fef7d214 Examples: Add explicit 6.9 project setup for private library users
Looking up private libraries requires version 6.9 or higher.

Amends: f71e2f9955.

Pick-to: 6.9
Change-Id: I3a22893aef4dda6825955157667bec38f7b82b96
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2025-03-10 09:14:24 +01:00
Sami Shalayel 7af878f09f threadedanimation example: add missing DEPENDENCIES to QtQuick
Add a missing dependency to QtQuick so that qmlls stops complaining
about Spinner's base type QQuickItem.

Amends a86fd709dd.

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>
2025-03-03 08:16:59 +01:00
Lucie Gérard 361f1f38e0 Make module ready for source SBOM checking
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>
2025-02-21 20:24:43 +01:00
Alexandru Croitor 970912b809 CMake: Fix CMake Error: AUTOMOC for target neumorphicpanel_shared
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>
2025-02-18 14:00:32 +01:00
Safiyyah Moosa 407a76ed9a Doc: Clarify use of QQuickWindow::beforeRendering
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>
2025-02-02 22:46:14 +01:00
Joerg Bornemann f71e2f9955 CMake: Fix examples built as external projects
Usage of a private module needs a respective find_package call now.

Change-Id: I20f7571e11ab9b2ca6d185b4834e72100d9ce2d6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-01-31 17:11:34 +01:00
Alexei Cazacov 44beb8080c Docs: Update the published QML code to reflect current best practices
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>
2025-01-24 09:19:13 +02:00
Volker Hilsheimer 94109a8f95 Replace QImage::mirrored with QImage::flipped in rendercontrol example
Change-Id: I09e1ddc335ea77a6d15dcb160e58ab01919ceee1
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2024-12-02 17:24:22 +01:00
Shawn Rutledge 5e69fed692 Fix warnings in rendercontrol_rhi example
Task-number: QTBUG-130991
Pick-to: 6.8 6.8.1
Change-Id: Ie2afcc693ef13ab482229e77e62514183675e9e7
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2024-11-12 13:55:13 +01:00
Kaj Grönholm dfde7334b2 Add RectangularShadow element
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>
2024-11-09 16:41:37 +02:00
MohammadHossein Qanbari 6b75bc12b7 QML Previewer Example: add QQuickWidget
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>
2024-10-31 11:49:55 +01:00
Lucie Gérard 49eacf98d5 Add REUSE.toml files and missing licenses
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>
2024-10-29 14:00:19 +02:00
Ulf Hermann 40a96513ba Examples: Make qquickwidgetvswindow depend on QtQuick
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>
2024-10-24 14:19:24 +02:00
MohammadHossein Qanbari bd3ad6c71b QML Previewer Example: Prevent unnecessary state changes
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>
2024-10-09 16:23:15 +02:00
Shawn Rutledge 50313c6939 Improve the responsive layouts example
- 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>
2024-10-02 16:58:14 +02:00
Kai Köhne fd254513db Examples: Disable QtC junction points for examples using 'shared' directory
Task-number: QTBUG-128914
Pick-to: 6.8
Change-Id: If01f7e17c1f6c033e601e2e012745461c71f2e13
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2024-09-27 14:00:08 +02:00
MohammadHossein Qanbari 729c95fc8d QMLPreviewer Example: Fix compile error on Android
Fixes: QTBUG-129214
Pick-to: 6.8 6.8.0
Change-Id: I6f867244f8c21c911177e4b0adc5c7074951b470
Reviewed-by: Doris Verria <doris.verria@qt.io>
2024-09-24 02:13:24 +02:00
Doris Verria 790f16dd54 QMLPreviewer Example: More improvements
- 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>
2024-09-19 18:35:25 +02:00
MohammadHossein Qanbari fa878707fb QML Previewer Example: Fix saving the default file's changes
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>
2024-09-19 18:35:24 +02:00
Doris Verria 27357727c1 QMLPreviewer Example: Use window container instead of qquickwidget
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>
2024-09-19 16:35:24 +00:00
Eskil Abrahamsen Blomfeldt 252048b956 Example for VectorImage
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>
2024-09-11 15:11:31 +02:00
MohammadHossein Qanbari 130fac9911 QML Previewer Example: Fix bug when saving new file
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>
2024-09-03 23:23:06 +02:00
MohammadHossein Qanbari 8330154be6 QML Previewer Example: Add Error List and Line Numbers
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>
2024-09-02 22:46:58 +02:00
MohammadHossein Qanbari c156fc4527 Add the QMLPreviewer example
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>
2024-08-30 00:28:36 +02:00
Laszlo Agocs fb6ea5c013 twotextureproviders example: Remove out-of-date todo comment
Pick-to: 6.8
Change-Id: I795e63e8823b2c57cef87728373732d8969b1643
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2024-08-30 00:28:36 +02:00
Eskil Abrahamsen Blomfeldt 0b23a68fab Introduce example that shows advanced text features
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 <volker.hilsheimer@qt.io>
2024-08-29 01:35:26 +02:00
Eskil Abrahamsen Blomfeldt 4d1fe0d69c VectorImage: Allow root items to be path containers
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 <eirik.aavitsland@qt.io>
2024-08-28 06:07:24 +02:00
Eskil Abrahamsen Blomfeldt a784238e81 Update generated assets in weather forecast example
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 <eirik.aavitsland@qt.io>
2024-07-22 12:15:59 +02:00
Jan Arve Sæther ccf59c66d9 Add Expanding size policy to some controls and items
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 <santhosh.kumar.selvaraj@qt.io>
2024-07-17 15:21:35 +00:00
Eirik Aavitsland 0aabb7c369 Use best practices in the Quick Shapes example
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 <hatem.elkharashy@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2024-07-03 19:46:31 +02:00
Fabian Kosmale 2a32ec77c0 examples: Consistently require Qt 6.8
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 <ulf.hermann@qt.io>
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
2024-07-03 08:43:43 +02:00
Even Oscar Andersen 7796a5632e wasm: Move OpenGLUnderQml to VertexBufferObject to satisfy WebGL
To make the example work under webassembly also

Change-Id: I9eb7ab4503efcffa68d4de3008c8275f723ec659
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2024-06-11 12:04:07 +02:00
Eskil Abrahamsen Blomfeldt b70dc1196c Texture fill for shapes
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 <eirik.aavitsland@qt.io>
2024-05-27 17:36:45 +02:00
Laszlo Agocs 3d8c869768 graph example: Do not use GLSL functions as uniform names
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 <andy.nichols@qt.io>
2024-05-27 09:36:13 +02:00
Eirik Aavitsland 22272aefeb Add PathRectangle, a PathElement for optionally rounded rectangles
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 <eskil.abrahamsen-blomfeldt@qt.io>
2024-05-26 18:04:42 +02:00