Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
None
-
None
Description
There's no simple way to check if a grabbed image actually has non-white (or any other colour) pixels. I'm proposing something like this for the type returned by TestCase's grabImage function:
int numberOfPixelsOfColor(color)
or just:
bool hasPixelsOfColor(color)
Our own tests already have similar checks and/or helpers:
- getPaintedPixels in tests/auto/gui/painting/qpainter/tst_qpainter.cpp
- The "foundPixel" checks in in tests/auto/gui/painting/qpainter/tst_qpainter.cpp
- numberOfNonWhitePixels in tests/auto/quick/qquicktext/tst_qquicktext.cpp and tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp
- containsSomethingOtherThanWhite in tests/auto/quick/scenegraph/tst_scenegraph.cpp
So we should add a function to QTest as well, or even QImage.
Attachments
Issue Links
- relates to
-
QTBUG-67221 Expose QImage of TestCase::grabImage
-
- Reported
-