Commit Graph

89 Commits

Author SHA1 Message Date
Volker Hilsheimer a867c9e522 Enable tst_QQuickCanvasItem on Android
The test mostly passes in the emulator and has generally no reason to
fail in CI. Test functions that should be blacklisted can be added to
BLACKLIST file, or QSKIP'ed if they crash, which none of them do.

Blacklist the test_save function, which fails on Android as we don't
have permission to write to the file system.

Fixes: QTBUG-103257
Task-number: QTBUG-41043
Change-Id: I5ef99a01dc26d9290be91675a5ff15e4de59e812
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 0230ceaec8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-04-12 01:36:29 +00:00
Shawn Rutledge ef0807f8ec tst_qquickcanvasitem: wait for canvas before creating a context
Hopefully this reduces flakiness in CI, following the suggestion from
the error message:

Unable to use getContext() at this time, please wait for available: true

Task-number: QTBUG-41043
Change-Id: I3710163cb197170e590f8fd7d188fa62f32ea649
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 223f1d45cc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-03-11 06:53:39 +00:00
Shawn Rutledge f5b6ff356e Canvas test_url: wait until image is loaded
The loadImages() function has been waiting already since
6318560eca); but test_url() was not
waiting, which could result in CI flakiness. Anyway tryVerify is better
than waiting 200ms every time it's slow, and will give us a failure
message about isImageLoaded() if it fails.

Task-number: QTBUG-41043
Change-Id: I0bb552d3452d85342d2ffa3b6becded5b01177a8
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit e37d2dac8a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-03-09 23:04:06 +00:00
Lucie Gérard 1b9808737a Change the license of all CMakeLists.txt and *.cmake files to BSD
Task-number: QTBUG-105718
Change-Id: Id89ed14990804a5024183e75382cc539d4293da1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-09-07 17:01:30 +02:00
Alexandru Croitor a8431a4067 CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers
Change-Id: I1cd769f85d5f82c43639d6787d98e536619249e6
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-07-28 14:58:42 +02:00
Lucie Gérard 5a7b716474 Add license headers to cmake files
CMakeLists.txt and .cmake files of significant size
(more than 2 lines according to our check in tst_license.pl)
now have the copyright and license header.

Existing copyright statements remain intact

Task-number: QTBUG-88621
Change-Id: I72c89a98c42bbc9234d8495e9e503bec81d11037
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-07-08 10:41:06 +02:00
Lucie Gérard 0dc4fd240a Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Files that have to be modified by hand are modified.
License files are organized under LICENSES directory.

Pick-to: 6.4
Task-number: QTBUG-67283
Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-06-11 08:05:15 +02:00
Andy Shaw dda364c148 Canvas: Add support for specifying a size when saving to an image
This will make it possible for the image to be scaled into the given
size, subsequently if this is set then it will make the DPR for the
image be 1.0.

[ChangeLog][QtQuick][Canvas] Canvas.save() now takes an optional size
argument, which sets the size of the image to save, and sets DPR=1.

Change-Id: I25f2d65a528282a26f46ef7dd1c62894307360cc
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-06-05 13:39:22 +02:00
Andreas Buhr efad05da66 Remove tst_qquickcanvasitem on Android
Test in tst_qquickcanvasitem keep failing randomly. This patch
disables it completely for Android.

Pick-to: 6.2 6.3
Task-number: QTBUG-103099
Task-number: QTBUG-101865
Change-Id: Icd10d9eb4f45987899bc0cac3163301f43a6d024
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-05-17 13:40:55 +02:00
Andreas Buhr fc0312be16 Blacklist failing tests in txt_qquickcanvasitem on Android
Pick-to: 6.2 6.3
Task-number: QTBUG-103099
Task-number: QTBUG-101865
Change-Id: I782a87e46817c971d7381738c4653baeab870e8c
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-05-16 18:22:45 +02:00
Andreas Buhr 6624313370 Blacklist failing tests in tst_qquickcanvasitem on Android
Pick-to: 6.2 6.3
Task-number: QTBUG-103099
Task-number: QTBUG-101865
Change-Id: I84e0d4b0f7ef4a2d3edc3bf58457ea012c1689d5
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-05-09 16:50:07 +02:00
Andreas Buhr eb5ff13248 Blacklist tests which fail on OpenGL context creation on Android
Pick-to: 6.2 6.3
Task-number: QTBUG-100991
Task-number: QTBUG-101865
Change-Id: If3fab4db4a4b21ca0fb1c726d25ab1f876de681b
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-05-06 00:06:29 +02:00
Andreas Buhr 4f58b7d201 Skip crashing test in tst_qquickcanvasitem on Android
Pick-to: 6.2 6.3
Task-number: QTBUG-103257
Task-number: QTBUG-101865
Change-Id: I9d656bf359ca5d94bb65b7477f373ad46ca3304b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-05-06 00:06:29 +02:00
Andreas Buhr 711780e22e Blacklist failing tests in txt_qquickcanvasitem on Android
Pick-to: 6.2 6.3
Task-number: QTBUG-103099
Task-number: QTBUG-101865
Change-Id: Ia04b1946077db7353cbe2dc7b9e899929469a6ee
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-05-03 10:02:46 +02:00
Fabian Kosmale 046f41d525 tst_qquickcanvasitem: Avoid interleaved execution
...by putting each test case into its own file.

Task-number: QTBUG-98350
Change-Id: Ie77e07eacef1acbafd9c3a5e3613de21f5d39a78
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-01-13 15:13:16 +01:00
Andy Shaw c31638f16b When setting the line dash to be an empty array reset the style to Solid
An empty line dash array is indicating that it should be reset to be a
Solid line, otherwise it ends up reusing the previous settings for the
pen instead of drawing a solid line.

Fixes: QTBUG-75553
Pick-to: 6.2 6.1 5.15
Change-Id: I16466672de95da8ef0cf3fc261969e7cc6add227
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2021-07-14 08:58:38 +02:00
Fabian Kosmale b8451949ba tst_qquickcanvas: Verfiy that canvas.context exists
Apparently it was possible to execute the pixel check before the canvas
was fully created. Use tryVerify to ensure that it is actually is there
before running the actual test function.

Pick-to: 6.1 6.0
Change-Id: I8e9f1133ea718c001f0456cb3af27f13e6d85e96
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2021-04-23 13:30:02 +02:00
Fabian Kosmale 78ab4b8d8b Remove the qmake project files
Remove all qmake project files, except for examples which are used to
test that qmake continues to work.

Change-Id: Ic4abb72dc2dcd75df7a797c56056b6b3c5fe62ac
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-01-15 15:34:22 +01:00
Samuli Piippo 4496de26b5 Blacklist failing tests for QEMU ARMv7
QEMU has a bug that prevents fontconfig to work correctly, which causes
font related testcase to fail. Blacklist those when running them in CI.

Task-number: QTQAINFRA-4127
Change-Id: Id6970be0db49128fb46838dbec04bc6f26048761
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-01-07 14:53:04 +00:00
Shawn Rutledge 8734fb80e0 Un-blacklist tests that grafana says are passing
canvas::test_implicitlySizedParent
tst_qquicktext::dependentImplicitSizes

Task-number: QTBUG-41043
Task-number: QTBUG-75786
Task-number: QTBUG-76608
Change-Id: Id90669e58eac4cbe1a3b73406641a8e42f9523b1
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-11-20 10:39:34 +00:00
Alexandru Croitor 08adbefa13 CMake: Regenerate projects to use new qt_internal_ API
Modify special case locations to use the new API as well.

Task-number: QTBUG-86815
Change-Id: I3b964e3baf0cc7040830156dac30358ea1152801
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-10-06 13:19:37 +02:00
Fabian Kosmale 43a532deff QQuickCanvas: Skip failing test for now
font::toString now outputs more information, so the test would need to
be adjusted. However,we  priorize geting the dependency update in over
fixing the test for now.

Task-number: QTBUG-86304
Change-Id: I44182b6115752a4cfb177e07b862f9e018613edf
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2020-08-28 13:49:06 +02:00
Qt Forward Merge Bot 2812184e1b Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	src/qml/jsruntime/qv4executablecompilationunit.cpp
	src/qml/jsruntime/qv4executablecompilationunit_p.h
	src/qml/qml/qqmlobjectcreator.cpp
	src/qml/qml/qqmlpropertycachecreator_p.h
	src/qml/qml/qqmltypecompiler.cpp
	src/qml/qml/qqmltypedata.cpp
	tests/auto/qml/qmlformat/tst_qmlformat.cpp
	tools/qmllint/scopetree.cpp
	src/qml/qml/qqmlapplicationengine_p.h

Adjusted tools/qmllint/findunqualified.cpp to use newer API

Change-Id: Ibfb4678ca39d626d47527265e3c96e43313873d4
2020-04-09 10:08:41 +02:00
Shawn Rutledge 2bb382f9c2 Make tst_qquickcanvasitem significant again; fix image size rounding
- the test items must be visible, so that waitForRendering() works
- arcTo::test_paint tried to render an out-of-bounds arc, which
  resulted in rendering nothing.  Now renders within the 100x100 canvas.
- painted() is not emitted the first time the Canvas is rendered.
- Canvas.save() saves relative to the directory from which the test is
  run, while Canvas.loadImage() loads relative to the test data
  directory in this autotest (other tests are loading red.png for
  example).  So we need to use absolute paths to test loading and saving
  in the directory where the executable is.
- canvas.getContext('2d').getImageData(8.5, 8.5, 8.5, 8.5)
  now triggers different rounding behavior in QRectF::toRect(),
  after qtbase 88e56d0932a3615231adf40d5ae033e742d72c33:
  it becomes QRect(9,9 8x8).  The assert in qt_create_image_data()
  needs to accommodate that.
- Fixed another pedantic warning in qt_create_image_data a few
  lines above: if it creates the image itself, it needs to round
  the qreal width and height values.

This reverts commit a23ee5c0de and
amends 424cfef3cc and
d142b2d212.

Task-number: QTBUG-41043
Change-Id: I825c2c5a2bbc8d5324c3ba41a681aa68bc25a159
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-03-05 05:52:14 +01:00
Shawn Rutledge fccffcfabc Blacklist a few more canvas tests
Task-number: QTBUG-41043
Change-Id: I3a48439d30d9ec1cd908197c8d63984c95d336e3
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-03-05 05:52:06 +01:00
Alexandru Croitor 1d4fa26a70 Regenerate qtdeclarative
Change-Id: I48d7fd306f3d1b161a8e73029282ee591b1ef612
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2020-02-12 17:30:34 +00:00
Alexandru Croitor b684ba2194 Merge remote-tracking branch 'origin/dev' into wip/cmake
Conflicts:
        dependencies.yaml

Change-Id: Ie3e9dc62031a85e5e81cbdf04694b95159d49fca
2020-01-29 16:52:58 +01:00
Morten Johan Sørvig 1fb5b58955 Blacklist failing quickcanvasitem tests for macOS
Failures can be reproduced locally on macOS 10.14,
except for the “ci”-marked entries.

Change-Id: I927b70f4a143b7741ac0d18588d32bfb637dd14c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-01-22 13:43:25 +01:00
Alexandru Croitor ba494aaa24 Regenerate all projects with new CMake API version
Change-Id: Ie0db35f674137c229eaf049616f38f8e818f7092
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-15 12:24:51 +00:00
Alexandru Croitor 387f360b3b Regenerate tests
Change-Id: I67a6c8f1659e7b471a4fcb92a2699292cf4eea81
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-14 10:22:34 +00:00
Leander Beernaert 4e14f6e70a Add QtDeclarative Test Coverage
All tests compile and run on a developer build.

These tests are failing:
tst_qqmlsqldatabase Fails due to missing sql driver
tst_qqmlsqldatabase Fails in wip/qt6
tst_ququicklayouts Fails in wip/qt6
tst_flickableinterop Fails in wip/qt6
tst_qquickpinchandler Fails in wip/qt6
tst_qquickflickable Fails in wip/qt6
tst_qquickgridview Fails in wip/qt6
tst_qquickimage Fails due to missing jpeg plugin
tst_qquicklistview Fails in wip/qt6
tst_qquicktext Fails in wip/qt6
tst_qquickcanvasitem Fails in wip/qt6
tst_scenegraph Fails due to missing jpeg plugin
tst_TestFiltering Fails in wip/qt6

Change-Id: I4b9d69c118e23c095cb72ad5a67653fc30943bb1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-14 14:01:58 +00:00
Andy Shaw 0148243a77 Canvas: Handle switching between object and string based colors
When switching between the two it should respect whatever the color is
regardless of whether it is a color value or a string based color. This
also accounts for "invalid" colors as this should set the stroke-style
to be #000000 to be inline with the default stroke-style indicated in
the specification.

Change-Id: I00bee6c9a85787762271882838510b4187798ee0
Fixes: QTBUG-42155
Fixes: QTBUG-52959
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-02-14 06:26:36 +00:00
Ulf Hermann 8ad8a5ddec Canvas: Guard context pointer against external deletion
You cannot keep the context when reparenting the canvas item. Use a
QPointer prevent dangling.

Task-number: QTBUG-73113
Change-Id: Ie7021c6f0bb0d09923eb358dc7e51d6727e74a7a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-01-23 07:43:45 +00:00
Colin Ogilvie eab3371b91 Add LineStyle support to Context2d
Allow Context2D lines to be drawn as dashed, dotted etc.

[ChangeLog][QtQuick][Canvas] Added set/get lineDash and lineDashOffset to Context2D to allow non solid lines to be drawn.

Task-number: QTBUG-31807
Change-Id: I9ffcc5d93dc352dbd0aec4ac8a616c999239c48d
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2018-07-12 20:26:34 +00:00
Mitch Curtis dd43adfa2d tst_gradient.qml: fix warnings about multiple var declarations
Change-Id: Iccfb86de6f8c14d10fcf12e1b7cbd58a13754aa7
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-05-24 14:48:10 +00:00
Mitch Curtis 43aef85442 tst_gradient.qml: fix warnings about type coercion
Change-Id: Ic3ab7cb4fa1772a0d92c06285f9cddf3378bd411
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-05-24 14:48:05 +00:00
Mitch Curtis f252b5229d tst_qquickcanvasitem: only run tiff tests if imageformats is installed
Use the new QQuickTestSetup class to set a context property that tells
the QML testcase whether or not qtimageformats is available.

Task-number: QTBUG-23980
Change-Id: Iddf093d422054c93fac6d908684733e71cfaa7c8
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-02-05 08:00:54 +00:00
Sami Nurmenniemi d8d3259b23 Enable tests for boot2qt
Some tests needed fixing
- Disabled tests too heavy for qemu
- Skipped tests requiring OpenGL without support from the platform
- Skipped tests requiring functionality on broken offscreen platform
- Skipped tests that take too long on qemu + software renderer
- Blacklisted tests for created bugs QTBUG-63049, QTBUG-63053
  QTBUG-63055 and QTBUG-63057

Task-number: QTBUG-60268
Change-Id: I0346b0e436cf286d7d9cbc140acf324a4087cfb9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-09-21 06:56:11 +00:00
Frederik Gladhorn 827af02890 Canvas test: make sure canvas is ready
before:
Totals: 80 passed, 653 failed, 0 skipped, 0 blacklisted, 35852ms
after:
Totals: 729 passed, 4 failed, 0 skipped, 0 blacklisted, 29599ms

The last four failures are due to high dpi issues.

Change-Id: Ie937091558395572dc281ee5a5b90848ea9d2081
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-07-04 15:33:47 +00:00
Peter Varga d142b2d212 Fix assertion in qt_create_image_data()
Fix rounding of width and height parameters.

Change-Id: Ib7655dafe382684340c32e2d2dc8adb445af65b0
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
2016-04-19 13:39:00 +00:00
Jani Heikkinen 38ec3bd755 Updated license headers
From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some
exceptions, see
http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/

Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one
(in those files which will be under GPL 3 with exceptions)

Change-Id: I04760a0801837cfc516d1c7c02d4f503f6bb70b6
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-20 11:46:25 +00:00
Ulf Hermann 6a2acd54f8 Fix OTHER_FILES in qquickcanvasitem.pro
It's very handy for IDEs if it matches the actual files.

Change-Id: Ib19b5ddc322260a9b24f3cf2f618e06a943cfa9d
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
2015-09-15 09:12:34 +00:00
Liang Qi 68607aeeeb Merge remote-tracking branch 'origin/5.6' into dev
Change-Id: Id27c36e55fcc68cc1140b0d9bec00b8ae6b52ed0
2015-09-06 10:39:51 +02:00
Friedemann Kleint 7ea2bb8764 Remove QT_DISABLE_DEPRECATED_BEFORE=0 from tests not using deprecated API.
Change-Id: I691b8ddff60b5f16f06d32b379c76e87f44f84a9
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2015-09-03 19:23:46 +00:00
Laszlo Agocs 6067b74bb7 Fix hue clamping in Context2D
It goes from 0..359, not 0..255.

Task-number: QTBUG-47894
Change-Id: I0612a9d5e4999afae7703b5c49741b94fb0da07f
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
2015-08-24 14:05:09 +00:00
Mitch Curtis cdc0916f60 Canvas: add a testcase for QSGSimpleTextureNode crash.
Task-number: QTBUG-47714
Change-Id: I8ecf2673ebc5de3d0fe1dec8a67bee81f5d4fb8f
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
2015-08-12 12:43:05 +00:00
Frederik Gladhorn ad67ec26d0 Merge remote-tracking branch 'origin/5.4' into 5.5
Conflicts:
	.qmake.conf
	LICENSE.GPLv2
	examples/qml/networkaccessmanagerfactory/view.qml
	src/qml/jsruntime/qv4runtime.cpp
	src/qml/jsruntime/qv4stringobject.cpp

Change-Id: I5d12f436d60995e51d5c2f59d364e9cbc24f8e32
2015-02-24 17:36:04 +01:00
Jani Heikkinen c5796292ad Update copyright headers
Qt copyrights are now in The Qt Company, so we could update the source
code headers accordingly. In the same go we should also fix the links to
point to qt.io.

Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9
Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
2015-02-12 10:28:11 +00:00
Mitch Curtis fea8c9026d Ensure that Canvas has the correct size with complex bindings.
When a Canvas is a child of an item with certain width and height
values (as described in the bug report), it won't paint correctly.

For example, the order of events might occur like so:

1. Canvas width set to 1
2. Canvas height set to 1
3. Canvas width set to 32, which causes the height to also be set to 32

Every size change causes QQuickCanvasItem::geometryChanged() to be
called, but the third event above causes it to be called recursively,
such that the most nested call results in the size being 32x32, but
then the execution returns to the first call and 32x1 is used instead,
overwriting the correct size.

We fix this by setting the new canvas size to width() and height(),
ignoring the recursion and instead using the latest size of the item.

Change-Id: Iebbcbfaa3217319b32b97f6b68f7a8af197a0e89
Task-number: QTBUG-42878
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-01-28 11:54:41 +00:00
Mitch Curtis 93affd9ff6 Canvas: don't crash when getContext("2d") is called on destruction.
We'd assume that a Window existed when that's not always the case.
For example:

import QtQuick 2.4
import QtQuick.Window 2.2
Window {
    Loader {
        sourceComponent: Canvas {
            Component.onDestruction: getContext("2d")
        }
        Component.onCompleted: active = false
    }
}

Change-Id: I5f30876e21ced5658adfa3bac494fd4196e0a7e3
Task-number: QTBUG-42222
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2015-01-26 17:28:37 +01:00