forked from qt-creator/qt-creator
QmlDesigner: Use unique image key for each import 3D preview icon
The shared memory is allocated based on the key, so if every icon is sent with same key, they will use the same shared memory. If QDS side doesn't read the image before the next image is written into the shared memory, QDS side will get wrong image if all images use same key. Fixes: QDS-13013 Change-Id: Ie8188520a76ca057a5b0f0927a7726652609fa35 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
@@ -345,7 +345,8 @@ void Qt5Import3dNodeInstanceServer::render()
|
|||||||
if (!data.name.isEmpty()) {
|
if (!data.name.isEmpty()) {
|
||||||
QSizeF iconSize = m_iconView3D->size();
|
QSizeF iconSize = m_iconView3D->size();
|
||||||
QImage iconImage = renderImage.copy(0, 0, iconSize.width(), iconSize.height());
|
QImage iconImage = renderImage.copy(0, 0, iconSize.width(), iconSize.height());
|
||||||
ImageContainer imgContainer(0, iconImage, 1000001);
|
static qint32 renderId = 1000001;
|
||||||
|
ImageContainer imgContainer(0, iconImage, ++renderId);
|
||||||
QVariantList cmdData;
|
QVariantList cmdData;
|
||||||
cmdData.append(data.name);
|
cmdData.append(data.name);
|
||||||
cmdData.append(QVariant::fromValue(imgContainer));
|
cmdData.append(QVariant::fromValue(imgContainer));
|
||||||
|
Reference in New Issue
Block a user