Commit Graph

24 Commits

Author SHA1 Message Date
Santhosh Kumar
f50b853bed Adjust window rectangle for menu baseline test case
Capturing complete window for menu test cases makes it fail as there can
be different window shapes (such as rectangular or rounded corners). To
avoid this, its better to capture only minimal visual portion that can
be compared against.

Change-Id: I30e85589fce8c17115f511a7a345d46949e6c9e8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-03-17 15:50:30 +01:00
Santhosh Kumar
ee3611ce91 Remove window frame for combo-box widget baseline test case
The window frame differs across ms-windows version and this makes
combobox test case either fail or more fuzzy. To avoid this provide
only window geometry for screen capture instead of complete window
rectangle.

Change-Id: I0f1a1a95c45218ccc69fc92f589baee0135db943
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-03-17 15:03:13 +01: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
Volker Hilsheimer
94039c9a6a Baseline test: add coverage for treeview with alternate rows
After f4976f86cd, alternate rows are no
longer painted all the way, as the code is never called for styles that
don't include the tree item decoration in the selection, such as the
Windows styles.

Add a baseline test to record the appearance of such trees.

Task-number: QTBUG-106227
Pick-to: 6.4 6.2
Change-Id: If21076393fdf65205cab91299f8e557dbe9c4ea9
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2022-10-24 14:20:28 +02:00
Marc Mutz
df9d882d41 Port from container.count()/length() to size()
This is semantic patch using ClangTidyTransformator:

  auto QtContainerClass = expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o)
  makeRule(cxxMemberCallExpr(on(QtContainerClass),
                             callee(cxxMethodDecl(hasAnyName({"count", "length"),
                                                  parameterCountIs(0))))),
           changeTo(cat(access(o, cat("size"), "()"))),
           cat("use 'size()' instead of 'count()/length()'"))

a.k.a qt-port-to-std-compatible-api with config Scope: 'Container'.

<classes> are:

    // sequential:
    "QByteArray",
    "QList",
    "QQueue",
    "QStack",
    "QString",
    "QVarLengthArray",
    "QVector",
    // associative:
    "QHash",
    "QMultiHash",
    "QMap",
    "QMultiMap",
    "QSet",
    // Qt has no QMultiSet

Change-Id: Ibe8837be96e8d30d1846881ecd65180c1bc459af
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-10-04 07:40:08 +02:00
Ivan Solovev
b057e32dc4 Port tests away from using q{Set}GlobalQHashSeed
These functions are marked as deprecated in future Qt releases.

Task-number: QTBUG-104858
Change-Id: I25d2932455d8c9e3e2d722b1c48fc2cfa2d1e679
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-26 14:15:24 +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
fd4186cd23 Fix click position for check box and radio button baseline tests
Some styles override the clickable area.

Pick-to: 6.3
Change-Id: Id6ec9d9aa2faff39489b2baa412af4339779ff5c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2022-03-14 16:13:06 +01:00
Timur Pocheptsov
af05f278ed QMacStyle: fix tool buttons (in checked mode)
While switching to the 'momentary push in' button type, the old code that
shows button as pressed/checked was removed. Since 'square' buttons
were sharing this part with rounded push buttons, the change broke
checked square buttons. So we retain the old code for this particular
case.

Also, add a minimal baseline test for this scenario: square button,
triggering 'toolbutton' style with/out 'checked' state.

Fixes: QTBUG-100802
Pick-to: 6.3 6.2
Change-Id: Ib7b15b13ead834c7bb2cd36de76ccd5bedb07810
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-02-28 08:46:21 +01:00
Axel Spoerl
15caa47e4b Add lineedit and QAbstractItemView widgets in tst_baseline_widgets
Add baseline tests for QListView, QTableView, QTreeView
Add const to reflect number of available standard icons
Add baseline test for QLineEdit

Task-number: QTBUG-99677
Change-Id: I1abaae7f90c9b05c3b3467dc85c5652bc9d0f53b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-02-09 18:19:57 +01:00
Axel Spoerl
005f3ad625 Update widgets inheriting QAbstractSpinbox in tst_baseline_widgets
Create QAbstractSpinBox test
Update test for QSpinBox
Add tests for QDoubleSpinBox, QDateEdit, QTimeEdit
Add test for QDateTimeEdit incl. calendar popup

Task-number: QTBUG-99677
Change-Id: Ia74686f47a1520ab4c7e878b19fc774e00db88dd
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-02-09 08:01:46 +01:00
Axel Spoerl
cb4b29cc2a Extend baseline test for QTabWidget
tabsClosable and documentMode added, merge conflict fixed

Task-number: QTBUG-99773
Pick-to: 6.3
Change-Id: I8eb51b9f434bc97e6e7e55377801c6ee8aec52b0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-02-03 03:23:53 +01:00
Axel Spoerl
2628e897fe Add tab close button in QTabBar baseline test
Fixes: QTBUG-99772
Pick-to: 6.3
Change-Id: I01e0fc78880baae12f46005e4a88db41bea89d65
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2022-02-01 12:47:58 +01:00
Axel Spoerl
878aea3645 Add QTabBar test in tst_baseline_widgets
Task-number: QTBUG-99772
Pick-to: 6.3
Change-Id: I501c8e5c8e3ee1a1d3ac2a36b12f51dab90c88c3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-01-27 02:45:14 +01:00
Axel Spoerl
5d75e9d8b0 Add QScrollBar test in tst_baseline_widgets
Task-number: QTBUG-99882
Pick-to: 6.3
Change-Id: I9e9d3a674c205d26dd008b7de4e4ce31f470bf51
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-01-26 10:00:23 +01:00
Axel Spoerl
5fa35c4f14 Add layout in QRadioButton baseline test for better visualization
Task-number: QTBUG-99749
Pick-to: 6.3
Change-Id: Iafd097d42b312cc24a60107c00e9c52fc0f3cdff
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-01-24 05:57:37 +00:00
Axel Spoerl
e81e91de85 Add QRadioButton test in tst_baseline_widgets
Task-number: QTBUG-99749
Pick-to: 6.3
Change-Id: I89e759e0943b0d1793728a65bfbae6e6b4d3167a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-01-21 12:49:35 +01:00
Axel Spoerl
d99714e316 Add QCheckBox test in tst_baseline_widgets
Task-number: QTBUG-99748
Pick-to: 6.3
Change-Id: I45fe3b102fba4dd6a6f8cd08bab5543f12265aa7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-01-20 22:10:39 +01:00
Axel Spoerl
a620a6bf15 Add QDial test in tst_baseline_widgets
Task-number: QTBUG-99712
Pick-to: 6.3
Change-Id: Ib133dd4c1395060be2aac4d3ca1b17eaccc24676
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-01-18 18:29:00 +01:00
Timur Pocheptsov
f854e77b8e widgets baseline test: add QSpinBox
Very simplistic initial test, inspired by the fix in 'fusion' style,
but not style-specific.

Pick-to: 6.3
Change-Id: I55ceca7ad214c86cb11032c5342bdae2a83852f1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-01-17 21:44:29 +01:00
Axel Spoerl
bf44ca3224 Add QProgressBar test in tst_baseline_widgets
Task-number: QTBUG-99678
Pick-to: 6.3
Change-Id: Ib56f7bdcc1e61d0354a7a381b8089f35e80b931c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-01-14 13:33:24 +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
Volker Hilsheimer
95907f9be4 Add variations of QPushButton with default property set
Change-Id: Ie928575b131c7031da9a4d735159ba3d14ccad6c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-11-24 07:40:47 +01:00
Volker Hilsheimer
79b2a43585 Add baseline test that allows comparing the rendering of widgets
Provide basic boiler plate that sets up the baseline (aka lancelot)
framework specifically for comparing the appearance of widgets, and
implement test functions for QSlider and QPushButton.

Widgets should always look the same if the QPA platform, the OS
version, and certain UI-impacting attributes are identical. Ie.
on any macOS 10.15 machine that runs in "Light" mode, widgets
look the same. On a macOS 11 machine, they might look different.
On an OpenSUSE machine using the fusion style things might look
different from a Ubuntu machine.

The helper function removes DPR differences - images are always
scaled to a DPR of 1.0, which allows us to compare the image\
content and not get distracted by them having different dimensions
(and the fuzzy comparison of images might make the system tolerate
scaling artefacts).

Note: For now, this test is meant to be run locally, either when
testing changes to style code, or when checking how QWidget based
UIs would look on newer version of an operating system. In CI the
test is run, but then skipped in CI as the baseline server is
not configured.

Change-Id: Ie33a9d979d934f0df6883757333ce2c5e2f7ef84
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-11-18 03:36:24 +00:00