mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2024-12-24 12:34:39 +03:00
Image variable can contain a resource path.
This commit is contained in:
parent
8b3a8a138e
commit
896aa656c7
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user