Commit Graph

42 Commits

Author SHA1 Message Date
Alexandru Croitor 1e5252f82e CMake: Make qtdeclarative tests standalone projects
Add the boilerplate standalone test prelude to each test, so that they
can be opened with an IDE without the qt-cmake-standalone-test script,
but directly with qt-cmake or cmake.

Boilerplate was added using the follow script:
https://git.qt.io/alcroito/cmake_refactor

Manual adjustments were made where the code was inserted in the wrong
location.

Task-number: QTBUG-93020
Change-Id: Ibd12efab09ceb5852395e40f10b55fafb69c1b58
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-07-05 12:34:12 +02:00
Amir Masoud Abdol c2d37f9646 Retire the qt_parse_all_arguments
Task-number: QTBUG-99238
Change-Id: Ia11c9cbd7c06347319ab3674ec0cd8da0214747e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-01-20 16:40:42 +01: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
Mitch Curtis 0fa3cbd9ab tst_signalspy: don't wait for window activation
The test doesn't need it; qWaitForWindowExposed is sufficient.

Fixes: QTBUG-104022
Pick-to: 6.2 6.3 6.4
Change-Id: I7e818b2f377bf5798e881100c555d54482ee3dbf
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-08-25 09:55:47 +08: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
Mitch Curtis a72b4cd733 TestCase: add API for checking for polish at window level
These were introduced to the C++ QQuickTest namespace in
36c6c1ea57.
QML-only tests should also have access to them.

[ChangeLog][QtQuickTest][TestCase] Added waitForPolish()
and made isPolishScheduled() also take a Window, making it possible
to verify that updatePolish() was called on one or more items
managed by a window.

[ChangeLog][QtQuickTest][TestCase] Deprecated waitForItemPolished().
Use the new waitForPolish() function instead.

Task-number: QTBUG-93757
Change-Id: Ie53389c2d49e096ebf382b902714c9dd4c8d5685
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-06-06 09:18:17 +08:00
Mitch Curtis 36c6c1ea57 QtQuickTest: add API for checking for polish at window level
This adds a qIsPolishScheduled(QQuickWindow *) overload of
qIsPolishScheduled(QQuickItem *) (added in
40d6072bc8) and deprecates
qWaitForItemPolished() (added in
7a3cad0619) in favor of qWaitForPolish(),
which has QQuickItem* and QQuickWindow* overloads.

The existing functions that take QQuickItem are useful, but testing
Qt Quick applications can be made even easier by allowing users to
check if a window has any items that need to be polished. This
information is already present (in QQuickWindowPrivate::itemsToPolish),
so it's very efficient to check for.

This is especially useful now that Qt Quick Layouts using polishing for
their layouting, for example, as it's no longer necessary to find
individual polishable items in complex hierarchies before proceeding
to interact with child items.

[ChangeLog][QtQuickTest][QQuickTest] Added
QQuickTest::qIsPolishScheduled(QQuickWindow *) and
QQuickTest::qWaitForPolish(QQuickWindow *) functions for verifying that
updatePolish() was called on one or more items managed by a window.

[ChangeLog][QtQuickTest][QQuickTest] Deprecated
QQuickTest::qWaitForItemPolished(QQuickItem *). Use the new
QQuickTest::qWaitForPolish(QQuickItem *) function instead.

Fixes: QTBUG-93757
Change-Id: I95b6e051b3c9fd2fa93604f4d9ccda486bb29f9d
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-06-02 12:46:11 +08:00
Janne Juntunen ee0906920c tst_quicktestmainwithsetup: Use correct QML module path on webOS
Use runtime path instead of compile time path on webOS. Previously the
test failed because it couldn't import its QML module.

Fixes: QTBUG-101933
Pick-to: 6.3
Change-Id: Ie0f58c9c43455ceb11e4cd521f4fd6ffe7fb7eb9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-03-23 20:05:48 +02:00
Assam Boudjelthia d736e9a601 Fix tst_quicktestmainwithsetup on Android
Include imports into the test resources because they might be needed
by the test as well.

Pick-to: 6.2 6.3
Task-number: QTBUG-97056
Change-Id: If2e0425bdc11024fb2f49c7fe4d6d62f6422f401
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-02-15 07:55:14 +00:00
Assam Boudjelthia f22d884faf Disable failing declarative tests on Android
This allows us to enable testing on declarative for the module
as a whole and have some sort of test verification for the mean
time, and fix the fails over time.

Pick-to: 6.2 6.3
Task-number: QTBUG-100003
Task-number: QTBUG-100014
Task-number: QTBUG-100016
Task-number: QTBUG-100018
Task-number: QTBUG-100020
Task-number: QTBUG-100021
Task-number: QTBUG-100164
Task-number: QTBUG-100166
Task-number: QTBUG-100167
Task-number: QTBUG-100169
Task-number: QTBUG-100171
Task-number: QTBUG-100173
Task-number: QTBUG-100175
Task-number: QTBUG-100176
Task-number: QTBUG-100177
Task-number: QTBUG-100191
Task-number: QTBUG-100253
Task-number: QTBUG-100254
Task-number: QTBUG-100256
Task-number: QTBUG-100257
Task-number: QTBUG-100258
Change-Id: I85bf1501b94f04853a1ca715e35df0a56041308a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-01-31 14:41:39 +02:00
Assam Boudjelthia 7b21a4fbba Package tst_signalspy test data otherwise it's not found on Android
Pick-to: 6.2 6.3
Task-number: QTBUG-97056
Change-Id: I29f268b8738c4033d5d855b1652f4a6182de4264
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-12-17 13:43:13 +02:00
Andrei Golubev 47822b45a6 Make qmltest/SignalSpy.qml aware of recursive qtest_update() calls
Apparently looking up a property can cause it to be evaluated (and its
signal handler called directly). From the debugging the following is
visible:

1) assume signalName is set first and target has a pending binding (not
   evaluated yet)
2) once signalName setter is triggered, it calls the relevant signal
   handler - onSignalNameChanged, which subsequently calls qtest_update()
3) in qtest_update():
  a. we first check whether there's any old state
     "if (qtest_prevTarget != null)" -> there's none yet, because we entered
     this function for the first time ever -> jump to:
     "if (target != null && signalName != "")"
  b. once at "target != null" the engine attempts to get the value of the
     `target` property. if the property `target` happens to have an unevaluated
     binding, it is evaluated immediately.
[the logic is in QObjectWrapper::getQmlProperty() which calls
 QObjectWrapper::getProperty() and that one calls
 QQmlData::flushPendingBinding()]
  c. the binding evaluation causes onTargetChanged signal handler to trigger
     which in turn again enters qtest_update
4) in the "recursive" call of qtest_update():
  a. same as 3.a.
  b. target is now evaluated and signalName is evaluated as well (due to
     being already set at step 2)
  c. "if (target != null && signalName != "")" succeeds and we proceed to
     connect to spy.qtest_activated
  d. we return from this function and get back to the outer qtest_update()
5) we are now back at 3.c in qtest_update():
  a. target is evaluated, signalName is known, so
     "if (target != null && signalName != "")" succeeds -> again, we proceed
     to connect to spy.qtest_activated (for the second time now - see 4.c)
  b. we return from qtest_update() (the outer one) back to onSignalNameChanged
6) the end. bottom line:
  - two signals were connected to target[signalName]
  - zero signals were disconnected

This seems like a very nasty thing to have in a UI-centric language
but for now let's just attempt to fix the SignalSpy class

Pick-to: 6.2
Task-number: QTBUG-98722
Change-Id: I70f11000b8383e6a8fc82d0034c62a2094f6d832
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-11-30 18:42:54 +00:00
Tatiana Borisova 384bf8ded0 Compile autotests for Integrity (qtdeclarative module)
-process environment is OFF for INTEGRITY

Task-number: QTBUG-96176
Pick-to: 6.2
Change-Id: I29067ed30f173e96fe1085e942ba05b367e27cac
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-09-23 14:23:26 +03:00
Mitch Curtis e310dadef7 Consolidate test helpers into private libraries
Previously each test would include and build sources from the shared
folder. Now we make those sources a library, build it once, then have
each test link to it instead.

We also take the opportunity to move some helpers that qtquickcontrols2
had added into the quicktestutils library where it makes sense, and
for the helpers that don't make sense to be there, move them into
quickcontrolstestutils.

We add the libraries to src/ so that they are internal modules built as
part of Qt, rather than tests. That way we can use them in a standalone
test outside of qtdeclarative.

Task-number: QTBUG-95621
Pick-to: 6.2
Change-Id: I0a2ab3976fdbff2e4414df7bdc0808f16453b80a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-09-13 21:17:04 +02:00
Craig Scott 63a601dc29 CMake: Remove unneeded *.pro and .prev_CMakeLists.txt files
The .pro files corresponding to the .prev_CMakeLists.txt files
have already been removed.

Change-Id: I254eafe4c7de1a516e33bd9cb3d9879e73fa83b4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-05-19 10:46:06 +10:00
Fabian Kosmale edca9f3d60 QuickTest: Do not recurse forever on inline components in enumerateTestCases
In TestCaseCollector::enumerateTestCases, we visit the super compilation
unit of QML tpyes to check if they might be instances of TestCase.
However, in the case of inline components, the super unit is the current
compilation unit, and we would recurse endlessly.

This does not address the issue that an inline component might actually
inherit TestCase. However, as this only affects the enumeration output
and does not actually affect test execution, this is not that much of an
issue. It should also be noted that the enumeration also fails in any
case where TestCases are loaded dynamically (with a loader), so the
method is not 100% accurate even in the absence of inline components.

Fixes: QTBUG-90740
Task-number: QTBUG-90762
Pick-to: 5.15 6.0
Change-Id: I7e133d62c4f62fc46e9bd3999ff755f7ded3c386
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-02-01 18:19:24 +01: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
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
Tor Arne Vestbø a5df29201f CMake: Update Apple platform defines after rename in qtbase
Change-Id: Ia0a075e3199eab735f9b289873beeb8730ebc47e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-03-17 10:42:00 +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
Leander Beernaert 44c9644ca0 Fix tst_testfiltering
Change-Id: I4f9674f8226b0627cab6935a5c28bf52a57c2e9e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-02-06 15:14:52 +00:00
Leander Beernaert b106d86c43 Regenerate Tests
Change-Id: Ib0eff9cb83b6e4c3cdbec4388969e4a194d1a88c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
2020-01-16 14:50:07 +00: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
Qt Forward Merge Bot a1e38651ce Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	.qmake.conf
	src/qmltest/quicktest.cpp
	tests/auto/qml/qmlcachegen/qmlcachegen.pro

Change-Id: I70e96e8817d59647f876b8b77b30cdeede8f0662
2019-03-25 10:13:23 +01:00
Mitch Curtis 52ac0ea8cb QUICK_TEST_MAIN_WITH_SETUP: fix qmlEngineAvailable() being called too late
When I added the macro, I wasn't aware that TestCaseCollector was a
thing. TestCaseCollector loads each QML file without running the tests
(i.e. creates a QQmlComponent from the file without creating an object
from that component). Since it still executes imports, the test can
fail if types are registered or import paths added in
qmlEngineAvailable(), since it's called too late.

So, call it earlier. This should have no adverse effect on user code,
as nothing of importance to the user will be skipped, and the
documentation already details what can be expected by the time
qmlEngineAvailable() is called.

Change-Id: Ibd3a4b728bc87b90f89cc310fddf668c5879ad83
Fixes: QTBUG-74160
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-03-21 09:07:14 +00:00
Mitch Curtis 028617688b TestCase: add isPolishScheduled() and waitForItemPolished()
These were introduced to the C++ QQuickTest namespace in 40d6072b and
7a3cad06, respectively. QML-only tests should also have access to them.

[ChangeLog][QtQuickTest][TestCase] Added isPolishScheduled()
function to allow checking if updatePolish() has been called on
an item since the last call to its polish() function.
This is useful to verify that a polish has been scheduled.

[ChangeLog][QtQuickTest][TestCase] Added waitForItemPolished()
for verifying that updatePolish() was called on an item.

Change-Id: I3e3a488197e74546358e2d5b0da7a902793c1954
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-12-10 10:45:21 +00:00
Qt Forward Merge Bot 0ae32e678e Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I34aa0c2eb178862b40e63b62c6daa056e5e204c6
2018-11-16 01:00:49 +01:00
Kirill Burtsev 16e3859af1 Qt Quick Test: support tags filter on tests run
Implemented logic for filtering tests with 'case::function:tag' run syntax.

Fixes: QTBUG-71645
Change-Id: I9243636b098b4e9ccb4c74d08679bbbb9f3e8a65
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2018-11-15 10:45:14 +00:00
Qt Forward Merge Bot b01a16ea74 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I2ed93c9d5fa8ec9b075112618a2535535591a0e8
2018-11-09 01:00:07 +01:00
Kirill Burtsev 74a5ce0266 Fix TestCase::skip to ignore rest of the data rows in TestCase
Fixes: QTBUG-53131
Change-Id: Ic24fe4b5db0e404b1b089a054ce76265763f2682
Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-11-07 14:54:49 +00:00
Mitch Curtis 7a3cad0619 Add QQuickTest::qWaitForItemPolished()
Verifying that an item was polished is quite common in Qt's auto tests:

- The Qt Quick auto tests have a util function for it in
  visualtestutil.h (line 103).
- "git grep polishScheduled -- tests/auto | wc -l" says that there are
  269 usages of polishScheduled in Qt Quick auto tests, almost all of
  which look like this:

  QTRY_COMPARE(QQuickItemPrivate::get(item)->polishScheduled, false);
- QQuickTableView's auto tests have their own function:

  #define WAIT_UNTIL_POLISHED \
      QVERIFY(tableViewPrivate->polishScheduled); \
      QTRY_VERIFY(!tableViewPrivate->polishScheduled)
- More recently, QQuickMenu started requiring it (see menuutil.h).

QQuickItem::polish() and QQuickItem::updatePolish() are both public
functions, so the notion of polishing in Qt Quick is not new or hidden.
This means that any user applications that have custom items that make
use of the polish() => updatePolish() system will benefit from having
a reliable method of testing their behavior. In addition, anyone
wanting to simulate interaction with items in e.g. QQuickMenu will
need this API if they don't want to use unreliable qWait() calls.

With this in mind, this and the previous patch aim to standardise/
simplify the various private API checks and utility functions, and
provide public API for users so that they can benefit from more
reliable tests. When used together, the code will look like this:

    QVERIFY(QQuickTest::qIsPolishScheduled(item));
    QVERIFY(QQuickTest::qWaitForItemPolished(item));

[ChangeLog][QtQuickTest][QQuickTest] Added
QQuickTest::qWaitForItemPolished() for verifying that updatePolish()
was called on an item.

Fixes: QTBUG-71224
Change-Id: I8841910212e7f1a431ba845cae8a1ba7b4f4da67
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-10-31 08:54:02 +00:00
Kari Oikarinen 27fe56d3e7 Exit test executable with failure if specified test functions are not found
If QtQuickTest test executable was given filters that didn't match in any of the
qml files run, it exited successfully.

In combination with a Coin bug when the test function name contains a space,
this allowed failing tests to pass the CI. If the test function fails, the
repeat attempts would pass two arguments to the executable. Neither of those
hit, but that wasn't considered a problem.

Check that all of the test functions named on the command line are actually
executed during the whole run and otherwise exit with a non-zero exit code.

I assume there's no duplicates in the whole names of test functions scoped with
testcase names.

Task-number: QTBUG-68197
Change-Id: Icf7fe263945403f02920522dfd187aeb76b7cb3c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kalle Viironen <kalle.viironen@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2018-06-21 13:01:26 +00:00
Shawn Rutledge 499ec43937 use nullptr consistently (clang-tidy)
From now on we prefer nullptr instead of 0 to clarify cases where
we are assigning or testing a pointer rather than a numeric zero.

Also, replaced cases where 0 was passed as Qt::KeyboardModifiers
with Qt::NoModifier (clang-tidy replaced them with nullptr, which
waas wrong, so it was just as well to make the tests more readable
rather than to revert those lines).

Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-02-26 07:13:18 +00:00
Kari Oikarinen 53d1e9ed21 tests: Wrap qWaitForWindow{Active,Exposed} in QVERIFY
The functions are marked Q_REQUIRED_RESULT, so they give compilation warnings
when not handling the bool return value. Failing the test early at an unexpected
event is also better behavior anyway.

Task-number: QTBUG-66559
Change-Id: I6c4db29379ec01528208c3e4ee54346b4230616c
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-02-23 20:00:11 +00:00
Mitch Curtis c260d3062d Add QUICK_TEST_MAIN_WITH_SETUP to allow executing C++ before a QML test
This macro is the same as QUICK_TEST_MAIN, but takes the user's
QObject subclass as an argument, and calls pre-defined slots/invokable
functions on it, similar to how e.g. init() is called for C++ tests.

This allows e.g. context properties to be set for the QML tests.

By basing the API on invokable functions, we give ourselves the freedom
to easily add more functions in the future.

[ChangeLog][QtQuickTest] Added QUICK_TEST_MAIN_WITH_SETUP macro to
allow executing C++ before a QML test (such as registering context
properties).

Task-number: QTBUG-50064
Change-Id: Id566e388553811c220871248403d32545f8ae1eb
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-02-02 07:37:18 +00:00
Jani Heikkinen 8f93d3627a Revert "Make QtQuickTest::mouseEvent use QTest::mouseX"
It seems this is causing QTBUG-62925 and QTBUG-62926 so revert
is the best option at this point to proceed

This reverts commit 4c46dce8fd.

Change-Id: Ia8ea85c1ac1ada1752b29c9fbd8439f5963d46d2
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-09-04 08:20:19 +00:00
Albert Astals Cid 4c46dce8fd Make QtQuickTest::mouseEvent use QTest::mouseX
Fixes QQuickItem::isUnderMouse returning wrong information when
moving the mouse cursor with QtQuickTest::mouseX

Also changes TestCase.mouseDrag to actually resemble more what
real life does, i.e. send mouse moves with the same localPos
if the item has already moved and update tst_drag.qml accordingly

Change-Id: I80e4ab097da90d21ba987466c1b82467755a6b56
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-08-30 11:55:30 +00:00
Albert Astals Cid b19ebe1d23 Fix SignalSpy with QQmlPropertyMap signals
2e7d4ecdc5 caused the regression.
To fix the regression I try accessing the signal name first
and if it is not a function try accessing the handler name.

Comes with a unit test to test both cases.

Change-Id: I3897f344df9c6219636c70259eed503d9b76f09e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-11-30 15:01:01 +00:00