forked from qt-creator/qt-creator
QmlDesigner: Convert the form editor preview image to correct format
We were passing the image with premultiplied alpha obtained from QSGRhiLayer::toImage() to be shown in form editor. This corrupts the colors in with 3D materials having partially transparent colors. Converting the image to QImage::Format_ARGB32 format fixes the issue. Fixes: QDS-7474 Change-Id: Id0b689d7e2d9fc111e98f28b18db0af3ac30041f Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -489,7 +489,7 @@ QImage Qt5NodeInstanceServer::grabItem(QQuickItem *item)
|
|||||||
layer->scheduleUpdate();
|
layer->scheduleUpdate();
|
||||||
|
|
||||||
if (layer->updateTexture())
|
if (layer->updateTexture())
|
||||||
renderImage = layer->toImage();
|
renderImage = layer->toImage().convertToFormat(QImage::Format_ARGB32);
|
||||||
else
|
else
|
||||||
qWarning() << __FUNCTION__ << "Failed to update layer texture";
|
qWarning() << __FUNCTION__ << "Failed to update layer texture";
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user