0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-24 08:34:38 +03:00

Drawing of report items borders has been fixed

This commit is contained in:
Arin Alexander 2019-07-31 00:28:45 +03:00
parent 0affcfdeac
commit 09e95cd633
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_MINOR = 5
LIMEREPORT_VERSION_RELEASE = 5
LIMEREPORT_VERSION_RELEASE = 6
LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}'
DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\"

View File

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

View File

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

View File

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