0
0
mirror of https://github.com/fralx/LimeReport.git synced 2025-10-03 12:04:05 +03:00

SVGItem default editor has been added

This commit is contained in:
Arin Alexander
2020-03-19 20:09:35 +03:00
parent bd905f8daa
commit 3a09d1198a
16 changed files with 190 additions and 36 deletions

View File

@@ -141,6 +141,37 @@ QWidget *ImageItem::defaultEditor()
return editor;
}
QByteArray ImageItem::imageAsByteArray() const
{
QByteArray result;
QBuffer buffer(&result);
buffer.open(QIODevice::WriteOnly);
m_picture.save(&buffer,"PNG");
return result;
}
void ImageItem::setImageAsByteArray(QByteArray image)
{
QImage value;
value.loadFromData(image);
if (m_picture != value){
QImage oldValue = m_picture;
m_picture = value;
if (m_autoSize){
setWidth(m_picture.width());
setHeight(m_picture.height());
}
update();
notify("image",oldValue,value);
}
}
QString ImageItem::fileFilter() const
{
return tr("Images (*.gif *.icns *.ico *.jpeg *.tga *.tiff *.wbmp *.webp *.png *.jpg *.bmp);;All(*.*)");
}
void ImageItem::updateItemSize(DataSourceManager* dataManager, RenderPass pass, int maxHeight)
{