From e5555900087e26914384d9573350f9367357b226 Mon Sep 17 00:00:00 2001 From: Arin Alex Date: Thu, 19 Apr 2018 22:39:17 +0300 Subject: [PATCH 1/2] backgroundMode property added to the band items --- limereport/lrbanddesignintf.cpp | 25 +++++++++++++++++++------ limereport/lrbanddesignintf.h | 4 ++++ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/limereport/lrbanddesignintf.cpp b/limereport/lrbanddesignintf.cpp index 927081b..4e3b5fc 100644 --- a/limereport/lrbanddesignintf.cpp +++ b/limereport/lrbanddesignintf.cpp @@ -182,14 +182,27 @@ QString BandDesignIntf::translateBandName(const BaseDesignIntf* item) const{ } } +void BandDesignIntf::setBackgroundModeProperty(BaseDesignIntf::BGMode value) +{ + if (value!=backgroundMode()){ + BaseDesignIntf::BGMode oldValue = backgroundMode(); + setBackgroundMode(value); + notify("backgroundMode",oldValue,value); + } +} + +void BandDesignIntf::setBackgroundOpacity(int value) +{ + if (opacity()!=value){ + int oldValue = opacity(); + setOpacity(value); + notify("backgroundOpacity",oldValue,value); + } +} + void BandDesignIntf::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { - - if ( !(backgroundColor() == Qt::white && backgroundBrushStyle() == SolidPattern) ) { - QBrush brush(backgroundColor(), static_cast(backgroundBrushStyle())); - brush.setTransform(painter->worldTransform().inverted()); - painter->fillRect(rect(), brush); - } + prepareRect(painter, option, widget); if (itemMode() & DesignMode){ painter->save(); diff --git a/limereport/lrbanddesignintf.h b/limereport/lrbanddesignintf.h index 5f56beb..7bf8401 100644 --- a/limereport/lrbanddesignintf.h +++ b/limereport/lrbanddesignintf.h @@ -105,6 +105,8 @@ class BandDesignIntf : public ItemsContainerDesignInft Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor) Q_PROPERTY(BrushStyle backgroundBrushStyle READ backgroundBrushStyle WRITE setBackgroundBrushStyle) Q_PROPERTY(bool printIfEmpty READ printIfEmpty WRITE setPrintIfEmpty) + Q_PROPERTY(BGMode backgroundMode READ backgroundMode WRITE setBackgroundModeProperty) + Q_PROPERTY(int backgroundOpacity READ opacity WRITE setBackgroundOpacity) Q_ENUMS(BandColumnsLayoutType) friend class BandMarker; friend class BandNameLabel; @@ -235,6 +237,8 @@ public: QColor alternateBackgroundColor() const; void setAlternateBackgroundColor(const QColor &alternateBackgroundColor); qreal bottomSpace() const; + void setBackgroundModeProperty(BGMode value); + void setBackgroundOpacity(int value); signals: void bandRendered(BandDesignIntf* band); protected: From 017c280ff67a0202a81792467033b95e4bc2543e Mon Sep 17 00:00:00 2001 From: Arin Alex Date: Thu, 19 Apr 2018 22:40:04 +0300 Subject: [PATCH 2/2] Version changed --- common.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.pri b/common.pri index b2cb30a..17e0291 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 = 76 +LIMEREPORT_VERSION_RELEASE = 77 LIMEREPORT_VERSION = '\\"$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}\\"' DEFINES += LIMEREPORT_VERSION_STR=\"$${LIMEREPORT_VERSION}\"