Commit Graph

1004 Commits

Author SHA1 Message Date
Eskil Abrahamsen Blomfeldt 1ee5fed75f Introduce PathText path element
For text rendering in Qt Quick, we currently have the limitation
that when rendering text at such a large size that the distance
fields start showing artifacts, the only option is to use
NativeRendering, which will look nice, but which will use a lot
of texture memory for the glyph cache, since it will actually
cache the glyphs at the requested size.

A suggested approach would be to fall back to using triangulated
paths when the font gets large enough, but the work on this was
never completed.

It turns out that we can get this now, basically for free, since
we already support rendering arbitrary QPainterPaths using
Qt Quick Shapes. The only thing missing is the ability to add
the path of a given text to the shape. This patch fills in that
gap.

Note that this is currently not supported by nvidia renderer.

[ChangeLog][QtQuick] Added PathText path element which can be
used together with Qt Quick Shapes to get text rendering that
does not cache glyphs in a texture, but triangulates the
outlines of the glyphs instead.

Change-Id: I436e1476b129b324cf7a54f89a1b18e0579e8185
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-01-21 11:48:54 +01:00
Laszlo Agocs fd272b60c3 Upgrade qsb files to version 4
Change-Id: Ic1a1f5ff49c34d72495bc74083f37db118c935c1
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-01-21 10:41:32 +01:00
Ulf Hermann da4cdfec98 examples: Make qmlextensionplugins example usable without installation
The qmldir file as well as the .qml files have to be placed next to the
plugin, the import path has to be added to the .qmlproject, we want the
.qmltypes file added to the same place, and the plugins.qml should also
be available in the destination directory.

Change-Id: I82b369693e612779c6213345cc8f6a30b16d41b4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-14 09:44:15 +01:00
Ulf Hermann 2c3419e127 Generate registrations for all examples
Now that we can generate all QML type information at build time, we
should also use it.

Change-Id: I647c72bbe38fdb2deb565b75c86a696af3d15b61
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-13 16:47:57 +01:00
Fabian Kosmale 4eff729950 Binding example: Fix type registration
Fixes: QTBUG-81335
Change-Id: Ie93c9b7ad49703bce245592e659ccdb6ea2b7ed9
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-01-13 13:27:36 +01:00
Ulf Hermann 8550dff55c Make draganddrop example less confusing
Use required properties, rather than context, use direct binding rather
than Binding elements, clarify that we're using the drag passed as
parameter, not the drag property of DropArea, move Icon to a different
file so that we get a distinct type for it. Give the icon a defined
color while it is being dragged.

Change-Id: I0e8b77abaedb9fc52660dfd4ddef1a4161f1323a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-01-10 12:04:33 +01:00
Paul Olav Tvete a7325668a2 Minimal documentation for new example
Task-number: QTBUG-80500
Change-Id: Ifdd13bc404dd3ee34d14b339e24a72d647b6796f
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-12-12 13:51:16 +01:00
Paul Olav Tvete f2a727eb84 Add vulkantextureimport example
This is essentially the rendering code from vulkanunderqml put
into the structure of metaltextureimport with some added memory
barriers.

Task-number: QTBUG-80500
Change-Id: If38301c039b38e3798ff482625daa5f63e8d6fb2
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-12-12 13:51:07 +01:00
Maximilian Goldstein 265a6dc6e2 examples/quick/shared/FlickrRssModel.qml: Do proper error handling
Change-Id: Ieaed0706965bbb259934fb83151856f3d5805331
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-11-29 10:34:51 +01:00
Maximilian Goldstein c2f6a4cf63 examples/touchinteraction/multipointtouch: Fix broken score display
Fixes the broken score display in "Bearwhack".

Change-Id: I43581947f71e4c6dd3cca43068f6d220a058cc46
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-11-29 10:34:41 +01:00
Maximilian Goldstein 6efdefda28 examples/quick/views/pathview: utilize required properties
Change-Id: I07c5068de9330236b2e593d9995fdfda3e019006
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-11-29 10:34:27 +01:00
Maximilian Goldstein c8b7318299 examples/quick/localstorage: Fix some linter warnings
Also fixes MouseArea using anchors within a Layout and relying on
properties that might be null.

Change-Id: I9078ded60870019c8ac9f8ff5d52d9924b51c49c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-11-28 14:07:10 +01:00
Maximilian Goldstein a6fe62fcb4 examples/quick/animation/layouts: Avoid unqualified access
Change-Id: I75f67b54d75840c215c2dfe592ff95c5cb962ff2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-11-28 13:43:27 +01:00
Maximilian Goldstein 22a0bf15c6 examples/quick/animation/easing: Fix some linter warnings
Now explicitly importing QtQml and QtQml.Models.
The example also utilizes required properties now.

Change-Id: I819b03c0a0dc892683e680fee47a632f1e5b543a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-11-28 12:43:01 +00:00
Laszlo Agocs df0cb0edac Fix Metal usage on iOS
Also enable the two Metal-specific scenegraph examples on iOS.

Change-Id: I0e1e6d527544ea4a5bfb0d08ca2d32c762d3c699
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-11-27 21:50:52 +01:00
Friedemann Kleint c0a8c84eb4 Avoid initializing QFlags with 0 or nullptr in further cases
Amends 744e77b841.

Change-Id: I16e37aaf503eb62f67fca0e48be4c92c4a72ae46
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-11-25 13:35:32 +01:00
Liang Qi aa3813366a Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/qml/qml/qqmlextensionplugin.cpp
	tests/auto/quick/qquicktableview/tst_qquicktableview.cpp

Change-Id: Ic58d36a8532015bae30f2690063db9829b3bf372
2019-11-22 09:50:11 +01:00
Ulf Hermann 74377894ec examples: Drop bogus reference
Canvas doesn't have an "alpha" property.

Change-Id: I7cedff568ec062d7586b6b7333e32a8e52d2e8a9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2019-11-18 15:31:31 +01:00
Ulf Hermann 61d7713ead examples: Add type safety to animation/behaviors example
As SideRect wants to access focusItem's "text" property, we should
expose the fact that it exists. Therefore, move focusRect into a
separate file  that declares the property and reference that.

Change-Id: Id9b1d1e7868ee5abb9de124bab8fad45ee1449a9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-15 16:14:32 +01:00
Ulf Hermann e2d3005164 Remove binding to nirvana in accessibility example
parent.description doesn't exist, and the text is always overwritten via
the alias anyway.

Change-Id: If80c4b9b1afaaa488b8ac5c6917b413a462476ef
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-15 16:14:28 +01:00
Ulf Hermann c67b2dacb8 examples: Fix SimpleLauncherDelegate.qml
Since the button is a simple Item, and the MouseArea is gone, the
"pressed" property we're interested in is actually the TapHandler's
"pressed".

Change-Id: Idc7262325c9e2db761041b1ae1151e62702e3eb8
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-11-15 11:58:45 +01:00
Laszlo Agocs b6b1d58994 Make QQuickFbo work with the OpenGL backend of QRhi
So no matter if Quick goes directly to OpenGL, or via QRhi,
QQuickFramebufferObject will still work.

Also fix up the fboitem example to use a ShaderEffect that works with
both rendering paths.

With graphics APIs other than OpenGL the item will be empty, as QQuickFbo
is not something we can support there.

Task-number: QTBUG-79222
Change-Id: I52177d3a75f619f7075a2fc829573c17031eded1
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-11-14 15:33:37 +01:00
Ulf Hermann 0a649f2581 Fix xmlhttprequest example
The "pressed" property belongs to mouseArea, not button.

Change-Id: Ib35c520b75e30c2cb9a3a7dee0b482a2209040c8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-14 10:09:36 +01:00
Lorn Potter 06267f90a2 fix rendernode example build
When not building developer mode, the install does not copy the files
on other platforms

Fixes: QTBUG-79781
Change-Id: Ibc8352c59d16b69618d53750511d5b5650ed5290
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-11-12 09:23:24 +10:00
Topi Reinio 13d7517c0e Doc: Fix documentation warnings
There were a lot of documentation warnings introduced by the
separation of QtQml.Models and QtQml.WorkerScript modules
from the QtQml documentation project into their own
sub-projects.

Fix the above, and also ensure that the experimental
Qt.labs.qmlmodels QML types are listed in the documentation,
and add them also on the QML module page for QtQml.Models.

A few warnings remain, they may be indicative of issues
not in the scope of this commit.

Fixes: QTBUG-79812
Change-Id: Idc25c976e4c96feab4aae893519d6c9245f57a64
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-11-11 09:53:52 +00:00
Timur Kristóf b25c27d37a Add API to get more information for each line in a QML Text element
Previously there was no way to know what area is occupied by each line
in a QML Text element.

This commit adds new API to expose implicitWidth and isLast
on QQuickTextLine for use in the lineLaidOut signal.
It also adds improved documentation to the lineLaidOut signal and
an example usage of the new API to the text layout example.

An example use case of the new API is eg. to allow embedding
timestamps and indicators within a text paragraph, to enable
creating more efficient layouts.

[ChangeLog][QtQuick][Text] Added new API that exposes implicitWidth,
and isLast on the QQuickTextLine for use in the lineLaidOut signal.
This allows the user to layout other items relative to the lines
of text.

Fixes: QTBUG-78277
Change-Id: Ibc754db17c78efb01468106aba32e30d70d2f4df
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-11-04 09:39:10 +02:00
Qt Forward Merge Bot 67481cae7e Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I6e69a235f50472b8f7ac19e133a3c071ea8c4d7a
2019-10-16 01:01:37 +02:00
Qt Forward Merge Bot b08809b521 Merge remote-tracking branch 'origin/5.13' into 5.14
Change-Id: I7759f6b60f8fda6525b239c7ee2e034194d4ab85
2019-10-15 01:00:06 +02:00
Laszlo Agocs 5fcd32c864 Make twotextureproviders work on the rhi rendering path
Involves porting away from the ill-fated QSGSimpleMaterial.

This marks the first appearance of QSGMaterialRhiShader in any
of the examples.

Task-number: QTBUG-79086
Change-Id: I464e2bd06a6b5b19775b1b35265bb843979ec4b4
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-14 13:56:31 +02:00
Nico Vertriest 1b44ba258a Doc: Add "Using" to other sections for consistency
Task-number: QTBUG-79061
Change-Id: I5d359d9a8ba48131a3aec5487604e30d3b0370ed
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-10-11 06:52:33 +00:00
Qt Forward Merge Bot 66db74e53e Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I1359574c7d89aaf3328958e2f667ba1e599ff7f1
2019-10-11 01:00:19 +02:00
Liang Qi 45f95e7429 Merge "Merge remote-tracking branch 'origin/5.13' into 5.14" 2019-10-10 16:18:19 +02:00
Liang Qi aa057451b3 Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	src/plugins/scenegraph/openvg/qsgopenvgcontext.cpp
	tests/auto/quick/qquickpathview/tst_qquickpathview.cpp

Change-Id: I117c8d62b21800329d1035021d312d9924f83a1b
2019-10-10 13:59:00 +02:00
Nico Vertriest caa4174e65 Doc: Rename section ObjectModel in Qt Quick Views example
- a section should not have the name of a QML type
- caused links to ObjectModel to refer to the wrong page

Task-number: QTBUG-79061
Change-Id: I92bbd00e02252d3eca2ad50deca7d573f53f549a
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-10-10 09:16:41 +00:00
Laszlo Agocs af623414ec Add guards in .pro of platform/api-specific scenegraph examples
Task-number: QTBUG-78783
Change-Id: Icda60d4358c35de311552fd7562c3cf0c3425b7b
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-10 09:54:22 +02:00
Qt Forward Merge Bot 1bddf29287 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I2835748c27616103f275849141fbe5a93e3dfd8c
2019-10-10 01:00:21 +02:00
Laszlo Agocs 2b845c9175 Make rendernode example compile on iOS
Without Metal support for now.

The ifdef pattern is the same as in QRhi in qtbase. It is to be revised
once Metal support is introduced for iOS.

Task-number: QTBUG-78854
Change-Id: I10f37ddcb42c27958270bd3ca8bf9b8457a4bea3
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-09 11:44:49 +02:00
Qt Forward Merge Bot 9c7121df15 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/imports/qtquick2/plugins.qmltypes
	src/quick/items/qquickitemsmodule.cpp

Change-Id: I841c65c9c131354788b4f3fcfe3d7ed27be316d5
2019-10-04 11:29:16 +02:00
Ulf Hermann 291d118b0f Examples: Avoid Qt.createQmlObject()
We don't want to encourage Qt.createQmlObject(). It's the equivalent of
eval() in JavaScript.

This has the added benefit that the shapes actually react to changes in
the parameters now. Before, once a shape was drawn, it didn't get
updated when you manipulated the line width or fill controls.

Change-Id: I8d5b7598799b52043f86fd1f617e31de09331891
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2019-10-02 11:20:05 +02:00
Nico Vertriest 0ca9f69389 Doc: Correct link error Package type
Task-number: QTBUG-78803
Change-Id: Ideff1b3974dcb9ef833e5847e5a2df344105f241
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-10-01 12:46:27 +02:00
Ulf Hermann cc1a604c70 Specify parameters of type registration in class declarations
Using this technique we can automatically register all necessary
revisions and minor versions of a type, using the metaobject system.
This greatly reduces the potential for mistakes and resulting
incompatibilities between versions of imports.

We assume that for each type we need to register all revisions of its
super types and its attached type, and that the revisions match. That
is, if you import version X of type A, you will also get version X of
its attached type and of any super types. As we previously didn't take
these dependencies into account when manually registering the types, a
number of extra revisions are now registered for some types.

Potentially, we can now generate the qmltypes files at compile time,
using moc.

Change-Id: I7abb8a5c39f5e63ad1a0cb41a783f2c91909491b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-09-26 12:32:17 +02:00
Laszlo Agocs 89d654fcd4 Clean up GraphicsStateInfo after API review
Change-Id: I715ad71153151a0e6521bc182227d9fa2dc0a3ea
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-09-18 02:27:10 +00:00
Laszlo Agocs d0d2e7da01 Rename textureinsgnode example to a more fitting name
It shows QQuickFramebufferObject. "Texture in QSGNode" is ambiguous
as it suggests another type of use case (where an existing texture is
imported and used with the QQ scene - without rendering to it). This
would conflict with upcoming future examples, so rename to fboitem, which
is what this example is about.

The link from examples.qdoc is already using the fitting title so that will
just work.

Change-Id: Ide7a563398a4b464c55f14e10fa9386432b3d06d
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-09-12 10:24:22 +02:00
Liang Qi c80eb38354 Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	src/qml/jsruntime/qv4engine.cpp
	src/quick/handlers/qquicktaphandler.cpp
	src/quick/items/qquicktableview.cpp

Done-With: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Done-With: Ulf Hermann <ulf.hermann@qt.io>
Done-With: Shawn Rutledge <shawn.rutledge@qt.io>
Change-Id: If9558a33f01693ce96420c094e0b57dfff0626cd
2019-09-12 08:01:21 +02:00
Laszlo Agocs d38bac5969 Fix gcc warnings in vulkanunderqml example
Change-Id: Iea81662f39d2a128cea0e83a766395e0fb1e9896
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-09-11 15:10:25 +02:00
Qt Forward Merge Bot bea81b724b Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Ic70e93d08aa91c00c9dec4e4557b871d3e8a2cae
2019-09-11 01:01:05 +02:00
Laszlo Agocs ba3e72ab7e Clarify docs and comments regarding under and overlays
Change-Id: I8973798996b6c775f425819af1d6a09f1773a9dc
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-09-08 09:42:11 +02:00
Laszlo Agocs 1a5c6544c8 Add metaltextureimport example
Change-Id: I499c21083faf6096a0dc3b8ee5682dd5cbcd3ce7
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-09-08 09:42:00 +02:00
Laszlo Agocs dd523fcb00 rendernode example: Prevent gui-render thread data race
By taking things like the item width and height in updatePaintNode()
(while gui is locked).

Change-Id: I840c6c858a0478eb6ceb09653fd1e033cb54372d
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-09-08 09:41:49 +02:00
Laszlo Agocs ee702d9436 Make vulkanunderqml work and update docs
What we are doing for now is setting ExternalContentsInPass always.
This way vulkanunderqml works as expected. For applications that do
not integrate external rendering this means that there is now an
additional secondary command buffer per render pass, but we can
live with this for now.

Later (Qt 6) there should be a way to declare this (that the application
will want to issue native rendering stuff) up front in QQuickWindow or
somewhere.

Change-Id: I736741f9b0eee2f8295b046bacdce862e6a546f5
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-09-08 09:41:27 +02:00