Commit Graph

68 Commits

Author SHA1 Message Date
Marc Mutz
11d6932560 Mark all of Qt as free of Q_FOREACH, except where it isn't
The density of Q_FOREACH uses in this and some other modules is still
extremely high, too high for anyone to tackle in a short amount of
time. Even if they're not concentrated in just a few TUs, we need to
make progress on a global QT_NO_FOREACH default, so grab the nettle
and stick to our strategy:

Mark the whole of Qt with QT_NO_FOREACH, to prevent new uses from
creeping in, and whitelist the affected TUs by #undef'ing
QT_NO_FOREACH locally, at the top of each file. For TUs that are part
of a larger executable, this requires these files to be compiled
separately, so add them to NO_PCH_SOURCES (which implies
NO_UNITY_BUILD_SOURCES, too).

In tst_qglobal.cpp and tst_qcollections.cpp change the comment on the
#undef QT_NO_FOREACH to indicate that these actually test the macro.

Task-number: QTBUG-115839
Change-Id: Iecc444eb7d43d7e4d037f6e155abe0e14a00a5d6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-08-19 05:19:42 +00:00
Marc Mutz
f2f8820073 tests: port assorted trivial uses of Q_FOREACH to ranged for loops
All of these fall into the trivial category: loops over (readily made)
const local containers. As such, they cannot possibly depend on the
safety copy that Q_FOREACH performs, so are safe to port as-is to
ranged for loops.

There may be more where these came from, but these were the ones that
stood out as immediately obvious when scanning the 100s of uses in
qtbase, so I preferred to directly fix them over white-listing their
files with QT_NO_FOREACH (which still may be necessary for some files,
as this patch may not port all uses in that file).

Pick-to: 6.6 6.5
Task-nubmber: QTBUG-115839
Change-Id: I7b7893bec8254f902660dac24167113aca855029
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-08-14 23:11:54 +03:00
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
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
Ahmad Samir
0d29a406f7 QThread: add sleep(std::chrono::nanoseconds) overload
All the other overloads are implemented using the new one.

Windows change relies on the pre-check in the code review making sure it
compiles.

[ChangeLog][QtCore][QThread] Added sleep(std::chrono::nanoseconds)
overload.

Task-number: QTBUG-110059
Change-Id: I9a4f4bf09041788ec9275093b6b8d0386521e286
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-03-13 23:26:28 +02:00
Eirik Aavitsland
9273bcac7f Lancelot: fix a copy-paste error in the new drawPixmapFragment command
Caused crashes because of uninitialized variable

Pick-to: 6.5
Change-Id: I18f96e47b766415ad49e6a8515bbaa372b122cd3
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-03-07 08:13:55 +01:00
Laszlo Agocs
d57ff481fc Lancelot: add drawPixmapFragment test
Task-number: QTBUG-111416
Pick-to: 6.5
Change-Id: Ife91bbc0bf09e3fcc5c4d8dc06e352eadee1b810
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2023-03-02 12:51:14 +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
70b3df00f9 Silence compiler warnings about unused variables
Change-Id: I02e51868f762292b0a6b57d38a5bd25335b19621
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2022-12-13 05:17:26 +01:00
Eskil Abrahamsen Blomfeldt
58907dfa81 Try to match variant-selector font to preceding character
Variant-selectors are special unicode symbols which are used to
modify glyph selection for the preceding character. For instance,
a regular symbol could be turned into a color emoji using VS16,
the emoji variation selector. In order for this to work, however,
the font that handles the selector has to handle the full pair of
characters, so that it can apply the correct substitution rules.

One specific example of this was on macOS, where an airplane
symbol + VS16 would match the symbol to the default UI font but
the VS16 to the emoji font. Since there string provided for the
emoji font did not have any preceding character for VS16, we just
ignored it.

To improve on this, we now detect variation selectors that have
been matched to different font engines than the preceding
character. When such a case occurs, we check if the selector font
also supports the preceding character, and if it does, we keep
the pair together and use the same font for both.

[ChangeLog][QtGui][Text] Fix some cases where a variation-selector
character would be ignored in font selection and the correct
variant of a character would thus not be selected.

Task-number: QTBUG-108799
Change-Id: I9f427e0520e652ee2f24a4f7dc3c1957251e06bd
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-12-12 19:25:45 +01:00
Marc Mutz
1c6bf3e09e Port from container::count() and length() to size() - V5
This is a semantic patch using ClangTidyTransformator as in
qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8, but extended to
handle typedefs and accesses through pointers, too:

    const std::string o = "object";

    auto hasTypeIgnoringPointer = [](auto type) { return anyOf(hasType(type), hasType(pointsTo(type))); };

    auto derivedFromAnyOfClasses = [&](ArrayRef<StringRef> classes) {
        auto exprOfDeclaredType = [&](auto decl) {
            return expr(hasTypeIgnoringPointer(hasUnqualifiedDesugaredType(recordType(hasDeclaration(decl))))).bind(o);
        };
        return exprOfDeclaredType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))));
    };

    auto renameMethod = [&] (ArrayRef<StringRef> classes,
                            StringRef from, StringRef to) {
        return makeRule(cxxMemberCallExpr(on(derivedFromAnyOfClasses(classes)),
                            callee(cxxMethodDecl(hasName(from), parameterCountIs(0)))),
                        changeTo(cat(access(o, cat(to)), "()")),
                        cat("use '", to, "' instead of '", from, "'"));
    };

    renameMethod(<classes>, "count", "size");
    renameMethod(<classes>, "length", "size");

except that the on() matcher has been replaced by one that doesn't
ignoreParens().

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

Added two NOLINTNEXTLINEs in tst_qbitarray and tst_qcontiguouscache,
to avoid porting calls that explicitly test count().

Change-Id: Icfb8808c2ff4a30187e9935a51cad26987451c22
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-11-03 14:59:24 +01:00
Johannes Kauffmann
a9fa999f79 tests: fix configuring with -no-feature-gui
Pick-to: 6.2 6.4
Change-Id: I99765d38c9c37f1fe17b15f7736e4c78c7ffac20
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-10-29 01:04:09 +02:00
Volker Hilsheimer
483ae6c448 StyleSheet: use item background rule when filling row backround
QTreeView draws the different sub-rects of an item's background over
multiple calls to drawPrimitive(PE_PanelItemViewRow). The item row is
not separately stylable, but the item might have a styled background
property. To get a consistent background, we must use the item's
background rule when filling the item's row background.

To fix that, delegate the filling of the branch background to
drawPrimitive(PE_PanelItemViewRow), and implement PE_PanelItemViewRow
handling to render the rule for the ViewItem pseudo element if there is
a background rule defined for it.

Add a baseline test stylesheet for this scenario. Note that the selection
in an item view is better styled via the selection-background-color
qss property.

Task-number: QTBUG-73251
Task-number: QTBUG-106227
Pick-to: 6.4 6.2
Change-Id: I5d0c170f78009fe5015dd749975e6df27485b3b8
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-10-25 05:16:15 +02:00
Volker Hilsheimer
6f9d31be49 Baseline: add stylesheet setting show-decoration-selected for treeview
The fix for QTBUG-73251 in f4976f86cd
resulted in QTBUG-106227. Add baseline test coverage for the respective
configuration to make sure we don't regress.

Refactor mapping of index to configuration to make accessing of subitems
more robust.

Task-number: QTBUG-73251
Pick-to: 6.4 6.2
Change-Id: I530ecd67fa5663f219884f641bc5e25c7ac5fe73
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2022-10-25 05:16:15 +02: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
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
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
32df595275 Change the license of all CMakeLists.txt and *.cmake files to BSD
Task-number: QTBUG-105718
Change-Id: I5d3ef70a31235868b9be6cb479b7621bf2a8ba39
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-23 23:58:42 +02:00
Lucie Gérard
fb1b20eab3 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: I3b98cdc55ead806ec81ce09af9271f9b95af97fa
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-03 17:14:55 +02:00
Alexandru Croitor
4d22405e48 CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers
Change-Id: I9b7404e1d3a78fe0726ec0f5ce1461f6c209e90d
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-07-28 14:46:53 +02:00
Kai Köhne
9d2cc4dd76 Fix typos in docs and comments
Found by codespell

Pick-to: 6.4
Change-Id: Ie3e301a23830c773a2e9aff487c702a223d246eb
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-06-15 21:31:02 +02:00
Eirik Aavitsland
f67d89ebde Support cosmetic brush patterns in the pdf and opengl paint engines
This implements the recent functionality extension of painting
cosmetic (untransformed) brush patterns, and the corresponding
NonCosmeticBrushPatterns render hint, in the pdf and opengl paint
engines.

As part of the implementation it also fixes a couple of pre-existing
bugs in the opengl engine, relating to updating the brush after
changes in transformation or brush origin.

As a driveby, it also includes a minor fix for the lance testing tool:
request stencil buffer, as that is needed and not always provided by
default. This echoes a recent fix done to tst_baseline_painting.

Change-Id: Ia8811477e015eebeb40ed138bca96643ce1ab0dc
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-06-04 21:15:42 +02:00
Eirik Aavitsland
5adaa8d868 Add painter render hint for brush pattern transformation
[ChangeLog][QtGui][QPainter] In Qt 5, the predefined brush patterns
would always be transformed along with the object being painted. In Qt
6.0 onwards, they would or would not, depending on the
SmoothPixmapTransformation render hint. Instead of this somewhat
surprising behavior, make the default be untransformed
(i.e. cosmetic), which makes sense when it comes to dpr scaling. For
the cases where one wants scaling, a new render hint is introduced to
enable that: NonCosmeticPatternBrushes.

Change-Id: I2208c7a28af9056d7ab97a529b66bf2d502c3c4f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-05-31 21:20:41 +02:00
Volker Hilsheimer
9d41bd4312 Stylesheet: Another positioning fix for the menu indicator
Draw tool button menu indicator relative to frame, not content, so that
padding added in the stylesheet creates room between text and indicator.

Also, prevent another double-arrow by ignoring menu indicator rendering
when a menu button subcontrol is used, as the two are mutually
exclusive. This amends 1c338e6d07.

Add problematic case to stylesheet baseline test.

Fixes: QTBUG-102866
Pick-to: 6.3 6.2
Change-Id: I5d79e65b33a2e41ac07c8efe0c15697c5be65201
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-05-18 13:15:00 +02:00
Volker Hilsheimer
1c338e6d07 Stylesheet: fix toolbutton menu indicator rendering
Turn off native indicators if we have custom rules, and if we drew
natively, don't draw custom indicators. This amends
ea0e0a8652 which turned off custom drawing
too aggressively, removing custom indicators also if no custom drop
down arrow (which is only relevant for drop down menu buttons) was set.

When then drawing the custom indicator, respect positioning rules in the
style sheet.

Extend baseline test.

Fixes: QTBUG-102866
Pick-to: 6.3 6.2
Change-Id: I5ca353f42e704ec3f6e57677c35118a9cb358b0b
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-05-16 20:32:27 +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
2b99a71b22 Stylesheet: Don't ignore item check indicator styling
Amends cf52d725156811754cd4e094b0984864795d1d58, after which most
indicator styling was no longer taken into account unless some other
item aspects were styled. Calling the baseStyle to draw the entire item
doesn't call back into the style sheet style for the indicator itself.

The QCommonStyle code that breaks the item up into individual sub
elements cannot be called for each element. E.g. turning off the check
indicator feature changes the layout of the item.

So if the indicator is styled, then we have to draw an otherwise empty
item with the style sheet style, and then clip the already painted rect
before calling the base style to draw text and highlighting with the
correct palette.

Add baseline test for QTreeView with different style sheets.

Fixes: QTBUG-102820
Pick-to: 6.3 6.2
Change-Id: I1da5676cc63556230eac525bc550457ebd495a58
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-05-06 03:48:09 +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
Eirik Aavitsland
0ff7328f37 Improve surface format request for baseline test of GL painter
Different platforms and drivers hae different defaults, so make sure
to request what we need.

Pick-to: 6.3 6.2
Change-Id: I54ae6e0770fea53fbf59c86d7e55aa5897292b67
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2022-04-06 12:44:40 +02:00
Tor Arne Vestbø
496bf5a946 lance: Handle unspecified size or weight in setFont command
We have test cases that call setFont without a specified weight, in
which case we would end up parsing an empty string into a number,
giving a weight of 0. This weight would in turn result in the
thinnest font on the system, which presumably was not the intent.

We now use default sizes and weights (similar to the default QFont
constructor arguments) if we're missing those arguments to setFont.

Pick-to: 6.2 6.3 5.15
Change-Id: I5a96f08cfa1b9e4f1de5edee6bf69ddd46f0ce92
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2022-03-31 20:54:29 +02:00
Eirik Aavitsland
9619cec279 Baseline testing: Fix overriding of Project property
Remove some kludgy, redundant and never used functionality for setting
project and test case names, as it also hindered overriding those
properties at runtime.

Pick-to: 6.3 6.2
Change-Id: Ibef7d7d0cb5fc1e462752f2ba2db76cc088dbd48
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-03-17 14:27:44 +01: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
Eirik Aavitsland
f46db29d8c Painting: fix overriding and combining different clip types
In a recent improvement (6de36918c0) the
last set clip region or path was stored in separate variables, in
order to be set again if the aliasing mode changed. That solution was
too simplistic, as it would break down as soon as more than one clip
area was set, with the latter either replacing or intersecting the
first. It was also unnecessary to introduce new storing of clip areas
and transforms, as those are already recorded in the clipInfo stack in
the painter state. This patch hence reverts much of that implementation.

However the basic idea of setting the clip area again after AA change
is good, so that part is kept, implementated instead by calling a
pre-existing function to replay the clipInfo stack.

One of the baseline test cases is extended to excercise the
combination of clip areas. As a driveby, support for setClipRectF is
added to the painting baseline test scripts, and the build of the
manual lance tool is fixed.

Fixes: QTBUG-101474
Pick-to: 6.3 6.2
Change-Id: Ide8b70d8cbf138deb06cbb84f69e62f7405886e6
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-03-15 12:45:46 +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
16d154ca5f Baseline: Allow setting git commit through environment variable
Widget tests run in VMs that don't have their own git clone.

Pick-to: 6.3
Change-Id: I20ab32affabfc7ce6dfaa445306b19efb51803e9
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2022-03-14 23:38:09 +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
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
43b25286ce Update QToolButton texts and add more stylesheets to test with
Adapt QToolButton texts to descriptive versions.
Add dummy stylesheet that will be used for all test functions, and a
specific style sheet to test rendering of QToolButton with a menu button.

Task-number: QTBUG-100401
Pick-to: 6.3 6.2
Change-Id: I5440407ddb3ea5b45124e77a6f0d1013362b4398
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-02-16 16:41:43 +00: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