QCocoaBackingStore: Initialize non-opaque images with transparent color

In particular, this is needed when a QWidget has WA_TranslucentBackground set
and nobody is painting anything behind it (except maybe some native view).

Change-Id: Ib1f0714f85fa7eeced527617ecd09bb2ed6ddfc9
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
This commit is contained in:
Gabriel de Dietrich 2013-09-25 18:18:47 +02:00 committed by The Qt Project
parent c533e80e31
commit 79fc0ff67a

View File

@ -77,6 +77,8 @@ QPaintDevice *QCocoaBackingStore::paintDevice()
? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32;
m_qImage = QImage(m_requestedSize * scaleFactor, format);
m_qImage.setDevicePixelRatio(scaleFactor);
if (format == QImage::Format_ARGB32_Premultiplied)
m_qImage.fill(Qt::transparent);
}
return &m_qImage;
}