0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-24 00:33:02 +03:00

Image variable can contain a resource path.

This commit is contained in:
Arin Alexander 2019-01-08 18:02:12 +03:00
parent 8b3a8a138e
commit 896aa656c7

View File

@ -105,7 +105,11 @@ void ImageItem::updateItemSize(DataSourceManager* dataManager, RenderPass pass,
m_picture = QImage(m_resourcePath);
} else if (!m_variable.isEmpty()){
QVariant data = dataManager->variable(m_variable);
loadPictureFromVariant(data);
if (data.type() == QVariant::String){
m_picture = QImage(data.toString());
} else if (data.type() == QVariant::Image){
loadPictureFromVariant(data);
}
}
}
if (m_autoSize){
@ -140,7 +144,7 @@ void ImageItem::setVariable(const QString& content)
QString oldValue = m_variable;
m_variable=content;
update();
notify("content", oldValue, m_variable);
notify("variable", oldValue, m_variable);
}
}