Materials: Add support for embedded images
Adds support for file types other than PNG to embedded images in materials. Adds checks to prevent crashing when an unsupported image type is used.
This commit is contained in:
committed by
Chris Hennes
parent
21eff41238
commit
3515db4a3b
@@ -126,7 +126,7 @@ void BaseDelegate::paintImage(QPainter* painter,
|
||||
QImage img;
|
||||
if (!propertyValue.isEmpty()) {
|
||||
QByteArray by = QByteArray::fromBase64(propertyValue.toUtf8());
|
||||
img = QImage::fromData(by, "PNG").scaled(64, 64, Qt::KeepAspectRatio);
|
||||
img = QImage::fromData(by).scaled(64, 64, Qt::KeepAspectRatio);
|
||||
}
|
||||
QRect target(option.rect);
|
||||
if (target.width() > target.height()) {
|
||||
|
||||
Reference in New Issue
Block a user