Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-129419

TestCase: add a function to test for existence of pixels of a certain colour

    XMLWordPrintable

Details

    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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              macadder Jason McDonald
              mitch_curtis Mitch Curtis
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes