Commit Graph

1011 Commits

Author SHA1 Message Date
Alexey Edelev 7d26fdbe1c Change the way tests and examples query the qmldir file from QML plugin targets
Use qt6_query_qml_module to get path to qmldir, but not TARGET_FILE_DIR.
This is more accurate way.

Pick-to: 6.5
Fixes: QTBUG-120479
Change-Id: I4b7f7bf3b7f69c15871e400af3e7ae945a9bfdf0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit d276d025a8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 5e60f6d141)
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2024-01-22 12:00:44 +01:00
Shawn Rutledge 4465415de1 Make PieMenu in pointer handlers example work with mouse right-click
It opens instantly with right-click; whereas it animates open with
a finger or stylus, to avoid accidental activation, as before.

Pick-to: 6.5
Change-Id: I6f530fb6da67c735fe3aae4545c8040f49e8dc05
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit 86081091f9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 08b00cf7e3)
2024-01-18 20:55:20 +00:00
Shawn Rutledge 08c01f6259 Avoid crashing in the quickwidgets example after closing the subwindow
Closing the window deletes m_quickWidget; so we disable the menu items
for grabbing from it, because those cannot work. Also add asserts.

Fixes: QTBUG-120296
Pick-to: 6.5 6.2 5.15
Change-Id: I68154c2d1e4553c771815e29cbe3b095d85893f1
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit f719ee6408)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit a49d309b4a)
2024-01-07 03:28:15 +00:00
Tor Arne Vestbø 589b79b31d examples: Increase hit area of LauncherList buttons; simplify
Pick-to: 6.5
Change-Id: Ife040f9c7e01fd8b8ce80595c2179d6b78648c6e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit f8ba365128)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit a2bfdb1f4d)
2023-12-14 04:48:21 +00:00
Kai Köhne 4b622186c9 Doc: Move Flipable, Dial Control example to UI Components category
Arguably fits better than Graphics & Multimedia.

Change-Id: I2604d5f43621a73ad28d01532e6ad8ec121a2e29
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit f3f3de6c38)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 231ef00306)
2023-12-12 02:33:13 +00:00
Andreas Eliasson 7b9ba787ed Doc: Add CMake section to Scene Graph example
The current page only mentions qmake. Let's add a CMake section.
Also, make minor grammatical fixes.

Fixes: QTBUG-118802
Pick-to: 6.5
Change-Id: I311084c72f609a72ef5716964cd6c7c28fa64208
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
(cherry picked from commit 39793d56e0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-01 12:06:33 +00:00
Tor Arne Vestbø 80ccfb0345 Fix embeddedinwidgets resource prefix in qmake project
Pick-to: 6.5
Change-Id: I151cb5dce9dfbed9914bce09397a21cd704ffe0c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 4f4a915ded)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-11-25 01:54:26 +00:00
Laszlo Agocs ae2df32f79 Fix corrupt rendering when toggling rendernode-based items
Meaning the toggling of visibility. Having a QSGRenderNode come and
go in the scenegraph leads to visual problems, in case the adding
and removal of the node toggles the m_forceNoUseDepthBuffer flag,
which in turn makes useDepthBuffer() return a different value
than before (so disables and then enables doing the opaque
pass in the renderer). Changing this value needs a full rebuild
of the render lists. When adding a node, this is done (regardless
of toggling the flag). When removing, it was not done at all.
Now we do it when resetting the no-Z flag back to false.

Add a button to the customrendernode example to toggle visibility
since this is useful for example's purposes anyways. However, this
on its own is not sufficient to reproduce the issue. For that,
the DepthAwareRendering flag needs to be removed from the
QSGRenderNode subclass.

Pick-to: 6.5
Fixes: QTBUG-119160
Change-Id: I232354d88f5a4fe5f9f2d6102d0d5439d92782fb
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit d70b847f77)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-11-24 22:33:56 +00:00
Shawn Rutledge 29fc139acc Disable TapHandler.longPressed signal if longPressThreshold == 0
There needs to be a way to disable the long-press feature, because it's
exclusive: if we emit longPressed(), we do not emit tapped(). But we
should also be able to accommodate slow users who pause for too long
unintentionally, or while simply observing the behavior.

Also clarify that resetting longPressThreshold reverts to the default.
Add more exhaustive test coverage, verify that longPressed
and tapped are mutually exclusive, and verify the effects of
violating the gesturePolicy.

Change longPressThreshold on LauncherList's back button so that it
always triggers, regardless whether the user pauses on it for a while.

[ChangeLog][QtQuick][Event Handlers] TapHandler.longPressThreshold
can now be set to 0 to disable its press-and-hold feature, and can be
reset to undefined to restore the platform default.

Fixes: QTBUG-119132
Task-number: QTBUG-105810
Pick-to: 6.5
Change-Id: Id5fd7e51c70fdb0cb6c4beb5615717a222aec871
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 8f6809681e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-11-18 00:25:53 +00:00
Shawn Rutledge 6e3c25f944 Make TapHandler longPressed/tapped exclusive and reliable; fix example
The back button in the examples' LauncherList.qml has been flaky.
As described in the docs, a TapHandler used to implement a Button
should have `gesturePolicy: TapHandler.ReleaseWithinBounds` to get
the common behavior that you can drag out of the button to cancel
the click, and you can also drag back into the button to change your
mind and let it click after all. But when trying to test this behavior,
another problem became evident: if you spend a longer time than
longPressThreshold for the whole gesture, then at the time of release
you could see the debug output "long press threshold exceeded" and the
tapped signal was not emitted. Our intention was that if you are
dragging around, the TapHandler is not eligible to emit the longPressed
signal; it follows that it should not become ineligible to emit tapped,
either (tapped can be emitted if other constraints are satisfied).
The intention of the ReleaseWithinBounds policy is that it doesn't
matter how much you drag, as long as the point is within the bounds
of the parent at the time of release.

So we begin keeping track of whether we have actually emitted the
longPressed signal, rather than merely looking at the time difference.

This changed behavior in tst_qquickdeliveryagent::passiveGrabberOrder:
1 second is more than enough time for long press with the default
longPressThreshold, and now the tapped signals are no longer emitted
after longPressed. So we just wait for pressed state rather than
waiting so long. qWaits in tests are best avoided anyway (although
I think the intention in 152e12dc22
might have been to wait long enough to ensure that nothing undesired
would occur, rather than waiting for something specific to occur).

Task-number: QTBUG-65012
Task-number: QTBUG-105810
Pick-to: 6.5
Change-Id: If6a86d955e19810cb06de659f5e39b50a72fa762
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 1b166c87d0)
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-11-17 17:25:53 -07:00
Eskil Abrahamsen Blomfeldt 960d6b5da1 Add license headers to shader source
Pick-to: 6.5 6.2 5.15
Change-Id: I007eaddf0a3a9e7e6242d4e02b487fa0806c96a7
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 85e65e101b)
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2023-11-02 16:55:41 +01:00
Paul Olav Tvete 8c5682fd59 Add zooming to the shapes example
Change-Id: If10ffe77b5e61f605f9f735c51f639c422844b2d
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit c1a0cb5a3a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-10-03 16:31:28 +00:00
Shawn Rutledge f3b39f0cc8 Rename shapes example qml files according to what they demonstrate
Amends 270a6f9bba

Fixes: QTBUG-115485
Pick-to: 6.6.0 6.5 6.2
Change-Id: Id77b4dd8ce83175ebe29d24bf987572d5e9069d7
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit 251fdf01a6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-09-28 05:15:39 +00:00
Jaishree Vyas e54acce9f3 Doc: Add example categories for qtquick
Task-number: QTBUG-116334
Pick-to: 6.5
Change-Id: I993b6157c3ef8a69e4e218d62596b5219ab4b34b
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 46fc095ae4)
2023-09-27 10:50:42 +02:00
Laszlo Agocs 5c46a280fb Clean up customrendernode example
Make it more consistent with other scenegraph examples, and make it
more compact, in particular when it comes to handling the QRhi
resources (smart pointers are quite useful in this case since they
help dropping a bunch of lines)

Expand the docs.

Pick-to: 6.6.0
Change-Id: I97bceca7759db9738d34f0fbf7eb29b0ae6e4c0f
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
(cherry picked from commit aeb3bd235a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-09-25 14:22:33 +00:00
Kaj Grönholm e497ff1437 Small improvements into Graph example
Use FrameAnimation instead of Timer and double the amount of samples
to make the example smoother.

Change-Id: I6f5bb1414fd7532e16aeb25f886879828ce29854
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
(cherry picked from commit 75a33aceab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-09-18 03:20:04 +00:00
Rami Potinkara 60e10a161b Update mobile example categories for Qt 6.6
Add mobile example category tags for the chosen examples.
Add for the ones that work best for both Android and iOS.
Remove from the ones that do not work for both (at least yet).

Added, as verified on Android
-scenegraph openglunderqml
-qtquickcontrols-contactlist
-qtquickcontrols-gallery
-qtquickcontrols-wearable

Removed (for now), as not verified yet on Android
-qtquickcontrols-todolist

Fixes: QTBUG-116780
Change-Id: I7f22329ec93dedaa63df34bb55dd67d14ffe5c1d
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 628659f759)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-09-11 23:36:11 +00:00
Oliver Eftevaag 0cea930c82 convert threading example to manual tests
The threading example used a LauncherList to combine
two different but related examples into one.

I've now separated both into a shared directory called
'threading'

Change-Id: Iee8898e61adcf69dc67157a1eff5f6ac019a39ca
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 38373b81f3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-09-08 20:30:52 +00:00
Inkamari Harjula d98d50f6ef Doc: Add example category to all the files that haven't yet got it
Added example category and also fixed one copy-paste mistake in Vulkan Texture Import.

Task-number: QTBUG-116205
Change-Id: I96692f214849596e9555c635d9996d9b884c5cab
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit e421c21c3b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-09-06 11:23:13 +00:00
Jaishree Vyas f02735d451 Doc: Add example categories for qtquick
Task-number: QTBUG-116334
Change-Id: Id17a546b9363e5225b8778c629fe9ffe30d2e719
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit b16bea02f6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-09-05 17:03:26 +00:00
Laszlo Agocs 9c71699666 Fix QQuickWidget rendering API mapping for D3D12
Right now requesting d3d12 via QSG_RHI_BACKEND or the C++
API maps to the Null backend of QRhi. That is not ideal.

QRhiWidget has this logic, but the already existing
QQuickWidget was not yet adjusted in 6.6 it seems.

Change-Id: I12301e815d525c14584b01dcd0caa787d1c79ad0
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 76ae3dd783)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-09-04 19:25:29 +00:00
Kaj Grönholm aca17e6775 Add CurveRenderer item into shape antialiasing example
CurveRenderer has built-in antialiasing supports, so compare it here to
MSAA and SSAA.

Task-number: QTBUG-104122
Change-Id: I207ab770cae052b195e9da8802dc594a91ce713b
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit eb6af63f61)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-08-23 14:43:31 +00:00
Inkamari Harjula d3b06d27c8 Doc: Add example categories to Particles examples
Add the example categories of Particles examples.

Task-number: QTBUG-116265
Change-Id: Ie773c51c8a862c3cba74b22a68078d68eb14b42d
Reviewed-by: Mats Honkamaa <mats.honkamaa@qt.io>
(cherry picked from commit 0ebd825d10)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-08-23 07:25:15 +00:00
Paul Wicking 7f22f9de5f Doc: Use sensible argument in `\printto` command
The "Scene Graph - Vulkan Under QML" example includes snippets of code
from the example source file(s) using a combination of the `\skipto` and
`\printto` QDoc commands. The former skips content until the line that
contains the argument passed to the command
(here, "class VulkanSquircle"). The latter prints lines up to, but not
including, the line that contains the argument passed to the command
(here, "public"). I suspect the author's intention was for QDoc to
output lines from the start of the class declaration until the public
access specifier in the member specification of the class. However, the
first instance of `public` QDoc encounters is the base-specifier of the
derived class, which is on the same line as the argument to the
`\skipto` command. Hence, there's nothing for QDoc to output.

Modifying the argument to include the colon that indicates the keyword
is for member-declarations ensures QDoc generates output as expected.

Fixes: QTBUG-116304
Change-Id: Ibfc17fbacd10f902fc2a5f57873fe0990571535e
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
(cherry picked from commit 9e3b681460)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-08-22 14:33:57 +00:00
Laszlo Agocs 3a5c545dad Remove unused forward decl in rhitextureitem example
Change-Id: I1a472445bf2f88213536b3973349ebd7a34f93de
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit b0b940e472)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-07-28 13:55:07 +00:00
Laszlo Agocs b37e8a560d Remove unused line in rhitextureitem example
Change-Id: Ie1ab98d7d2997e12e1a92d61e19f543fc9accd86
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 17e6ebc039)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-07-28 13:54:59 +00:00
Kai Köhne 40c72bb801 Doc: Update example category names
Change-Id: Iadd29b0497ad264de46ddaf78546685f58abe6e6
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 4de224d015)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-07-11 18:12:27 +00:00
Oliver Eftevaag 60d2ffac34 Merge externaldraganddrop example into the draganddrop example
We have two examples that are both showcasing different drag and drop
features.

Might as well only have one.

Change-Id: I9d984f723f42aaf39c5632e58fc376ad0df18acb
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 38d6028ad1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-07-04 07:42:58 +00:00
Oliver Eftevaag 0c97e56cff move righttoleft example to manual test, and revamp it
The patch makes the following changes to the example:
- It fixes all qmllint warnings.
- It translates all user-facing strings.
- It reorders some properties.
- It removes the Loaders in layoutdirection.qml
- It also does some other things,
  like removing unused lines of code, etc.

Change-Id: I798db60a2bf2d87c64b68947588585d10ba4015d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit dba7d84843)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-07-03 11:58:23 +00:00
Shawn Rutledge 9f50beeb9b Move touchinteraction examples to pointerhandlers and manual test
These are getting long in the tooth, but multiflame and corkboards seem
worthwhile to update to use Pointer Handlers (as we could have done
sometime during the last 5 years or so).

The qrc prefix seems to have changed: let's get the qmake build
working again.

The multiflame example is mostly rewritten:
- all in one file, which can run standalone
- only one ParticleSystem instance (which hopefully is more efficient)
- using an inline component
- less boilerplate per component instance (only one property for
  ColoredEmitter, which is both its color and its group name)
- less-extreme, more fire-like colors

The version of corkboards in Qt Quick 3D was already updated (and then
removed for unrelated reasons); now we have the fixes from
0227fcdf3ea82efee3005d99fd1019410a7f5789

BearWhack has nice graphics, but doesn't seem like a very nice use of
multi-touch, so it's demoted to the touch manual test for now.
The simple Flickable use cases seem underwhelming nowadays too, and
we have snippets as simple as those.

Replace mentions of touchinteraction for testing with pointerhandlers.

Change-Id: I4667e13e961ca6f84d3336505b3c673790babfa5
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 1fc968c513)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-07-03 07:38:31 +00:00
Shawn Rutledge 979bb93603 doc: Rename to Qt Quick Examples - Pointer Handlers
This seems to be still a consistent naming convention for example docs.

Change-Id: I508526ec992222da1c971bc327dd9c83a21640aa
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit 794b6a6ab7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-07-03 07:38:25 +00:00
Oliver Eftevaag f6e1e53c0b Make views example more in line with our guidelines
The views example is an old example, which shows off many different
features related to ListView, GridView and the QML models.

Unfortunately, there are currently a few things that are broken in it.
One of those things is the FlickrRssModel, which no longer works,
because flickr changed their web API.

This patch makes some improvements, but it's unfortunately not fixing
everything.
The list of fixes are the following:
- Fix a good number of qmllint warnings. Unfortunately, there seems to
  be a good number of false positives that remain unfixed.
- Use qsTr() in some places. But I've not adopted it everywhere.
- sections.qml now uses Qt Quick Controls CheckBox'es instead of a
  custom component.
- Property bindings are now declared on separate lines.

Change-Id: Idfb563f4bd658dc70c1b9975549e872e7c25449e
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit c4d520c200)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-30 11:03:31 +00:00
Oliver Eftevaag 469b786fc8 revamp animation example according to guidelines
The following changes are applied to the example:
- All qmllint warnings are fixed.
- Tv tennis part of the example is now actually working.
- Use let/const instead of var in JS.
- Use qsTr() in a few places.
- Use strict equality operator, when it's wise to do so.

Change-Id: If0222feb942abfd0a6c9f8a8cab0ac60ced3d76e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 838472592b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-28 19:29:26 +00:00
Kai Köhne 35a7811f9a Examples: Fix license to Commercial or BSD-3-Clause
Change-Id: Ieb1db96846e02c3b93888ed409af82bfb3567c19
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 8f1e6aa0ed)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-26 16:53:30 +00:00
Kai Köhne 9d33c181c0 Examples: Fix license of BlurHelper.qml
Change-Id: I048d287487b87e0ef7c6ba448b69312859e155ad
Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io>
(cherry picked from commit a2541c3098)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-26 14:23:30 +00:00
Dimitrios Apostolou c873aa25ac Fix examples writing resource files to the wrong directory
When configuring the qt5 supermodule with -make examples, the
directories

  examples/quick/imageresponseprovider/ImageResponseProviderCore/
  examples/quick/imageprovider/ImageProviderCore/

were being created under the qt5 parent dir, instead of inside the
qtdeclarative subdirectory.

Fixes: QTBUG-113495
Change-Id: I78a3fe6e1cab97b6e7be7900d2ecb66175a68065
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit c91b718637)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-23 18:22:04 +00:00
Shawn Rutledge 37b75cdff5 Move textselection example to manual test
Apparently it's always been incomplete, a relic from Nokia: there's no
means of entering the "menu" state, and nothing to detect a long-press
as the text says you can do.

On mobile platforms, the platform input method provides selection
handles; on embedded platforms, Qt Virtual Keyboard does it. So this is
generally unnecessary, but perhaps it could be revamped into a
demonstration of an alternative way to add text-selection handles.

Change-Id: I231db14e5fbb4e82e8d732153e3d3843a080b409
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit 810a329983)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-14 01:28:58 +00:00
Matthias Rauter 5f44266771 Remove superfluous project file from example
Change-Id: I7599b18b29266c2b2d41437746bb2923588384d0
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit 9136e5748b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-08 17:33:48 +00:00
Jan Arve Sæther 90a5e8d217 Introduction of LayoutItemProxy
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>
2023-06-02 14:39:23 +02:00
Laszlo Agocs 040189e8e2 rhi examples: expand docs
Change-Id: I88991ffe3612b76aaa687f86acd59e24c5543a76
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-06-01 19:22:29 +02:00
Laszlo Agocs b62efbe1af Add the rhitextureitem example
fboitem, the OpenGL-based QQuickFramebufferObject example is now gone,
replaced by the rhitextureitem example.

It is now possible to implement a custom QQuickItem that renders into a
QRhiTexture and then draws a triangle/strip geometry textured with that
texture using just public Qt Quick APIs and the semi-public QRhi APIs.

There should be conveniences provided for this in future Qt versions,
but for the time being we provide an example how applications can do
this in Qt 6.6 already. This complements the rhiunderqml example which
shows the underlay/overlay approach, and the customrendernode example
that shows the "inline" approach with a custom QSGRenderNode. The
rhitextureitem example added here shows the third, "offscreen" approach
that goes through a texture.

The example docs are better than before but not yet complete.
To be extended separately.

Task-number: QTBUG-113331
Change-Id: I83000c08b057dd72371e2909905120dc496cb34d
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-06-01 11:27:56 +02:00
Laszlo Agocs 6bdc58c2db rhiunderqml example doc: Fix a link and improve a note
Change-Id: I663db98e275ea1cbc49b1314e4b18892e5c8c00f
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-06-01 11:27:48 +02:00
Laszlo Agocs f48b12c185 Remove legacy env.var in QQuickWidget comparison example
Seems to work regardless.

Pick-to: 6.5
Change-Id: Ic7c58372181009214590e9152a4919234f8e4aaa
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-05-31 22:33:35 +02:00
Eskil Abrahamsen Blomfeldt be813b9955 Introduce hardware accelerated curve renderer for Shapes
This implements the Loop/Blinn algorithm for quadratic curves
as an optional backend for Qt Quick Shapes, basically distance
fields where the distance to curves are calculated in the
fragment shader.

This means cubic curves are approximated, which will give
varying results, but for many shapes (such as text) this is
efficient and means the shapes can be zoomed indefinitely
while still retaining curvature as well as anti-aliasing
working without MSAA.

Preliminary results give some frame rate improvements
compared to doing MSAA and GeometryRenderer, but the major
improvement is that you can get smooth curves at any zoom
level without re-triangulating the shape.

Note that the renderer currently does not do antialiasing
for straight lines. This would still require MSAA, but at
a lower cost than for GeometryRenderer since there are
much fewer triangles. Adding AA here as well is work in
progress.

Task-number: QTBUG-104122
Done-with: Paul Olav Tvete <paul.tvete@qt.io>
Done-with: Eirik Aavitsland <eirik.aavitsland@qt.io>
Done-with: Amr Elsayed <amr.elsayed@qt.io>
Change-Id: I6b4a1103546fbdfe760906f7a183101f8eedb9d3
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2023-05-26 14:45:21 +02:00
Oliver Eftevaag 064aa8127c customitems examples: adhere to guidelines
They were in a pretty good state already.
This patch simply makes some minor tweaks,
based on our own guidelines for examples.

The tweaks include, but are not limited to:
- PRIVATE linkage
- WIN32 and MACOSX_BUNDLE in qt_add_executable()
- Remove unused #include
- Use qsTr()
- Remove warnings.

Pick-to: 6.5
Change-Id: Ie4d50d4e2134b7b373bdf1ba38779d3052165286
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2023-05-26 10:03:00 +02:00
Oliver Eftevaag 1559e6707e layouts example: qmllint fix and use qsTr()
Pick-to: 6.5
Change-Id: I1ce7b0753fc404e340328fe1ff472091ececb26c
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2023-05-23 10:59:52 +02:00
Laszlo Agocs ad105709e9 Add rhiunderqml example
And fix up the scenegraph example list on the Qt Quick example page.

Task-number: QTBUG-113331
Change-Id: Ic7b97871253d16b778f7da6088f4a9130bef2ec5
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-05-22 21:33:36 +02:00
Laszlo Agocs ace43e1db1 Adapt to the RHI API concept
Besides following the header naming changes, make the obvious API
changes that are based on data that is already there but was hidden
previously due to not wanting anything QRhi to shine through in the
public API.

This kind of hiding is no longer needed, even if qrhi.h and similar
still cannot be included from a public header. Forward declarations
are now perfectly fine however.

Task-number: QTBUG-113331
Change-Id: I9a114082cf9218edc487df50956f5793d6b8bdb4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-05-22 12:08:08 +02:00
Shawn Rutledge e0947fa3e7 Make a few improvements to the Window example
- Splash assumes less, for better reuse: set visible where used,
  start Timer only when visible
- no need for SystemPalette: Window and Item have palette properties
- get rid of MouseAreas
- click to set a random color
- make buttons square with Unicode "icons"
- fullscreen button has Binding on checked, to be checked regardless how
  visibility is changed; onClicked is smaller
- tooltips

Pick-to: 6.5
Change-Id: Ibbc1be2a3b113e68f61c69ef695ceea8c300fd1e
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2023-05-18 15:59:42 +02:00
Amir Masoud Abdol d6c16ee66a Improve qmlimageproviderplugin's CMakeLists.txt
There is no executable, so setting `WIN32_EXECUTABLE` or `MACOSX_BUNDLE`
is not necessary. I also moved the source file under
`qt6_add_qml_module`.

I feel this example is not complete, or need some more updates.

Pick-to: 6.5
Change-Id: Ic79690e241a8a8a98d35c96e1aa57dddcbc29153
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-05-16 16:08:11 +02:00