mirror of
https://github.com/fralx/LimeReport.git
synced 2024-12-25 00:54:39 +03:00
Watermark
# Conflicts: # limereport/items/lrimageitem.h # limereport/items/lrtextitem.h # limereport/lrbasedesignintf.cpp # limereport/lrbasedesignintf.h
This commit is contained in:
commit
288aef75b2
@ -96,7 +96,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}\\\"
|
||||||
|
@ -48,6 +48,7 @@ class ImageItem : public LimeReport::ItemDesignIntf
|
|||||||
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(QString variable READ variable WRITE setVariable)
|
Q_PROPERTY(QString variable READ variable WRITE setVariable)
|
||||||
|
Q_PROPERTY(bool watermark READ isWatermark WRITE setWatermark)
|
||||||
public:
|
public:
|
||||||
enum Format {
|
enum Format {
|
||||||
Binary = 0,
|
Binary = 0,
|
||||||
|
@ -72,6 +72,7 @@ class TextItem : public LimeReport::ContentItemDesignIntf, IPageInit {
|
|||||||
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 fillInSecondPass READ fillInSecondPass WRITE setFillInSecondPass)
|
Q_PROPERTY(bool fillInSecondPass READ fillInSecondPass WRITE setFillInSecondPass)
|
||||||
|
Q_PROPERTY(bool watermark READ isWatermark WRITE setWatermark)
|
||||||
public:
|
public:
|
||||||
|
|
||||||
enum AutoWidth{NoneAutoWidth,MaxWordLength,MaxStringLength};
|
enum AutoWidth{NoneAutoWidth,MaxWordLength,MaxStringLength};
|
||||||
|
@ -80,7 +80,8 @@ BaseDesignIntf::BaseDesignIntf(const QString &storageTypeName, QObject *owner, Q
|
|||||||
m_reportSettings(0),
|
m_reportSettings(0),
|
||||||
m_patternName(""),
|
m_patternName(""),
|
||||||
m_patternItem(0),
|
m_patternItem(0),
|
||||||
m_fillInSecondPass(false)
|
m_fillInSecondPass(false),
|
||||||
|
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)) {
|
||||||
@ -716,6 +717,19 @@ void BaseDesignIntf::setFillInSecondPass(bool fillInSecondPass)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
@ -289,6 +289,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
|
||||||
@ -408,6 +411,7 @@ private:
|
|||||||
QString m_patternName;
|
QString m_patternName;
|
||||||
BaseDesignIntf* m_patternItem;
|
BaseDesignIntf* m_patternItem;
|
||||||
bool m_fillInSecondPass;
|
bool m_fillInSecondPass;
|
||||||
|
bool m_watermark;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void geometryChanged(QObject* object, QRectF newGeometry, QRectF oldGeometry);
|
void geometryChanged(QObject* object, QRectF newGeometry, QRectF oldGeometry);
|
||||||
|
@ -676,7 +676,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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user