mirror of
https://github.com/fralx/LimeReport.git
synced 2024-12-24 16:44:39 +03:00
Image variable can contain a resource path.
This commit is contained in:
parent
8b3a8a138e
commit
896aa656c7
@ -105,9 +105,13 @@ void ImageItem::updateItemSize(DataSourceManager* dataManager, RenderPass pass,
|
||||
m_picture = QImage(m_resourcePath);
|
||||
} else if (!m_variable.isEmpty()){
|
||||
QVariant data = dataManager->variable(m_variable);
|
||||
if (data.type() == QVariant::String){
|
||||
m_picture = QImage(data.toString());
|
||||
} else if (data.type() == QVariant::Image){
|
||||
loadPictureFromVariant(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (m_autoSize){
|
||||
setWidth(m_picture.width());
|
||||
setHeight(m_picture.height());
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user