mirror of
https://github.com/fralx/LimeReport.git
synced 2024-12-25 00:54: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);
|
m_picture = QImage(m_resourcePath);
|
||||||
} else if (!m_variable.isEmpty()){
|
} else if (!m_variable.isEmpty()){
|
||||||
QVariant data = dataManager->variable(m_variable);
|
QVariant data = dataManager->variable(m_variable);
|
||||||
|
if (data.type() == QVariant::String){
|
||||||
|
m_picture = QImage(data.toString());
|
||||||
|
} else if (data.type() == QVariant::Image){
|
||||||
loadPictureFromVariant(data);
|
loadPictureFromVariant(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (m_autoSize){
|
if (m_autoSize){
|
||||||
setWidth(m_picture.width());
|
setWidth(m_picture.width());
|
||||||
setHeight(m_picture.height());
|
setHeight(m_picture.height());
|
||||||
@ -140,7 +144,7 @@ void ImageItem::setVariable(const QString& content)
|
|||||||
QString oldValue = m_variable;
|
QString oldValue = m_variable;
|
||||||
m_variable=content;
|
m_variable=content;
|
||||||
update();
|
update();
|
||||||
notify("content", oldValue, m_variable);
|
notify("variable", oldValue, m_variable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user