Commit Graph

7 Commits

Author SHA1 Message Date
Mitch Curtis 81e8cd6719 Make tests explicitly use Basic where necessary
The previous commit changes the how the default style is set, and since
the tests all assumed that Basic was the default, we now need to
ensure it is explicitly set.

If we want to, we can revert this patch (or file-by-file) later and
ensure that these tests work with all styles. For now, just keep things
working as they used to.

Tests that use QTEST_QUICKCONTROLS_MAIN are not changed, as they
already run with all built-in styles.

Tests that don't use types that will cause issues,
like tst_qquickcolor, do not need to be changed.

tst_snippets can be run manually to produce screenshots, so we specify its
style in a qtquickcontrols2.conf file to allow it to be overridden by e.g.
application arguments (QQuickStyle::setStyle() takes precedence over all
other approaches of setting a style).

Change-Id: Ifae7e959f89a41a757c170272038fad139bba04f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-10-07 13:31:20 +02:00
Mitch Curtis 969a724352 QQuickApplicationHelper: don't use QTest macros outside test functions
This has no effect.

Task-number: QTBUG-66320
Pick-to: 5.15 5.12
Change-Id: Ie6efb26243178c4044ac0bc721c21ad89769c982
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-06-17 14:47:52 +00:00
Mitch Curtis 8301071b25 Fix tst_cursor when running in Android emulator
Explicitly set hoverEnabled to true on the ScrollBar to account for
platforms like Android, where the UiEffects style hint does not include
HoverEffect, and hence QQuickControlPrivate::calcHoverEnabled() would
otherwise return false.

Change-Id: Iee2b1f7c3ee8e5caf2a7b4f6695ab4dabd6b4753
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-05-03 13:06:57 +00:00
Friedemann Kleint 9fdbdea176 Fix tst_cursor::controls(containers) test failing after change in the Windows QPA
The test failed in case the mouse cursor was within the view to be created.
Move the cursor away to prevent that.

Fixes: QTBUG-74130
Change-Id: I8d77fc9b4cc5380ddb06ba128bca7c1666357b50
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2019-03-01 08:22:52 +00:00
Sami Nurmenniemi adb0f009de Fix tests for boot2qt
The tests for boot2qt were disabled with commit
28063805bf. The tests can
be enabled since qtdeclarative now fallbacks to software
renderer if OpenGL is not supported.

Some tests involving mouse behavior and window grabbing
need to be skipped on minimal/offscreen platforms.

Task-number: QTBUG-60268
Change-Id: Ib468638df8d5001bf127dd17aee7dcfe38b11780
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-08-22 12:03:49 +00:00
J-P Nurmi ed64115cbf Set explicit cursors on all interactive controls
For example, if you have a floating button on top of a text editor,
hovering the button must change the cursor from the editor's ibeam
cursor to an arrow cursor. This applies to all interactive controls
that call setAcceptedMouseButtons(). If a control blocks mouse events,
it should not use some random cursor from another control underneath.

Task-number: QTBUG-59629
Change-Id: I8a6ae306bbc76a9b22377361cb19cf9c3a872d31
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2017-04-05 07:34:21 +00:00
J-P Nurmi 0704f76d47 Rename tst_scrollbar to tst_cursor
This test was added in 88a62b3 that fixed the scrollbar cursor. It was
not possible to test in QML, so a separate C++ test was added. It was
noticed that most interactive controls have the exact same issue, so we
want to utilize the same test for testing the cursors of all relevant
controls.

Change-Id: I7c307de9f72760b0993007246beb3357a1b5ec2b
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2017-04-05 07:34:16 +00:00