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

Watermark

This commit is contained in:
Arin Alex 2018-03-22 17:21:34 +03:00
commit 55224a8401
6 changed files with 26 additions and 3 deletions

View File

@ -62,7 +62,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc
LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MAJOR = 1
LIMEREPORT_VERSION_MINOR = 4 LIMEREPORT_VERSION_MINOR = 4
LIMEREPORT_VERSION_RELEASE = 68 LIMEREPORT_VERSION_RELEASE = 69
LIMEREPORT_VERSION = '\\"$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}\\"' LIMEREPORT_VERSION = '\\"$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}\\"'
DEFINES += LIMEREPORT_VERSION_STR=\"$${LIMEREPORT_VERSION}\" DEFINES += LIMEREPORT_VERSION_STR=\"$${LIMEREPORT_VERSION}\"

View File

@ -47,6 +47,7 @@ class ImageItem : public LimeReport::ItemDesignIntf
Q_PROPERTY(bool keepAspectRatio READ keepAspectRatio WRITE setKeepAspectRatio) Q_PROPERTY(bool keepAspectRatio READ keepAspectRatio WRITE setKeepAspectRatio)
Q_PROPERTY(bool center READ center WRITE setCenter) Q_PROPERTY(bool center READ center WRITE setCenter)
Q_PROPERTY(QString resourcePath READ resourcePath WRITE setResourcePath) Q_PROPERTY(QString resourcePath READ resourcePath WRITE setResourcePath)
Q_PROPERTY(bool watermark READ isWatermark WRITE setWatermark)
public: public:
enum Format { enum Format {
Binary = 0, Binary = 0,

View File

@ -71,6 +71,7 @@ class TextItem : public LimeReport::ContentItemDesignIntf, IPageInit {
Q_PROPERTY(BrushStyle backgroundBrushStyle READ backgroundBrushStyle WRITE setBackgroundBrushStyle) Q_PROPERTY(BrushStyle backgroundBrushStyle READ backgroundBrushStyle WRITE setBackgroundBrushStyle)
Q_PROPERTY(qreal textIndent READ textIndent WRITE setTextIndent) Q_PROPERTY(qreal textIndent READ textIndent WRITE setTextIndent)
Q_PROPERTY(Qt::LayoutDirection textLayoutDirection READ textLayoutDirection WRITE setTextLayoutDirection) Q_PROPERTY(Qt::LayoutDirection textLayoutDirection READ textLayoutDirection WRITE setTextLayoutDirection)
Q_PROPERTY(bool watermark READ isWatermark WRITE setWatermark)
public: public:
enum AutoWidth{NoneAutoWidth,MaxWordLength,MaxStringLength}; enum AutoWidth{NoneAutoWidth,MaxWordLength,MaxStringLength};

View File

@ -78,7 +78,8 @@ BaseDesignIntf::BaseDesignIntf(const QString &storageTypeName, QObject *owner, Q
m_changingItemAlign(false), m_changingItemAlign(false),
m_borderColor(Qt::black), m_borderColor(Qt::black),
m_reportSettings(0), m_reportSettings(0),
m_patternName("") m_patternName(""),
m_watermark(false)
{ {
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)) {
@ -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 QString BaseDesignIntf::patternName() const
{ {
return (m_patternName.isEmpty()) ? objectName() : m_patternName; return (m_patternName.isEmpty()) ? objectName() : m_patternName;

View File

@ -282,6 +282,9 @@ public:
Q_INVOKABLE QString setItemPosX(qreal xValue); Q_INVOKABLE QString setItemPosX(qreal xValue);
Q_INVOKABLE QString setItemPosY(qreal yValue); Q_INVOKABLE QString setItemPosY(qreal yValue);
bool isWatermark() const;
void setWatermark(bool watermark);
protected: protected:
//ICollectionContainer //ICollectionContainer
@ -396,6 +399,7 @@ private:
QColor m_borderColor; QColor m_borderColor;
ReportSettings* m_reportSettings; ReportSettings* m_reportSettings;
QString m_patternName; QString m_patternName;
bool m_watermark;
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);

View File

@ -640,7 +640,10 @@ void ReportRender::renderPageItems(PageItemDesignIntf* patternPage)
m_renderPageItem->restoreLinks(); m_renderPageItem->restoreLinks();
m_renderPageItem->updateSubItemsSize(FirstPass,m_datasources); m_renderPageItem->updateSubItemsSize(FirstPass,m_datasources);
foreach(BaseDesignIntf* item, pageItems){ foreach(BaseDesignIntf* item, pageItems){
if (!item->isWatermark())
item->setZValue(item->zValue()-100000); item->setZValue(item->zValue()-100000);
else
item->setZValue(item->zValue()+100000);
} }
} }