Commit Graph

13 Commits

Author SHA1 Message Date
Volker Hilsheimer
b3424c7027 Baseline tests: wait longer before taking a screen snapshot
The recorded images frequently show traces of a fading-out command
prompt window that is opened by the test execution. We evidently have
to wait longer for all window-level effects are finished.

Pick-to: 6.5
Change-Id: I50db54ff33bf4bb1ef7c480a4aede1d5de1618c3
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2023-04-20 15:17:25 +02:00
Santhosh Kumar
f9aaa3e163 Update base line test case for widgets
Added baseline test case for menu (popup), combobox, command link and
lcd number.

New API takeScreenSnapshot() has been added for screen capture and
it serves to capture pop up windows

Change-Id: I5c1e46df270d94faf5c53431cddbd07532c256ee
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-01-06 14:51:29 +01:00
Tor Arne Vestbø
2436e259ce Deprecate QApplication::setActiveWindow() and mark as internal
The function is used the internal window activation machinery and
should not be called by user code.

Many tests still use this function, and should be ported over to
QWidget::activateWindow(). For now they are using the private
helper in QApplicationPrivate, so that we can progress with the
public API deprecation.

Change-Id: I29f1575acf9efdcbae4c005ee9b2eb1bb0c8e5b5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-08-27 20:22:29 +02:00
Lucie Gérard
05fc3aef53 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.

Task-number: QTBUG-67283
Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-05-16 16:37:38 +02:00
Volker Hilsheimer
4222d117d2 Baseline tests: slow down cursor blinking
Override the default cursor blink time so that we don't get mismatches
from line edits. We need to set the time to > 0 so that QStyleHints does
not fall back to the platform integration.

Pick-to: 6.3
Change-Id: Ib1d04f7450c01c352c13098886aee032dcb14c72
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2022-05-05 16:50:31 +02:00
Volker Hilsheimer
dc96d812ec Baseline testing of widget: wait before taking snapshot
Widgets and styles might use fade effects or other asynchronous mechanisms
as part of hovering. This results in mismatches when the snapshot is
taken before those effects are completed.

Since we can't control all such animations from the outside, process
events for some milliseconds before taking the snapshot.

Pick-to: 6.3
Change-Id: I771658300628238552bddcd14a6751c3f6c0c63d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2022-05-05 16:50:31 +02:00
Volker Hilsheimer
58a14d9433 Enable tests to turn off Windows Vista animations
Animations in that style depend on the current time, which makes it
impossible to run baseline tests. Introduce a dynamic property that
allows us to set the time that animations use.

This way, tests can turn the animation off, or control which time should
be used.

To keep performance overhead low, check only once whether the dynamic
property is set at all.

Pick-to: 6.3
Change-Id: I9bc57b9867fb0d852e101570eca4c7609e7fe1a8
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2022-03-16 15:56:17 +01:00
Volker Hilsheimer
b2edef557c Baseline: don't compensate for DPRs != 1.0
The resulting blurriness is too significant, and it's hard to see where
the difference comes from. Better to encode the screen DPR into the
appearance ID if it's not 1.0, and warn about the comparison not being
done to the baseline images with a 1.0 DPR.

Pick-to: 6.3
Change-Id: Iceab7b0a4cc50627145bd1267cff22344f7d8e5b
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2022-03-14 23:38:10 +01:00
Volker Hilsheimer
ad333b9b87 Baseline testing: make style name explicit
Mangling it into the checksum makes it hard to navigate the available
images.

Pick-to: 6.3
Change-Id: I54dcab5681e747ce1c5fe1b141ef6c4441d1f7eb
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2022-03-14 23:38:09 +01:00
Axel Spoerl
fd93c298d6 Prevent takeStandardSnapshots() from stopping on first mismatch
Force takeStandardSnapshots() to take and log all snapshots before
launching QFAIL. Macros QBASELINE_CHECK_DEFERRED and
QBASELINE_CHECK_DEFERRED_SUM have been added in qbaselinetest.h

Task-number: QTBUG-99790
Pick-to: 6.3
Change-Id: Ia015de808f354e842ac4029c5c84be18c4a4e209
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-01-17 21:24:27 +01:00
Eirik Aavitsland
7719fcea4b Add a couple of utility functions to the baseline test framework
Adds a function for setting the baseline Project name, which selects
the top level server directory and hence config settings.

Also adds a function that lets the client override the server config
setting for the project image keys (ItemPathKeys). This is the list of
properties that will be used to determine which clients are "the
same", i.e. which baseline to compare against. Overriding that is
handy since it allows experimentation and customization of clients
without involving changes in the project config on the baseline
server.

Pick-to: 6.3 6.2
Change-Id: Id3998356494a9a2cb71c009b43593d3dc1b6963a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2022-01-13 14:56:37 +01:00
Eirik Aavitsland
0f051815a0 Remove faulty #include from widgets baseline test
Since there is an actual qwidgetbaselinetest.h header file, one should
not include a .moc file. The build system will take care of it, and
currently warns about this #include.

Pick-to: 6.3
Change-Id: I4fbff9ef75c901fe3db4df54d6f3ff0d9307edce
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-01-04 05:53:30 +01:00
Volker Hilsheimer
969cd432f5 Share common code for baseline-testing widget UIs
Setting up the baseline tests, creating an appearance identifier,
and basic image-grabbing functionality doesn't need to be reinvented
for each test case that wants to use baseline testing of widget UIs.

As a drive-by, remove unneeded Qt 5 meta tags from .pri file.

Change-Id: I1562e1b377946305cac018e0f0f0175c2c07cd31
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-11-26 22:40:54 +01:00