0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-24 16:44:39 +03:00

Border color property has been added

This commit is contained in:
Arin Alexander 2016-04-06 21:35:13 +04:00
parent f67602af43
commit eb6e174080
2 changed files with 23 additions and 2 deletions

View File

@ -74,7 +74,8 @@ BaseDesignIntf::BaseDesignIntf(const QString &storageTypeName, QObject *owner, Q
m_backgroundBrushcolor(Qt::white), m_backgroundBrushcolor(Qt::white),
m_margin(4), m_margin(4),
m_itemAlign(DesignedItemAlign), m_itemAlign(DesignedItemAlign),
m_changingItemAlign(false) m_changingItemAlign(false),
m_borderColor(Qt::black)
{ {
setGeometry(QRectF(0, 0, m_width, m_height)); setGeometry(QRectF(0, 0, m_width, m_height));
if (BaseDesignIntf *item = dynamic_cast<BaseDesignIntf *>(parent)) { if (BaseDesignIntf *item = dynamic_cast<BaseDesignIntf *>(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) void BaseDesignIntf::setItemAlign(const ItemAlign &itemAlign)
{ {
if (m_itemAlign != itemAlign){ if (m_itemAlign != itemAlign){
@ -844,7 +860,7 @@ QPen BaseDesignIntf::borderPen(BorderSide side/*, bool selected*/) const
{ {
QPen pen; QPen pen;
if (m_borderLinesFlags & side) { if (m_borderLinesFlags & side) {
pen.setColor(Qt::black); pen.setColor(m_borderColor);
pen.setStyle(Qt::SolidLine); pen.setStyle(Qt::SolidLine);
pen.setWidth(m_borderLineSize); pen.setWidth(m_borderLineSize);
} else { } else {

View File

@ -93,6 +93,7 @@ class BaseDesignIntf :
Q_PROPERTY(QString parentName READ parentReportItemName WRITE setParentReportItem DESIGNABLE false) Q_PROPERTY(QString parentName READ parentReportItemName WRITE setParentReportItem DESIGNABLE false)
Q_PROPERTY(int borderLineSize READ borderLineSize WRITE setBorderLineSize) Q_PROPERTY(int borderLineSize READ borderLineSize WRITE setBorderLineSize)
Q_PROPERTY(bool isVisible READ isVisible WRITE setVisible DESIGNABLE false) Q_PROPERTY(bool isVisible READ isVisible WRITE setVisible DESIGNABLE false)
Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor)
public: public:
enum BGMode { TransparentMode,OpaqueMode}; enum BGMode { TransparentMode,OpaqueMode};
@ -241,6 +242,9 @@ public:
QPointF modifyPosForAlignedItem(const QPointF &pos); QPointF modifyPosForAlignedItem(const QPointF &pos);
void turnOnJoinMarker(bool value); void turnOnJoinMarker(bool value);
virtual bool isBand(){return false;} virtual bool isBand(){return false;}
QColor borderColor() const;
void setBorderColor(const QColor &borderColor);
protected: protected:
//ICollectionContainer //ICollectionContainer
@ -341,6 +345,7 @@ private:
QString m_itemTypeName; QString m_itemTypeName;
ItemAlign m_itemAlign; ItemAlign m_itemAlign;
bool m_changingItemAlign; bool m_changingItemAlign;
QColor m_borderColor;
signals: signals:
void geometryChanged(QObject* object, QRectF newGeometry, QRectF oldGeometry); void geometryChanged(QObject* object, QRectF newGeometry, QRectF oldGeometry);
void posChanged(QObject* object, QPointF newPos, QPointF oldPos); void posChanged(QObject* object, QPointF newPos, QPointF oldPos);