From e4f1c62f4c03ef3dd889fc7460c5992a646b6e44 Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Sat, 20 Feb 2021 15:40:13 +0300 Subject: [PATCH] SvgItem has been fixed --- common.pri | 2 +- limereport/items/lrsvgitem.cpp | 6 ++++-- limereport/items/lrsvgitem.h | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/common.pri b/common.pri index 8fe2096..b564c6f 100644 --- a/common.pri +++ b/common.pri @@ -133,7 +133,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MINOR = 5 -LIMEREPORT_VERSION_RELEASE = 80 +LIMEREPORT_VERSION_RELEASE = 81 LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}' DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\" diff --git a/limereport/items/lrsvgitem.cpp b/limereport/items/lrsvgitem.cpp index 7595b13..fe3c1a1 100644 --- a/limereport/items/lrsvgitem.cpp +++ b/limereport/items/lrsvgitem.cpp @@ -110,8 +110,8 @@ void SVGItem::updateItemSize(DataSourceManager *dataManager, RenderPass pass, in QVariant data = dataManager->variable(m_variable); if (data.type() == QVariant::String){ m_image = imageFromResource(data.toString()); - } else if (data.type() == QVariant::Image){ - m_image = data.value(); + } else if (data.type() == QVariant::ByteArray) { + m_image = data.value() ; } } } @@ -142,6 +142,8 @@ void SVGItem::setVariable(const QString &variable) m_variable = variable; } +bool SVGItem::isNeedUpdateSize(RenderPass) const { return m_image.isNull() ; } + QString SVGItem::resourcePath() const { return m_resourcePath; diff --git a/limereport/items/lrsvgitem.h b/limereport/items/lrsvgitem.h index 36aea98..95b359b 100644 --- a/limereport/items/lrsvgitem.h +++ b/limereport/items/lrsvgitem.h @@ -37,7 +37,7 @@ public: void setField(const QString &field); QString variable() const; void setVariable(const QString &variable); - + bool isNeedUpdateSize(RenderPass) const; protected: BaseDesignIntf *createSameTypeItem(QObject *owner, QGraphicsItem *parent); void updateItemSize(DataSourceManager *dataManager, RenderPass pass, int maxHeight);