From eb6e17408053bd166b77b6eeeb009706ecfe8255 Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Wed, 6 Apr 2016 21:35:13 +0400 Subject: [PATCH] Border color property has been added --- limereport/lrbasedesignintf.cpp | 20 ++++++++++++++++++-- limereport/lrbasedesignintf.h | 5 +++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/limereport/lrbasedesignintf.cpp b/limereport/lrbasedesignintf.cpp index dc64ae8..bf94c02 100644 --- a/limereport/lrbasedesignintf.cpp +++ b/limereport/lrbasedesignintf.cpp @@ -74,7 +74,8 @@ BaseDesignIntf::BaseDesignIntf(const QString &storageTypeName, QObject *owner, Q m_backgroundBrushcolor(Qt::white), m_margin(4), m_itemAlign(DesignedItemAlign), - m_changingItemAlign(false) + m_changingItemAlign(false), + m_borderColor(Qt::black) { setGeometry(QRectF(0, 0, m_width, m_height)); if (BaseDesignIntf *item = dynamic_cast(parent)) { @@ -625,6 +626,21 @@ void BaseDesignIntf::turnOnSelectionMarker(bool value) } } +QColor BaseDesignIntf::borderColor() const +{ + return m_borderColor; +} + +void BaseDesignIntf::setBorderColor(const QColor &borderColor) +{ + if (m_borderColor != borderColor){ + QColor oldValue = m_borderColor; + m_borderColor = borderColor; + notify("borderColor",oldValue,borderColor); + update(); + } +} + void BaseDesignIntf::setItemAlign(const ItemAlign &itemAlign) { if (m_itemAlign != itemAlign){ @@ -844,7 +860,7 @@ QPen BaseDesignIntf::borderPen(BorderSide side/*, bool selected*/) const { QPen pen; if (m_borderLinesFlags & side) { - pen.setColor(Qt::black); + pen.setColor(m_borderColor); pen.setStyle(Qt::SolidLine); pen.setWidth(m_borderLineSize); } else { diff --git a/limereport/lrbasedesignintf.h b/limereport/lrbasedesignintf.h index e1e07d7..78a60a6 100644 --- a/limereport/lrbasedesignintf.h +++ b/limereport/lrbasedesignintf.h @@ -93,6 +93,7 @@ class BaseDesignIntf : Q_PROPERTY(QString parentName READ parentReportItemName WRITE setParentReportItem DESIGNABLE false) Q_PROPERTY(int borderLineSize READ borderLineSize WRITE setBorderLineSize) Q_PROPERTY(bool isVisible READ isVisible WRITE setVisible DESIGNABLE false) + Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor) public: enum BGMode { TransparentMode,OpaqueMode}; @@ -241,6 +242,9 @@ public: QPointF modifyPosForAlignedItem(const QPointF &pos); void turnOnJoinMarker(bool value); virtual bool isBand(){return false;} + QColor borderColor() const; + void setBorderColor(const QColor &borderColor); + protected: //ICollectionContainer @@ -341,6 +345,7 @@ private: QString m_itemTypeName; ItemAlign m_itemAlign; bool m_changingItemAlign; + QColor m_borderColor; signals: void geometryChanged(QObject* object, QRectF newGeometry, QRectF oldGeometry); void posChanged(QObject* object, QPointF newPos, QPointF oldPos);