diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2010-11-03 11:10:01 (GMT) |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2010-11-03 11:50:11 (GMT) |
commit | acc1a2bd5520369c690c2769f067aec6bfd869f2 (patch) | |
tree | 02fdfc292c9fc8e51275c8c2ce8327e2611c614f /tests/auto/qpixmap | |
parent | 966613212de269421944a5df355f54c5a6b36c17 (diff) | |
download | Qt-acc1a2bd5520369c690c2769f067aec6bfd869f2.zip Qt-acc1a2bd5520369c690c2769f067aec6bfd869f2.tar.gz Qt-acc1a2bd5520369c690c2769f067aec6bfd869f2.tar.bz2 |
Fixed grabWidget sometimes returning uninitialized memory.
Use a QImage initialized with transparent to prevent any translucent
parts of the widget to end up as garbage, and to ensure that the
resulting QPixmap ends up with an alpha format only when needed.
Task-number: QTBUG-14945
Reviewed-by: Kim
Diffstat (limited to 'tests/auto/qpixmap')
-rw-r--r-- | tests/auto/qpixmap/tst_qpixmap.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp index fdf8311..a733d56 100644 --- a/tests/auto/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/qpixmap/tst_qpixmap.cpp @@ -817,7 +817,7 @@ void tst_QPixmap::grabWidget() 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] = qRgb(rand() & 255, row, col); + line[col] = qRgba(rand() & 255, row, col, 127); } QPalette pal = widget.palette(); |