QMacCGContext::initialize: Handle QPixmap without platform pixmap

Regression after 585150e3d947d0ee30489f275e7fc39bce4fe059.

Pick-to: 6.5 6.6
Change-Id: Ie728904736dd41fb8dfa6ecc9f843beea95b4604
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Tim Jenssen 2023-05-26 10:27:10 +02:00 committed by Tor Arne Vestbø
parent 3c12c3d58c
commit 195c893424

View File

@ -386,11 +386,14 @@ void QMacCGContext::initialize(QPaintDevice *paintDevice)
// Find the underlying QImage of the paint device
switch (int deviceType = paintDevice->devType()) {
case QInternal::Pixmap: {
auto *platformPixmap = static_cast<QPixmap*>(paintDevice)->handle();
if (platformPixmap && platformPixmap->classId() == QPlatformPixmap::RasterClass)
initialize(platformPixmap->buffer());
else
qWarning() << "QMacCGContext: Unsupported pixmap class" << platformPixmap->classId();
if (auto *platformPixmap = static_cast<QPixmap*>(paintDevice)->handle()) {
if (platformPixmap->classId() == QPlatformPixmap::RasterClass)
initialize(platformPixmap->buffer());
else
qWarning() << "QMacCGContext: Unsupported pixmap class" << platformPixmap->classId();
} else {
qWarning() << "QMacCGContext: Empty platformPixmap";
}
break;
}
case QInternal::Image: