SVGItem variable
Hello,
I found that if I set SVGItem variable svg image is not shown. Problem is that SVGItem::updateItemSize function is never called.
I added this overloaded function to lrsvgitem:
bool SVGItem::isNeedUpdateSize(RenderPass) const { return m_image.isNull() ; }
Now the updateItemSize gets called.
The other bug I found is that in updateItemSize when variable is not empty you check if data.type is QVariant::Image but that does not work it should be QVariant::ByteArray.
Here is corrected code:
} else if (!m_variable.isEmpty()){ QVariant data = dataManager->variable(m_variable); if (data.type() == QVariant::String){ m_image = imageFromResource(data.toString()); } else if (data.type() == QVariant::ByteArray) { m_image = data.value<QByteArray>() ; } }
Now you can load image from variable path or variable bytearray.
Thanks, Gorazd