mirror of
https://github.com/fralx/LimeReport.git
synced 2024-12-25 00:54:39 +03:00
Watermark
This commit is contained in:
commit
55224a8401
@ -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}\"
|
||||
|
@ -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,
|
||||
|
@ -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};
|
||||
|
@ -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<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
|
||||
{
|
||||
return (m_patternName.isEmpty()) ? objectName() : m_patternName;
|
||||
|
@ -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);
|
||||
|
@ -640,7 +640,10 @@ void ReportRender::renderPageItems(PageItemDesignIntf* patternPage)
|
||||
m_renderPageItem->restoreLinks();
|
||||
m_renderPageItem->updateSubItemsSize(FirstPass,m_datasources);
|
||||
foreach(BaseDesignIntf* item, pageItems){
|
||||
if (!item->isWatermark())
|
||||
item->setZValue(item->zValue()-100000);
|
||||
else
|
||||
item->setZValue(item->zValue()+100000);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user