forked from qt-creator/qt-creator
QmlDesigner: Add light/camera icons when exporting a bundle
Fixes: QDS-13310 Change-Id: I6d15f91fa664eb7b861ed2acfba916e35900ae90 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Shrief Gabr <shrief.gabr@qt.io>
This commit is contained in:
@@ -1016,11 +1016,19 @@ void ContentLibraryView::exportLibItem(const ModelNode &node, const QPixmap &ico
|
|||||||
m_zipWriter->addFile(assetPath.relativePath, assetPath.absFilPath().fileContents().value_or(""));
|
m_zipWriter->addFile(assetPath.relativePath, assetPath.absFilPath().fileContents().value_or(""));
|
||||||
|
|
||||||
// add icon
|
// add icon
|
||||||
|
QPixmap iconPixmapToSave;
|
||||||
|
if (node.metaInfo().isQtQuick3DCamera())
|
||||||
|
iconPixmapToSave = m_widget->iconProvider()->requestPixmap("camera.png", nullptr, {});
|
||||||
|
else if (node.metaInfo().isQtQuick3DLight())
|
||||||
|
iconPixmapToSave = m_widget->iconProvider()->requestPixmap("light.png", nullptr, {});
|
||||||
|
else
|
||||||
|
iconPixmapToSave = iconPixmap;
|
||||||
|
|
||||||
m_iconSavePath = targetPath.pathAppended(iconPath);
|
m_iconSavePath = targetPath.pathAppended(iconPath);
|
||||||
if (iconPixmap.isNull())
|
if (iconPixmapToSave.isNull())
|
||||||
model()->nodeInstanceView()->previewImageDataForGenericNode(node, {}, {}, EXPORT_ITEM_REQ_ID);
|
model()->nodeInstanceView()->previewImageDataForGenericNode(node, {}, {}, EXPORT_ITEM_REQ_ID);
|
||||||
else
|
else
|
||||||
addIconAndCloseZip(iconPixmap);
|
addIconAndCloseZip(iconPixmapToSave);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ContentLibraryView::addIconAndCloseZip(const auto &image) { // auto: QImage or QPixmap
|
void ContentLibraryView::addIconAndCloseZip(const auto &image) { // auto: QImage or QPixmap
|
||||||
|
|||||||
Reference in New Issue
Block a user