Commit Graph

2209 Commits

Author SHA1 Message Date
Ulf Hermann 0a1e4cc7ec Do not resolve URLs when assigning them to a property
We don't know in advance if a URL is part of the source code and should
be relative to the current element, or if it is part of the application
data and should not be touched.

[ChangeLog][QtQml][Important Behavior Changes] URLs are not resolved or
intercepted anymore when assigning them to a "url" property. Instead
they are resolved and possibly intercepted when used to access an actual
resource.

Fixes: QTBUG-76879
Change-Id: Iaa2385aff2c13aa71a12e57385d9afb5dc60a073
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-06-22 18:37:52 +02:00
Laszlo Agocs 4e266103ad Rename setSceneGraphBackend to setGraphicsApi
...and fix up the docs.

The string-based setSceneGraphBackend() stays of course (the docs have
been enhanced, however). The GraphicsApi enum-based overload is now
renamed to setGraphicsApi().

Using the same name for both functions is a historical artifact, reflecting
the evolution (5.0 - 5.8 - 5.14). In 6.0 we can give it a more appropriate
name, since it does not have much to do with "backends" from the user's
perspective.

Change-Id: Id75dbf81f50a148797e5b5de9be4000153737473
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-06-22 16:10:52 +02:00
Laszlo Agocs 38bd2bd831 Add test for rendercontrol + rendererinterface
Also add support for doing
QQuickWindow::setSceneGraphBackend(QSGRendererInterface::Unknown). This
becomes relevant especially in tests, where we may request a specific
graphics API, but then want to switch back to the default behavior.

Change-Id: Ib09c411432fc37bd4d36ce55d54d20af3f83860a
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-06-22 16:10:36 +02:00
Laszlo Agocs fdba8facd0 tst_qquickwindow: Add basic rendererInterface test
And remove some dead code.

Change-Id: Ic49acb1241020dea4ebff829d335d3b98716bbc0
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-06-22 16:10:35 +02:00
Laszlo Agocs 6ca0145f06 Emit new frame signals from the software backend
Introduce an autotest case too.

Change-Id: I658b09b6e4e5b30cdc2174fdf21f60adf93e44ff
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-06-22 16:10:35 +02:00
Ulf Hermann 8a3f859556 Revert "Decode directory separators in source URLs"
This reverts commit 7ec30c51b287159377761338fe6d3b48706d74ee.

We don't want to half-decode directory separators on assignment. This
just introduces inconsistency down the line.

[ChangeLog][QtQml][Important Behavior Changes] Percent-encoded directory
separators in URLs are not automatically decoded on assignment to url
properties anymore. This was obviously not a good idea to begin with.

Fixes: QTBUG-81244
Change-Id: I1938abbe8aada88beff0d628397674255e8b2472
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-06-22 09:10:18 +02:00
Laszlo Agocs b976a12940 ShaderEffect: vertexShader and fragmentShader are now URLs
..and so fully compatible in behavior with properties like Image.source.

The main improvement here is that unlike with the old code, which incorrectly
handled local file URLs, one can now write fragmentShader: "myshader.frag.qsb"
which leads to picking up the file relative to the component (the .qml file),
as expected.

Existing code (that uses file: or qrc: URLs) will continue to work
as-is.

Change-Id: I89dd84b998b59ae6d5b6cb3d8a6353961ee8bb4a
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2020-06-18 10:23:17 +02:00
Paul Olav Tvete 83fb4f6743 Clean up QT_CONFIG(opengl)
Accelerated graphics is now possible without OpenGL support. With
this change, a Qt build with -no-opengl can still run Qt Quick with
a Vulkan, Metal, or Direct3D backend.

Fixes: QTBUG-84027
Change-Id: Ib63c733d28cfdf7de16b138df136fa7628e1747b
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-06-17 17:42:01 +02:00
Fabian Kosmale ab03621516 Cull removed items from QQuickItemView
Amends a20132c326, which fixed a crash,
but also prevented the item from being culled. This is fixed by
narrowing the scope of the condition to affect only the caching related
part.

Fixes: QTBUG-84604
Pick-to: 5.15
Change-Id: I9b8a1a148d6538a18280475d89b87a4049ff3465
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-06-15 17:52:16 +02:00
Ulf Hermann 828cdcabf8 Remove QtQuick.Window plugin
We move all the types into QtQuick itself and retain QtQuick.Window only
as alias to QtQuick. This requires support for qmldirs that consist of
only an import statement.

[ChangeLog][QtQuick][Important Behavior Changes] The contents of the
QtQuick.Window QML module have been moved into the QtQuick module.
QtQuick.Window is merely and alias for QtQuick now. An explicit import
of QtQuick will override this alias. Therefore, if you import QtQuick
with a different version than QtQuick.Window, you will get the
QtQuick.Window types of the version given in the QtQuick import now.

Task-number: QTBUG-84639
Change-Id: Ia82afab0ac2faba70cfdaf53dc8dfe4261e1113f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-06-15 16:56:10 +02:00
Ulf Hermann f2378620e1 Fix memory leaks in QQuickWindow test
Change-Id: I045814dbb78234e7f885eb28ce839c1dc2f66924
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-06-15 16:35:02 +02:00
Valery Volgutov f07641b47a Fix QQuickKeyNavigationAttached issue
When Repeater used for Item creation, we have following issue:

When Repeater creates a new item and this item tries to
set keyboard.left or keyboard.right to another Repeater-created
sibling, these items haven't been created yet, and we have issue with
navigation keys.

Set rightSet to true if right really changed.
When object calls KeyboardNavigation::setRight(null),
rightSet = true, but right field did not change (null).
After that, navigation keys work incorrectly.
The same for other cases.

Task-number: QTBUG-83356
Pick-to: 5.15
Change-Id: I9ea6d6a7d13ff989aac3d9e2d22467b48080de13
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-06-12 12:23:21 +02:00
Laszlo Agocs 132e2fb2bf Make openglContext getter in QQuickWindow private
Fix up the scenegraph and qquickwindow autotests as well. (direct OpenGL
specifics are now completely removed from both, i.e. the remaning OpenGL
specific tests are now run (and not skipped) with OpenGL-on-RHI)

[ChangeLog][Qt Quick][QQuickWindow] openglContext() has been removed
from QQuickWindow. Use QSGRendererInterface to query the QOpenGLContext.

Change-Id: If5c9802b71ac5f9cffc695827e286eb2a2d03580
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-06-11 22:23:50 +02:00
Shawn Rutledge 212c2bffbb Replace calls to deprecated QEvent accessor functions
Several event accessors were deprecated in
qtbase/24e52c10deedbaef833c0e2c3ee7bee03eacc4f5.

Replacements were generated by clazy using the new qevent-accessors check:
$ export CLAZY_CHECKS=qevent-accessors
$ export CLAZY_EXPORT_FIXES=1
$ ../qt6/configure -platform linux-clang -developer-build -debug
  -no-optimize-debug -opensource -confirm-license -no-pch QMAKE_CXX=clazy
$ make
$ cd ../../qt6/qtdeclarative
$ find . -name "*.clazy.yaml"
$ clang-apply-replacements .

Task-number: QTBUG-20885
Task-number: QTBUG-84775
Change-Id: I1be5819506fd5039e86b4494223acbe193e6b0c9
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-06-11 22:00:19 +02:00
Qt Submodule Update Bot 11a09e2128 Update dependencies on 'dev' in qt/qtdeclarative
And workaround hash issue for now by using qHashMulti
Also, fix test build failure

Change-Id: Ia6b696b2531149206c73e7a5a958d7fba74a0f19
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-11 11:18:21 +02:00
Laszlo Agocs 05f6fdd05a Add missing renaming in tst_examples
Change-Id: Ib7e470e9e4a79b039f8f836144108581cc0bf5dd
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2020-06-11 11:18:21 +02:00
Laszlo Agocs 6f4fdce07f Rename setPersistentOpenGLContext and revise related docs
These persistent hints are still taken into account by the threaded
render loop, so keep them, but get rid of "OpenGL Context" from the
function names.

The qquickwindow autotest has been updated accordingly, and with a few
OpenGL-related cleanups it now runs without any warnings or skips with
OpenGL-on-RHI, while it skips only 1 case when running with some other
API, and 2 with the software backend.

[ChangeLog][Qt Quick][QQuickWindow] The setPersistentOpenGLContext() and
isPersistentOpenGLContext() functions are renamed to
setPersistentGraphics() and isPersistentGraphics().

Change-Id: Ifc4cc7c4b94fe9f7e402b39ca4f28952dcafd588
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-06-11 11:18:21 +02:00
Fabian Kosmale 780ba4e477 cmake: enable previously disabled test
And remove a few superfluous "disable" entries, which are enabled in
another place.

Task-number: QTBUG-84869
Change-Id: I1d4008c5e18563a36d129cef4813f20d776ef1e6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-10 19:16:28 +02:00
Fabian Kosmale b2095ffb1e cmake: Enable tests for pointerhandlers
Also add the missing cmake file for mousearea_interop

Task-number: QTBUG-84869
Change-Id: I7e48653c815aaaa3e23824783f6a0ff390c0907a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-10 19:16:27 +02:00
Shawn Rutledge 9eabb32822 Modernize tst_QQuickPathView::treeModel()
- Don't use context properties: a singleton is better
- Use required properties to declare dependendencies

Change-Id: I10a0a301e0a397b1d4fc9edf804eea3499c79025
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-06-10 18:55:43 +02:00
Shawn Rutledge 880ce02104 Modernize tst_QQuickListView::QTBUG_39492
- Don't use context properties: a singleton is better
- Use required properties to declare dependendencies
- Rename to treeDelegateModelLayoutChange() to describe what it's testing
  rather than just a bug number, and because it's somewhat analogous to
  tst_QQuickPathView::treeModel()

Task-number: QTBUG-39492
Change-Id: I753bbdf625b8d8c82774b6a2b1754fe3c8895823
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-06-10 18:55:37 +02:00
Shawn Rutledge 2449999ba1 Fix some warnings in tst_qquickpathview
Change-Id: I5c3c6d418fb9f35ee684d6d7c548ba468b7f262c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-06-10 18:30:08 +02:00
Paul Olav Tvete 4e29be5a72 Don't try to include removed header
Change-Id: I175272ddb1aec6a83056bf176779a86ed263c563
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-06-10 06:02:37 +02:00
Laszlo Agocs 765339c6c1 Clean up scenegraph autotest init
Remove printing OpenGL stuff. Rather, print something more useful,
such as the QRhi backend that is going to be used.

Some mipmap workaround for old Mesa is removed. Even with OpenGL, we
will not be running with such old Mesa versions in practice.

Change-Id: I9f32ef4645aaa750b2c00ee30e021b2708b06493
Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-06-08 14:10:59 +02:00
Wang Chuan bf8b45e33a QQuickTextNodeEngine: prevent renderring transparent selection color
It is not necessary to render selection color which is transparent.

Pick-to: 5.15
Fixes: QTBUG-83819
Change-Id: I45c086652e194192619aad025121e6064ab37a58
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-06-05 08:25:04 +08:00
Paul Olav Tvete 70dd5e24ce Remove QQuickOpenGLShaderEffect
This also removes QQuickUniformAnimator, which is not yet ported
to RHI (QTBUG-83976)

Task-number: QTBUG-83977
Change-Id: I3e656e6817ac991371b7f6557f050e122635d279
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-06-04 16:20:26 +02:00
Paul Olav Tvete 5cc00daa75 Port shader effect autotest to RHI
The lookThroughShaderCode test function had to be removed, since
it does not make sense when the shader code may not be available.
Added testConnection() to verify that connections are made.

Fixes: QTBUG-84123
Change-Id: I33594367bea97de9ef0d54711b105a33c8a57fa8
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-06-03 19:51:17 +02:00
Laszlo Agocs 5e0bf417fb Fix handling of destroy-show and re-enable the zoom test for qmlpreview
Fixes: QTBUG-84059
Change-Id: Id70c043f96e9525a5a6053efbf99c5ea3408da65
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-06-03 10:51:26 +02:00
Laszlo Agocs 2efc801a13 Remove layer and dist.field glyph cache OpenGL versions
Task-number: QTBUG-79268
Change-Id: I16123a8a49d17e3ffdd5cbcfbebcd8bfa46e648c
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-06-02 15:44:25 +02:00
Laszlo Agocs f621603692 Follow QRhi create-destroy API update
Change-Id: I0bc2cbce373febcb9073f15067eebbc1723462ba
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-06-02 10:38:03 +02:00
Alexandru Croitor 350a2f48c1 CMake: Regenerate qtdeclarative/tests
Includes:
 - new api calls
 - some new dependencies
 - some TARGET_DESCRIPTION
 - some additional tool directory exclusion when cross-compiling
   (qmlplugindump)
 - some missing add_subdirectory calls

Change-Id: Iea43e45b94f37367ffc1d8dd6ce0ff1021a31b1a
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-05-29 10:01:25 +02:00
Laszlo Agocs 8974582857 Make the nodes autotest QRhi compatible
Change-Id: I42639421258b62896b74dc4ae1c0fdfb200c83ff
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2020-05-28 14:23:15 +02:00
Eskil Abrahamsen Blomfeldt 5d4d598354 Adapt to changes in NativeTexture in qtbase
To make the API less error prone, we have changed the
void pointer to the texture handle to a 64-bit in
instead, since all handles are maximum 64-bit.

Task-number: QTBUG-78638
Change-Id: I9d995d6a883b3377f57d7c5b19d4bc4e15aa347b
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-05-25 13:39:32 +02:00
Ulf Hermann 542fdc075e Avoid memory leaks in QQuickView test
Change-Id: Iba9fec11567199d6ab8467fa2209b4999ae84c8f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-05-20 22:42:42 +02:00
Laszlo Agocs 1bedec02ca Add CMake project file for recently introduced autotest
The qquickrendercontrol autotest had no CMakeLists.txt.

Change-Id: Ic5285292cf9f02b4d06b2209bae4ac75c7ba2efe
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-20 13:47:02 +02:00
Laszlo Agocs 303ca9f4cf Enable qquickframebufferobject test to function
...by forcing OpenGL over RHI

Change-Id: Iad08d85c9a5b7c3ee4956ae5c56e34a94ef9e20d
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2020-05-20 13:46:49 +02:00
Eskil Abrahamsen Blomfeldt 76e6f8e997 Fix assert in tst_QQuickRenderControl
We should not call device functions after resetting them.

Change-Id: I0470792457eff070ba3aeb767f5f5be622ebda42
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-05-19 16:10:57 +02:00
Ulf Hermann 19ea4e630c Clean up registration of QEasingCurve
We don't need to register the Type enum for both QtQml and QtQuick.
QtQml is enough. Removing this makes the whole manual value type
registration obsolete. Furthermore, we want QEasingCurve as QML_FOREIGN
as we have several classes with properties of that type. To keep it nice
and tidy, we make the uppercase-named enum holder class a separate type.

Unfortunately, the Type enums differ in one entry:
QEasingCurve::BezierSpline is called Easing.Bezier in QML. Therefore, we
need to keep the custom enum around. We can change all users in
qtdeclarative to use the name from QEasingCurve, though.

Change-Id: Ibbc78d8bbf8938e2a8722f8c09833a0c73394c3d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-05-19 08:36:04 +02:00
Liang Qi 304891f65b Merge "Merge remote-tracking branch 'origin/5.15' into dev" 2020-05-18 08:54:55 +02:00
Laszlo Agocs 7dab86334a Remove openglinfo autotest
...because OpenGLInfo itself is deprecated and was replaced by
GraphicsInfo back in Qt 5.8.

Change-Id: Icfeff14cc404d9b82da07991c77fc4a7a0869883
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-05-17 11:59:38 +02:00
Laszlo Agocs fa1f041912 Remove OpenGL usage in AnimatedSprite autotest
It was never really necessary: the value is queriable from the
rendercontext.

Change-Id: Ibb7cf1b86a59c9dbf14476f2e798a29cabf6282f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-05-16 10:33:01 +02:00
Liang Qi 0ae26f8c57 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	tests/auto/quick/qquicktextedit/BLACKLIST

Change-Id: If1868d27ea40fdc206971c2f7a24e91c5e62b1bf
2020-05-15 09:01:29 +02:00
Shawn Rutledge a24a49dfbb Autotests: use std::atomic in incubateWhile()
Followup to a9bf6e652a

Change-Id: Ic010f2610177f93f8fc4e2312d6736c96390e585
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-05-15 08:48:03 +02:00
Qt Forward Merge Bot 3ed33ec74b Merge remote-tracking branch 'origin/5.15.0' into 5.15
Change-Id: I1f653fa9586e7d1e9c23acffba4512cfe9f951b8
2020-05-14 14:07:15 +02:00
Jan Arve Sæther 1c8bce2855 Improve polish loop detection and diagnostics
The existing warning was pretty much useless since it would only warn
after having looped INT_MAX times. In addition, it didn't actually
detect if polish() was called from within updatePolish().

Instead, the counting is changed to be strictly more correct:

The counter is now only increased when polish() is called within the
updatePolish(). It will reset back to 1 if that does not occur.
Effectively, the counter will reflect how many consecutive polish loops
we have processed.

This patch will show diagnostics after having reached 1000 consecutive
polish loops. It will only warn for the next 5 items in order to not be
too verbose...(most likely they will be the same 5 items).

If the counter reaches 100,000, we break out of the loop:
This might be important for e.g. CI runs so that the process can actually
terminate in order to get some useful diagnostics.

Note that the item that calls polish() within updatePolish() doesn't
have to be the same item as updatePolish() was called on. We also want
to track these since there might be several items working in tandem to
create the loop.

With this change it will now give the following output:

  main.qml:10:5: QML Row: possible QQuickItem::polish() loop
  main.qml:10:5: QML Row: Row called polish() inside updatePolish() of Row

(This is when Row called polish() from within its own updatePolish())

Fixes: QTBUG-40220
Task-number: QTBUG-83856
Pick-to: 5.12
Pick-to: 5.15
Change-Id: Ib8a7242908082c70d8cf71efbbe1fa148dbfada0
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-05-14 08:50:25 +02:00
Laszlo Agocs 6b45520db6 qquickwindow test: Fix incorrect expectation
It works correctly in Qt 6. Previously running with the software backend
(which is exercised by the QEMU-based CI configurations) had a bug
in postJob(). A side effect of the RHI-related changes is that this is
corrected so the QEXPECT_FAIL is no longer necessary.

Change-Id: I6167856f1df6689707a1934a71bf668d0b051aec
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-05-11 15:28:35 +02:00
Laszlo Agocs 80835dbc83 Disable QQuickWidget case in qquickshortcut test
Also rename the test case, while we are at it.

Change-Id: Iaf500ee495c0406c70b1ec2c9f04a2692a85bd1e
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2020-05-11 14:32:32 +02:00
Tony Sarajärvi 8279fb44cb Blacklist a failing hAlignVisual in SLES
Task-number: QTBUG-76719
Change-Id: I034f15471e64a272f365cfe636d757478ab418d8
Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
2020-05-11 12:25:17 +00:00
Laszlo Agocs 310cf26b00 Temporarily disable qquickshadereffect autotest
Blocks CI with RHI (in developer builds).

Needs a full port at some point, or it will have
to be removed.

The CMakeLists.txt is not updated because the test
in question is not present there in the first place.
(some goes for some other tests)

Change-Id: Ib16a7ee1ab307eb9e52865c2d97415a2c0bdf9e5
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2020-05-11 12:48:48 +02:00
Laszlo Agocs c9f0fe6b8b Avoid grabbing non-exposed window in qquickimage autotest
It uncovers a valid issue (that seems to affect Vulkan only, which is
pretty odd), but that test is not the right place to exercise this.
Just do like every other case in the same test does: show the window.

The non-exposed window grab issue will be handled separately.

Change-Id: Id2c1ff46251adf058dd26a30dedd30ecd27e4aa6
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-05-11 08:43:35 +02:00