summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/image
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/gui/image')
-rw-r--r--tests/auto/gui/image/qpixmap/tst_qpixmap.cpp43
1 files changed, 0 insertions, 43 deletions
diff --git a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
index 563baef486..c7652e445f 100644
--- a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
@@ -48,7 +48,6 @@
#include <qmatrix.h>
#include <qdesktopwidget.h>
#include <qpaintengine.h>
-#include <qtreewidget.h>
#include <qsplashscreen.h>
#include <qplatformpixmap_qpa.h>
@@ -111,7 +110,6 @@ private slots:
void setGetMask();
void cacheKey();
void drawBitmap();
- void grabWidget();
void grabWindow();
void isNull();
void task_246446();
@@ -718,47 +716,6 @@ void tst_QPixmap::drawBitmap()
QVERIFY(lenientCompare(pixmap, expected));
}
-void tst_QPixmap::grabWidget()
-{
- for (int opaque = 0; opaque < 2; ++opaque) {
- QWidget widget;
- QImage image(128, 128, opaque ? QImage::Format_RGB32 : QImage::Format_ARGB32_Premultiplied);
- for (int row = 0; row < image.height(); ++row) {
- QRgb *line = reinterpret_cast<QRgb *>(image.scanLine(row));
- for (int col = 0; col < image.width(); ++col)
- line[col] = qRgba(rand() & 255, row, col, opaque ? 255 : 127);
- }
-
- QPalette pal = widget.palette();
- pal.setBrush(QPalette::Window, QBrush(image));
- widget.setPalette(pal);
- widget.resize(128, 128);
-
- QPixmap expected(64, 64);
- if (!opaque)
- expected.fill(Qt::transparent);
-
- QPainter p(&expected);
- p.translate(-64, -64);
- p.drawTiledPixmap(0, 0, 128, 128, pal.brush(QPalette::Window).texture(), 0, 0);
- p.end();
-
- QPixmap actual = QPixmap::grabWidget(&widget, QRect(64, 64, 64, 64));
- QVERIFY(lenientCompare(actual, expected));
-
- actual = QPixmap::grabWidget(&widget, 64, 64);
- QVERIFY(lenientCompare(actual, expected));
-
- // Make sure a widget that is not yet shown is grabbed correctly.
- QTreeWidget widget2;
- actual = QPixmap::grabWidget(&widget2);
- widget2.show();
- expected = QPixmap::grabWidget(&widget2);
-
- QVERIFY(lenientCompare(actual, expected));
- }
-}
-
void tst_QPixmap::grabWindow()
{
// ### fixme: Check platforms