From 24c9fa1827d61df9295c8b7ecc29b8ace9e6792e Mon Sep 17 00:00:00 2001 From: Arin Alex Date: Thu, 22 Mar 2018 17:17:04 +0300 Subject: [PATCH 1/2] Watermark property has been added to TextItem and ImageItem --- limereport/items/lrimageitem.h | 1 + limereport/items/lrtextitem.h | 1 + limereport/lrbasedesignintf.cpp | 16 +++++++++++++++- limereport/lrbasedesignintf.h | 4 ++++ limereport/lrreportrender.cpp | 5 ++++- 5 files changed, 25 insertions(+), 2 deletions(-) diff --git a/limereport/items/lrimageitem.h b/limereport/items/lrimageitem.h index 18b236f..77ea8db 100644 --- a/limereport/items/lrimageitem.h +++ b/limereport/items/lrimageitem.h @@ -47,6 +47,7 @@ class ImageItem : public LimeReport::ItemDesignIntf Q_PROPERTY(bool keepAspectRatio READ keepAspectRatio WRITE setKeepAspectRatio) Q_PROPERTY(bool center READ center WRITE setCenter) Q_PROPERTY(QString resourcePath READ resourcePath WRITE setResourcePath) + Q_PROPERTY(bool watermark READ isWatermark WRITE setWatermark) public: enum Format { Binary = 0, diff --git a/limereport/items/lrtextitem.h b/limereport/items/lrtextitem.h index f743d3d..ff02e06 100644 --- a/limereport/items/lrtextitem.h +++ b/limereport/items/lrtextitem.h @@ -71,6 +71,7 @@ class TextItem : public LimeReport::ContentItemDesignIntf, IPageInit { Q_PROPERTY(BrushStyle backgroundBrushStyle READ backgroundBrushStyle WRITE setBackgroundBrushStyle) Q_PROPERTY(qreal textIndent READ textIndent WRITE setTextIndent) Q_PROPERTY(Qt::LayoutDirection textLayoutDirection READ textLayoutDirection WRITE setTextLayoutDirection) + Q_PROPERTY(bool watermark READ isWatermark WRITE setWatermark) public: enum AutoWidth{NoneAutoWidth,MaxWordLength,MaxStringLength}; diff --git a/limereport/lrbasedesignintf.cpp b/limereport/lrbasedesignintf.cpp index e5591ed..83d9c7a 100644 --- a/limereport/lrbasedesignintf.cpp +++ b/limereport/lrbasedesignintf.cpp @@ -78,7 +78,8 @@ BaseDesignIntf::BaseDesignIntf(const QString &storageTypeName, QObject *owner, Q m_changingItemAlign(false), m_borderColor(Qt::black), m_reportSettings(0), - m_patternName("") + m_patternName(""), + m_watermark(false) { setGeometry(QRectF(0, 0, m_width, m_height)); if (BaseDesignIntf *item = dynamic_cast(parent)) { @@ -701,6 +702,19 @@ void BaseDesignIntf::turnOnSelectionMarker(bool value) } } +bool BaseDesignIntf::isWatermark() const +{ + return m_watermark; +} + +void BaseDesignIntf::setWatermark(bool watermark) +{ + if (m_watermark != watermark){ + m_watermark = watermark; + notify("watermark",!watermark,watermark); + } +} + QString BaseDesignIntf::patternName() const { return (m_patternName.isEmpty()) ? objectName() : m_patternName; diff --git a/limereport/lrbasedesignintf.h b/limereport/lrbasedesignintf.h index ecced96..7c72a21 100644 --- a/limereport/lrbasedesignintf.h +++ b/limereport/lrbasedesignintf.h @@ -282,6 +282,9 @@ public: Q_INVOKABLE QString setItemPosX(qreal xValue); Q_INVOKABLE QString setItemPosY(qreal yValue); + bool isWatermark() const; + void setWatermark(bool watermark); + protected: //ICollectionContainer @@ -396,6 +399,7 @@ private: QColor m_borderColor; ReportSettings* m_reportSettings; QString m_patternName; + bool m_watermark; signals: void geometryChanged(QObject* object, QRectF newGeometry, QRectF oldGeometry); void posChanged(QObject* object, QPointF newPos, QPointF oldPos); diff --git a/limereport/lrreportrender.cpp b/limereport/lrreportrender.cpp index 6475f15..ed72282 100644 --- a/limereport/lrreportrender.cpp +++ b/limereport/lrreportrender.cpp @@ -640,7 +640,10 @@ void ReportRender::renderPageItems(PageItemDesignIntf* patternPage) m_renderPageItem->restoreLinks(); m_renderPageItem->updateSubItemsSize(FirstPass,m_datasources); foreach(BaseDesignIntf* item, pageItems){ - item->setZValue(item->zValue()-100000); + if (!item->isWatermark()) + item->setZValue(item->zValue()-100000); + else + item->setZValue(item->zValue()+100000); } } From 87f5451cda24f40b2d86ba769017e46756999737 Mon Sep 17 00:00:00 2001 From: Arin Alex Date: Thu, 22 Mar 2018 17:21:02 +0300 Subject: [PATCH 2/2] Version changed to 1.4.69 --- common.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.pri b/common.pri index 485bc51..4feb9cb 100644 --- a/common.pri +++ b/common.pri @@ -62,7 +62,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MINOR = 4 -LIMEREPORT_VERSION_RELEASE = 68 +LIMEREPORT_VERSION_RELEASE = 69 LIMEREPORT_VERSION = '\\"$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}\\"' DEFINES += LIMEREPORT_VERSION_STR=\"$${LIMEREPORT_VERSION}\"