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

Finish 1.5.6

This commit is contained in:
Arin Alexander 2019-07-31 00:28:54 +03:00
commit d10bdca71e
4 changed files with 22 additions and 13 deletions

View File

@ -127,7 +127,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc
LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MAJOR = 1
LIMEREPORT_VERSION_MINOR = 5 LIMEREPORT_VERSION_MINOR = 5
LIMEREPORT_VERSION_RELEASE = 5 LIMEREPORT_VERSION_RELEASE = 6
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

@ -356,7 +356,7 @@ void BandDesignIntf::setDataSourceName(const QString &datasource){
m_dataSourceName=datasource; m_dataSourceName=datasource;
} }
void BandDesignIntf::setKeepBottomSpaceOption(bool value){ void BandDesignIntf::setKeepBottomSpace(bool value){
if (m_keepBottomSpace!=value){ if (m_keepBottomSpace!=value){
m_keepBottomSpace=value; m_keepBottomSpace=value;
if (!isLoading()) if (!isLoading())
@ -584,7 +584,11 @@ void BandDesignIntf::preparePopUpMenu(QMenu &menu)
currAction = menu.addAction(tr("Keep bottom space")); currAction = menu.addAction(tr("Keep bottom space"));
currAction->setCheckable(true); currAction->setCheckable(true);
currAction->setChecked(keepBottomSpaceOption()); currAction->setChecked(keepBottomSpace());
currAction = menu.addAction(tr("Keep top space"));
currAction->setCheckable(true);
currAction->setChecked(keepTopSpace());
currAction = menu.addAction(tr("Print if empty")); currAction = menu.addAction(tr("Print if empty"));
currAction->setCheckable(true); currAction->setCheckable(true);
@ -603,6 +607,9 @@ void BandDesignIntf::processPopUpAction(QAction *action)
if (action->text().compare(tr("Keep bottom space")) == 0){ if (action->text().compare(tr("Keep bottom space")) == 0){
setProperty("keepBottomSpace",action->isChecked()); setProperty("keepBottomSpace",action->isChecked());
} }
if (action->text().compare(tr("Keep top space")) == 0){
setProperty("keepTopSpace",action->isChecked());
}
if (action->text().compare(tr("Print if empty")) == 0){ if (action->text().compare(tr("Print if empty")) == 0){
setProperty("printIfEmpty",action->isChecked()); setProperty("printIfEmpty",action->isChecked());
@ -1090,10 +1097,10 @@ void BandDesignIntf::setKeepFooterTogether(bool value)
void BandDesignIntf::updateItemSize(DataSourceManager* dataManager, RenderPass pass, int maxHeight) void BandDesignIntf::updateItemSize(DataSourceManager* dataManager, RenderPass pass, int maxHeight)
{ {
qreal spaceBorder=0; qreal spaceBorder = 0;
if (keepBottomSpaceOption()) spaceBorder = bottomSpace(); if (keepBottomSpace()) spaceBorder = bottomSpace();
spaceBorder = spaceBorder > 0 ? spaceBorder : 0; spaceBorder = spaceBorder > 0 ? spaceBorder : 0;
if (borderLines()!=0){ if (borderLines() != 0){
spaceBorder += borderLineSize(); spaceBorder += borderLineSize();
} }
@ -1105,14 +1112,14 @@ void BandDesignIntf::updateItemSize(DataSourceManager* dataManager, RenderPass p
arrangeSubItems(pass, dataManager); arrangeSubItems(pass, dataManager);
if (autoHeight()){ if (autoHeight()){
if (!keepTopSpace()) { if (!keepTopSpace()) {
qreal minTop = findMinTop(); qreal minTop = findMinTop() - spaceBorder;
foreach (BaseDesignIntf* item, childBaseItems()) { foreach (BaseDesignIntf* item, childBaseItems()) {
item->setY(item->y() - minTop); item->setY(item->y() - minTop);
} }
} }
setHeight(findMaxBottom()+spaceBorder); setHeight(findMaxBottom() + spaceBorder);
} }
if ((maxHeight>0)&&(height()>maxHeight)){ if ((maxHeight > 0) && (height() > maxHeight)){
trimToMaxHeight(maxHeight); trimToMaxHeight(maxHeight);
setHeight(maxHeight); setHeight(maxHeight);
} }

View File

@ -105,7 +105,7 @@ class BandDesignIntf : public ItemsContainerDesignInft
Q_OBJECT Q_OBJECT
Q_PROPERTY(bool autoHeight READ autoHeight WRITE setAutoHeight ) Q_PROPERTY(bool autoHeight READ autoHeight WRITE setAutoHeight )
Q_PROPERTY(int bandIndex READ bandIndex WRITE setBandIndex DESIGNABLE false ) Q_PROPERTY(int bandIndex READ bandIndex WRITE setBandIndex DESIGNABLE false )
Q_PROPERTY(bool keepBottomSpace READ keepBottomSpaceOption WRITE setKeepBottomSpaceOption ) Q_PROPERTY(bool keepBottomSpace READ keepBottomSpace WRITE setKeepBottomSpace )
Q_PROPERTY(bool keepTopSpace READ keepTopSpace WRITE setKeepTopSpace) Q_PROPERTY(bool keepTopSpace READ keepTopSpace WRITE setKeepTopSpace)
Q_PROPERTY(QString parentBand READ parentBandName WRITE setParentBandName DESIGNABLE false ) Q_PROPERTY(QString parentBand READ parentBandName WRITE setParentBandName DESIGNABLE false )
Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor) Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor)
@ -162,8 +162,8 @@ public:
QString datasourceName(); QString datasourceName();
void setDataSourceName(const QString& datasourceName); void setDataSourceName(const QString& datasourceName);
void setKeepBottomSpaceOption(bool value); void setKeepBottomSpace(bool value);
bool keepBottomSpaceOption() const {return m_keepBottomSpace;} bool keepBottomSpace() const {return m_keepBottomSpace;}
bool keepTopSpace() const; bool keepTopSpace() const;
void setKeepTopSpace(bool value); void setKeepTopSpace(bool value);

View File

@ -97,7 +97,9 @@ BaseDesignIntf::BaseDesignIntf(const QString &storageTypeName, QObject *owner, Q
QRectF BaseDesignIntf::boundingRect() const QRectF BaseDesignIntf::boundingRect() const
{ {
return rect(); qreal halfpw = pen().widthF() / 2;
halfpw += 2;
return rect().adjusted(-halfpw, -halfpw, halfpw, halfpw);
} }
BaseDesignIntf::~BaseDesignIntf(void) { BaseDesignIntf::~BaseDesignIntf(void) {