From 3999dc00bd6ba58046902c46487e73ebda4a61e9 Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Tue, 30 Jul 2019 14:09:09 +0300 Subject: [PATCH 01/13] Static build has been fixed --- 3rdparty/zint-2.6.1/backend_qt/backend_qt.pro | 3 ++- 3rdparty/zint-2.6.1/backend_qt/qzint_global.h | 4 ++++ common.pri | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/3rdparty/zint-2.6.1/backend_qt/backend_qt.pro b/3rdparty/zint-2.6.1/backend_qt/backend_qt.pro index 63eadfd..2af6b7d 100644 --- a/3rdparty/zint-2.6.1/backend_qt/backend_qt.pro +++ b/3rdparty/zint-2.6.1/backend_qt/backend_qt.pro @@ -66,7 +66,8 @@ HEADERS += $$PWD/../backend/aztec.h \ $$PWD/../backend/sjis.h \ $$PWD/../backend/stdint_msvc.h \ $$PWD/../backend/zint.h \ - $$PWD/qzint.h + $$PWD/qzint.h \ + $$PWD/qzint_global.h SOURCES += $$PWD/../backend/2of5.c \ $$PWD/../backend/auspost.c \ diff --git a/3rdparty/zint-2.6.1/backend_qt/qzint_global.h b/3rdparty/zint-2.6.1/backend_qt/qzint_global.h index 025b16e..ea46fe2 100644 --- a/3rdparty/zint-2.6.1/backend_qt/qzint_global.h +++ b/3rdparty/zint-2.6.1/backend_qt/qzint_global.h @@ -3,10 +3,14 @@ #include +#ifdef HAVE_STATIC_BUILD +# define QZINTSHARED_EXPORT /**/ +#else #if defined(QZINT_LIBRARY) # define QZINTSHARED_EXPORT Q_DECL_EXPORT #else # define QZINTSHARED_EXPORT Q_DECL_IMPORT #endif +#endif #endif // QZINT_GLOBAL_H diff --git a/common.pri b/common.pri index 367a666..3dcb931 100644 --- a/common.pri +++ b/common.pri @@ -127,7 +127,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MINOR = 5 -LIMEREPORT_VERSION_RELEASE = 4 +LIMEREPORT_VERSION_RELEASE = 5 LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}' DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\" From 09e95cd63351f7f0138ecd7e542bcac1967f105a Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Wed, 31 Jul 2019 00:28:45 +0300 Subject: [PATCH 02/13] Drawing of report items borders has been fixed --- common.pri | 2 +- limereport/lrbanddesignintf.cpp | 23 +++++++++++++++-------- limereport/lrbanddesignintf.h | 6 +++--- limereport/lrbasedesignintf.cpp | 4 +++- 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/common.pri b/common.pri index 3dcb931..e76450d 100644 --- a/common.pri +++ b/common.pri @@ -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}\\\" diff --git a/limereport/lrbanddesignintf.cpp b/limereport/lrbanddesignintf.cpp index caac574..d8a6bbb 100644 --- a/limereport/lrbanddesignintf.cpp +++ b/limereport/lrbanddesignintf.cpp @@ -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()); @@ -1090,10 +1097,10 @@ void BandDesignIntf::setKeepFooterTogether(bool value) void BandDesignIntf::updateItemSize(DataSourceManager* dataManager, RenderPass pass, int maxHeight) { - qreal spaceBorder=0; - if (keepBottomSpaceOption()) spaceBorder = bottomSpace(); + qreal spaceBorder = 0; + if (keepBottomSpace()) spaceBorder = bottomSpace(); spaceBorder = spaceBorder > 0 ? spaceBorder : 0; - if (borderLines()!=0){ + if (borderLines() != 0){ spaceBorder += borderLineSize(); } @@ -1105,14 +1112,14 @@ 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); } } - setHeight(findMaxBottom()+spaceBorder); + setHeight(findMaxBottom() + spaceBorder); } - if ((maxHeight>0)&&(height()>maxHeight)){ + if ((maxHeight > 0) && (height() > maxHeight)){ trimToMaxHeight(maxHeight); setHeight(maxHeight); } diff --git a/limereport/lrbanddesignintf.h b/limereport/lrbanddesignintf.h index a6e09be..3f4f5f7 100644 --- a/limereport/lrbanddesignintf.h +++ b/limereport/lrbanddesignintf.h @@ -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); diff --git a/limereport/lrbasedesignintf.cpp b/limereport/lrbasedesignintf.cpp index 71f2f94..1555aaf 100644 --- a/limereport/lrbasedesignintf.cpp +++ b/limereport/lrbasedesignintf.cpp @@ -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) { From afa4bcb9bf95700129e0062e0d4cb62572a4b067 Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Wed, 7 Aug 2019 12:40:42 +0300 Subject: [PATCH 03/13] If resourcePath contains a simple path to an image file, that image will be shown in design mode. --- limereport/items/lrimageitem.cpp | 15 +++++++++++++++ limereport/items/lrimageitem.h | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/limereport/items/lrimageitem.cpp b/limereport/items/lrimageitem.cpp index c3fce2f..9952479 100644 --- a/limereport/items/lrimageitem.cpp +++ b/limereport/items/lrimageitem.cpp @@ -340,6 +340,21 @@ void ImageItem::setImage(QImage value) } } +QImage ImageItem::image(){ + if (m_picture.isNull() && !resourcePath().isEmpty() && itemMode() == DesignMode){ + QFileInfo fileInfo(m_resourcePath); + if (fileInfo.exists()){ + return QImage(m_resourcePath); + } + } + return m_picture; +} + +void ImageItem::setResourcePath(const QString &value){ + m_resourcePath=value; + update(); +} + ImageItem::Format ImageItem::format() const { return m_format; diff --git a/limereport/items/lrimageitem.h b/limereport/items/lrimageitem.h index 5d474e2..8eb7da7 100644 --- a/limereport/items/lrimageitem.h +++ b/limereport/items/lrimageitem.h @@ -61,8 +61,8 @@ public: ImageItem(QObject *owner, QGraphicsItem *parent); virtual void paint(QPainter *ppainter, const QStyleOptionGraphicsItem *option, QWidget *widget); void setImage(QImage value); - QImage image(){return m_picture;} - void setResourcePath(const QString &value){m_resourcePath=value;} + QImage image(); + void setResourcePath(const QString &value); QString resourcePath() const; QString datasource() const; void setDatasource(const QString &datasource); From 4556e3bc78fb85705cbe841e1b4b408331c411d3 Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Wed, 7 Aug 2019 21:06:47 +0300 Subject: [PATCH 04/13] Image editor has been added --- common.pri | 2 +- limereport/items/lrimageitem.cpp | 59 ++++++--- limereport/items/lrimageitem.h | 5 +- limereport/items/lrimageitemeditor.cpp | 70 ++++++++++ limereport/items/lrimageitemeditor.h | 37 ++++++ limereport/items/lrimageitemeditor.ui | 170 +++++++++++++++++++++++++ limereport/limereport.pri | 3 + 7 files changed, 328 insertions(+), 18 deletions(-) create mode 100644 limereport/items/lrimageitemeditor.cpp create mode 100644 limereport/items/lrimageitemeditor.h create mode 100644 limereport/items/lrimageitemeditor.ui diff --git a/common.pri b/common.pri index e76450d..cbe3fc1 100644 --- a/common.pri +++ b/common.pri @@ -127,7 +127,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MINOR = 5 -LIMEREPORT_VERSION_RELEASE = 6 +LIMEREPORT_VERSION_RELEASE = 7 LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}' DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\" diff --git a/limereport/items/lrimageitem.cpp b/limereport/items/lrimageitem.cpp index 9952479..76542d3 100644 --- a/limereport/items/lrimageitem.cpp +++ b/limereport/items/lrimageitem.cpp @@ -32,6 +32,7 @@ #include "lrglobal.h" #include "lrdatasourcemanager.h" #include "lrpagedesignintf.h" +#include "lrimageitemeditor.h" namespace{ @@ -83,9 +84,15 @@ void ImageItem::loadPictureFromVariant(QVariant& data){ void ImageItem::preparePopUpMenu(QMenu &menu) { + QAction* editAction = menu.addAction(QIcon(":/report/images/edit_pecil2.png"),tr("Edit")); + menu.insertAction(menu.actions().at(0),editAction); + menu.insertSeparator(menu.actions().at(1)); + + menu.addSeparator(); QAction* action = menu.addAction(tr("Watermark")); action->setCheckable(true); action->setChecked(isWatermark()); + } void ImageItem::processPopUpAction(QAction *action) @@ -93,9 +100,26 @@ void ImageItem::processPopUpAction(QAction *action) if (action->text().compare(tr("Watermark")) == 0){ page()->setPropertyToSelectedItems("watermark",action->isChecked()); } + if (action->text().compare(tr("Edit")) == 0){ + this->showEditorDialog(); + } ItemDesignIntf::processPopUpAction(action); } +QImage getFileByResourcePath(QString resourcePath){ + QFileInfo resourceFile(resourcePath); + if (resourceFile.exists()) + return QImage(resourcePath); + return QImage(); +} + +QImage ImageItem::drawImage() +{ + if (image().isNull()) + return getFileByResourcePath(m_resourcePath); + return image(); +} + bool ImageItem::useExternalPainter() const { return m_useExternalPainter; @@ -110,6 +134,13 @@ void ImageItem::setUseExternalPainter(bool value) } } +QWidget *ImageItem::defaultEditor() +{ + ImageItemEditor* editor = new ImageItemEditor(this); + editor->setAttribute(Qt::WA_DeleteOnClose); + return editor; +} + void ImageItem::updateItemSize(DataSourceManager* dataManager, RenderPass pass, int maxHeight) { @@ -220,8 +251,8 @@ void ImageItem::setAutoSize(bool autoSize) if (m_autoSize != autoSize){ m_autoSize = autoSize; if (m_autoSize && !m_picture.isNull()){ - setWidth(image().width()); - setHeight(image().height()); + setWidth(drawImage().width()); + setHeight(drawImage().height()); setPossibleResizeDirectionFlags(Fixed); } else { setPossibleResizeDirectionFlags(AllDirections); @@ -271,10 +302,10 @@ void ImageItem::paint(QPainter *ppainter, const QStyleOptionGraphicsItem *option QPointF point = rect().topLeft(); QImage img; - if (m_scale && !image().isNull()){ - img = image().scaled(rect().width(), rect().height(), keepAspectRatio() ? Qt::KeepAspectRatio : Qt::IgnoreAspectRatio, Qt::SmoothTransformation); + if (m_scale && !drawImage().isNull()){ + img = drawImage().scaled(rect().width(), rect().height(), keepAspectRatio() ? Qt::KeepAspectRatio : Qt::IgnoreAspectRatio, Qt::SmoothTransformation); } else { - img = image(); + img = drawImage(); } qreal shiftHeight = rect().height() - img.height(); @@ -328,9 +359,9 @@ void ImageItem::paint(QPainter *ppainter, const QStyleOptionGraphicsItem *option void ImageItem::setImage(QImage value) { - if (m_picture!=value){ + if (m_picture != value){ QImage oldValue = m_picture; - m_picture=value; + m_picture = value; if (m_autoSize){ setWidth(m_picture.width()); setHeight(m_picture.height()); @@ -341,18 +372,16 @@ void ImageItem::setImage(QImage value) } QImage ImageItem::image(){ - if (m_picture.isNull() && !resourcePath().isEmpty() && itemMode() == DesignMode){ - QFileInfo fileInfo(m_resourcePath); - if (fileInfo.exists()){ - return QImage(m_resourcePath); - } - } return m_picture; } void ImageItem::setResourcePath(const QString &value){ - m_resourcePath=value; - update(); + if (m_resourcePath != value){ + QString oldValue = m_resourcePath; + m_resourcePath = value; + update(); + notify("resourcePath", oldValue, value); + } } ImageItem::Format ImageItem::format() const diff --git a/limereport/items/lrimageitem.h b/limereport/items/lrimageitem.h index 8eb7da7..587d39d 100644 --- a/limereport/items/lrimageitem.h +++ b/limereport/items/lrimageitem.h @@ -89,6 +89,7 @@ public: bool useExternalPainter() const; void setUseExternalPainter(bool value); + QWidget* defaultEditor(); protected: BaseDesignIntf* createSameTypeItem(QObject *owner, QGraphicsItem *parent); void updateItemSize(DataSourceManager *dataManager, RenderPass pass, int maxHeight); @@ -97,6 +98,7 @@ protected: void loadPictureFromVariant(QVariant& data); void preparePopUpMenu(QMenu &menu); void processPopUpAction(QAction *action); + QImage drawImage(); private: QImage m_picture; bool m_useExternalPainter; @@ -109,8 +111,7 @@ private: bool m_keepAspectRatio; bool m_center; Format m_format; - QString m_variable; - + QString m_variable; }; } diff --git a/limereport/items/lrimageitemeditor.cpp b/limereport/items/lrimageitemeditor.cpp new file mode 100644 index 0000000..9e34df9 --- /dev/null +++ b/limereport/items/lrimageitemeditor.cpp @@ -0,0 +1,70 @@ +#include "lrimageitemeditor.h" +#include "ui_lrimageitemeditor.h" +#include "lrimageitem.h" + +#include +#include + +ImageItemEditor::ImageItemEditor(LimeReport::ImageItem *item, QWidget *parent) : + QWidget(parent), + ui(new Ui::ImageItemEditor), m_item(item) +{ + ui->setupUi(this); + m_image = QPixmap::fromImage(m_item->image()); + ui->resourcePath->setText(m_item->resourcePath()); + updateImage(); +} + +ImageItemEditor::~ImageItemEditor() +{ + delete ui; +} + +void ImageItemEditor::updateImage() +{ + ui->imageViewer->setPixmap(m_image); + if (m_image.isNull() && !ui->resourcePath->text().isEmpty()){ + if (m_resourcePathImage.isNull()) + m_resourcePathImage = QPixmap(ui->resourcePath->text()); + ui->imageViewer->setPixmap(m_resourcePathImage); + } +} + +void ImageItemEditor::on_tbLoadImage_clicked() +{ + QString fileName = QFileDialog::getOpenFileName(this, tr("Select image file")); + m_image = QPixmap(fileName); + updateImage(); +} + +void ImageItemEditor::on_tbClearImage_clicked() +{ + m_image = QPixmap(); + updateImage(); +} + +void ImageItemEditor::on_buttonBox_accepted() +{ + m_item->setImage(m_image.toImage()); + m_item->setResourcePath(ui->resourcePath->text()); + this->close(); +} + +void ImageItemEditor::on_buttonBox_rejected() +{ + this->close(); +} + +void ImageItemEditor::on_toolButton_clicked() +{ + ui->resourcePath->setText(QFileDialog::getOpenFileName(this, tr("Select image file"))); + m_resourcePathImage = QPixmap(ui->resourcePath->text()); + if (!m_resourcePathImage.isNull() && m_image.isNull()) + ui->imageViewer->setPixmap(m_resourcePathImage); +} + +void ImageItemEditor::on_tbResourcePath_clicked() +{ + ui->resourcePath->setText(""); + updateImage(); +} diff --git a/limereport/items/lrimageitemeditor.h b/limereport/items/lrimageitemeditor.h new file mode 100644 index 0000000..a8cc474 --- /dev/null +++ b/limereport/items/lrimageitemeditor.h @@ -0,0 +1,37 @@ +#ifndef LRIMAGEITEMEDITOR_H +#define LRIMAGEITEMEDITOR_H + +#include + +namespace Ui { +class ImageItemEditor; +} + +namespace LimeReport { +class ImageItem; +} + +class ImageItemEditor : public QWidget +{ + Q_OBJECT + +public: + explicit ImageItemEditor(LimeReport::ImageItem* item, QWidget *parent = nullptr); + ~ImageItemEditor(); +private: + void updateImage(); +private: + Ui::ImageItemEditor *ui; + LimeReport::ImageItem* m_item; + QPixmap m_image; + QPixmap m_resourcePathImage; +private slots: + void on_tbLoadImage_clicked(); + void on_tbClearImage_clicked(); + void on_buttonBox_accepted(); + void on_buttonBox_rejected(); + void on_toolButton_clicked(); + void on_tbResourcePath_clicked(); +}; + +#endif // LRIMAGEITEMEDITOR_H diff --git a/limereport/items/lrimageitemeditor.ui b/limereport/items/lrimageitemeditor.ui new file mode 100644 index 0000000..12152d4 --- /dev/null +++ b/limereport/items/lrimageitemeditor.ui @@ -0,0 +1,170 @@ + + + ImageItemEditor + + + + 0 + 0 + 358 + 403 + + + + + 0 + 0 + + + + Image Item Editor + + + + :/items/images/imageItem3.png:/items/images/imageItem3.png + + + + + + + 0 + 0 + + + + Image + + + + + + + + ... + + + + :/report/images/folder:/report/images/folder + + + true + + + + + + + ... + + + + :/items/clear.png:/items/clear.png + + + true + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 0 + 0 + + + + + + + :/images/images/logo.png + + + true + + + + + + + + + + + + Resource path + + + + + + + + + + ... + + + + :/report/images/folder:/report/images/folder + + + true + + + + + + + ... + + + + :/items/clear.png:/items/clear.png + + + true + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + + + + + + + + diff --git a/limereport/limereport.pri b/limereport/limereport.pri index e039138..0918890 100644 --- a/limereport/limereport.pri +++ b/limereport/limereport.pri @@ -36,6 +36,7 @@ SOURCES += \ $$REPORT_PATH/items/editors/lritemsborderseditorwidget.cpp \ $$REPORT_PATH/items/lrsimpletagparser.cpp \ $$REPORT_PATH/items/lrimageitem.cpp \ + $$REPORT_PATH/items/lrimageitemeditor.cpp \ $$REPORT_PATH/items/lrtextitemeditor.cpp \ $$REPORT_PATH/items/lrshapeitem.cpp \ $$REPORT_PATH/items/lrtextitem.cpp \ @@ -108,6 +109,7 @@ HEADERS += \ $$REPORT_PATH/items/lrtextitemeditor.h \ $$REPORT_PATH/items/lrshapeitem.h \ $$REPORT_PATH/items/lrimageitem.h \ + $$REPORT_PATH/items/lrimageitemeditor.h \ $$REPORT_PATH/items/lrsimpletagparser.h \ $$REPORT_PATH/items/lrverticallayout.h \ $$REPORT_PATH/items/lrlayoutmarker.h \ @@ -171,6 +173,7 @@ FORMS += \ $$REPORT_PATH/lraboutdialog.ui \ $$REPORT_PATH/lrsettingdialog.ui \ $$REPORT_PATH/items/lrchartitemeditor.ui \ + $$REPORT_PATH/items/lrimageitemeditor.ui \ $$REPORT_PATH/scripteditor/lrscripteditor.ui RESOURCES += \ From db015827054e4b5342878a66a0f471bc967ec76b Mon Sep 17 00:00:00 2001 From: fralx Date: Thu, 8 Aug 2019 21:48:14 +0300 Subject: [PATCH 05/13] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b1eafc3..aedcaa1 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,11 @@ + # LimeReport v1.5.0 [![Build Status](https://api.travis-ci.org/fralx/LimeReport.svg?branch=master)](https://travis-ci.org/fralx/LimeReport) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/bc31412ea4814f30825b5ed3723e9a70)](https://app.codacy.com/app/fralx/LimeReport?utm_source=github.com&utm_medium=referral&utm_content=fralx/LimeReport&utm_campaign=Badge_Grade_Dashboard) ## Official LimeReport web site [http://limereport.ru](http://limereport.ru) -### Features +## Donation [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/arinalex) + +## Features * Multi-platform support * Pure Qt4/Qt5 compatible code From 4eb22ac6dff278a41695864f3adf1f2f20482e31 Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Thu, 8 Aug 2019 22:02:44 +0300 Subject: [PATCH 06/13] Russian translation has been updated --- translations/limereport_ru.qm | Bin 123356 -> 124649 bytes translations/limereport_ru.ts | 99 ++++++++++++++++++++++------------ 2 files changed, 65 insertions(+), 34 deletions(-) diff --git a/translations/limereport_ru.qm b/translations/limereport_ru.qm index 12ec7530b47fb12eeb917efec1ff743ed4673b60..3a14c7e8b2b1993263ea938faeb5d67aaaa60cc5 100644 GIT binary patch delta 7046 zcmai&30O_}|HnU{d(Sy{zn5f2XEtY6gAxp9hrm;j_VM0`XF{5iAONemER*^Nb zM?^{#%8YdwW8WELOx9ui-}jz*=KnmuXa3Khhu691ocsNL_Rr^gZRH!VS55?3u z^V`}L6^-g2kIE|ir3+E5WFqQBoW6%hVI@AUClbFV;{Gz9=iA8{wPhYIBU1ShpMOWx z)`;(v%Y0NK^A+34=~HE{n=7**k;u|*6E+JX>OPlvxjRvhqr_eUc#`NwO_>im+sTQk zM7`39z0+hKUP(0YHF1sYM1zMAXZ%9+brjJx2p&HG0)0usybxklFPW|lN!UDv=;unA z_nwf&c7qdxNZ7iNxTqM+BKpl}CnsKznT3ULpNn3Qa6}+(LeDK z;VMgC`9gSWCvP}M;z_))AeO}PVxkv#e*QFZ=Q|{=Y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EAA~)04?k-mU|BwF@-xij$0;eP3QUvyXqS(m(tl=1H+!_%Qfx2MNg~I@L%+V2|9o-FiНазвание ряда + + ImageItemEditor + + Image Item Editor + Редакор изображения + + + Image + Изображение + + + ... + ... + + + Resource path + Путь к русурсам + + + Select image file + Выбрать файл изображения + + LRVariableDialog @@ -392,6 +415,10 @@ p, li { white-space: pre-wrap; } Copy Копировать + + Keep top space + Сохранять отступ сверху + LimeReport::BaseDesignIntf @@ -433,7 +460,7 @@ p, li { white-space: pre-wrap; } Lock item geometry - Блокировать изменения геометрии + Заблокировать геометрию элемента @@ -1003,11 +1030,11 @@ p, li { white-space: pre-wrap; } Scale - Масштабировать + Масштаб Split - Разделять на части + Разделить @@ -1130,6 +1157,10 @@ p, li { white-space: pre-wrap; } Watermark Водный знак + + Edit + Правка + LimeReport::ItemLocationPropItem @@ -1249,7 +1280,7 @@ p, li { white-space: pre-wrap; } Translate properties - Переводить имена свойств + Свойства перевода @@ -1329,10 +1360,6 @@ p, li { white-space: pre-wrap; } Report Отчет - - toolBar - Панель инструментов - Print Печать @@ -1433,10 +1460,6 @@ p, li { white-space: pre-wrap; } Show toolbar Показать панель инструментов - - toolBar_2 - Редактирование - InsertTextItem Вставить текстовый элемент @@ -1457,6 +1480,14 @@ p, li { white-space: pre-wrap; } Del Удалить + + MainToolBar + Основная панель инструментов + + + EditModeTools + Панель инструментов редактирования + LimeReport::ProxyHolder @@ -1881,7 +1912,7 @@ p, li { white-space: pre-wrap; } setPageSizeToPrinter - Отправить параметры страницы в принтер + Оправитьпараметры страницы в принтер fillInSecondPass @@ -1961,11 +1992,11 @@ p, li { white-space: pre-wrap; } option3 - + Опция 3 units - Единицы измерения + Еденицы измерения geometryLocked @@ -1973,7 +2004,7 @@ p, li { white-space: pre-wrap; } printBehavior - Режим печати + Поведение при печати @@ -2301,15 +2332,15 @@ p, li { white-space: pre-wrap; } Lock selected items - Заблокировать выбранные элементы + Заблокировать выделенные элементы Unlock selected items - Разблокировать выбранные элементы + Разблокировать выделенные элементы Select one level items - Выбрать все элементы одного уровня + Выделить элементы одного уровня @@ -2482,7 +2513,7 @@ This preview is no longer valid. CSV - + CSV Separator @@ -2494,7 +2525,7 @@ This preview is no longer valid. Use first row as header - Первая строка как заголовок + Использовать первую строку в качестве заголовка @@ -2729,7 +2760,7 @@ This preview is no longer valid. Report units - Единицы измерения + Еденицы измерения @@ -3146,18 +3177,18 @@ This preview is no longer valid. Export to PDF Экспортировать в PDF + + Dark + Темная + + + Light + Светаля + Default По умолчанию - - margin - Поля - - - '' - - Millimeters Миллиметры @@ -3167,12 +3198,12 @@ This preview is no longer valid. Дюймы - Dark - Темная + margin + Поля - Light - Светлая + '' + '' From 6c44ce86d2c280fd1027e669b27c55b6cb395da2 Mon Sep 17 00:00:00 2001 From: Rodrigo Torres Date: Sat, 10 Aug 2019 18:41:07 -0300 Subject: [PATCH 07/13] Update .travis.yml --- .travis.yml | 559 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 540 insertions(+), 19 deletions(-) diff --git a/.travis.yml b/.travis.yml index 39dedbc..f879261 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,27 +1,548 @@ -language: cpp +matrix: + include: + - env: Qt4.8.5_Ubuntu_14.04 + os: linux + dist: trusty + language: cpp + compiler: gcc + cache: ccache + addons: + apt: + packages: + - qt4-default + + script: + - qmake -r limereport.pro + - make + - make check -compiler: - - gcc + - env: Qt4.8.5_Ubuntu_14.04 + os: linux + dist: trusty + language: cpp + compiler: clang + cache: ccache + addons: + apt: + packages: + - qt4-default + + script: + - qmake -r limereport.pro + - make + - make check + + - env: Qt5.1.1_Ubuntu_14.04 + os: linux + dist: trusty + language: cpp + compiler: gcc + cache: ccache + addons: + apt: + sources: + - sourceline: 'ppa:beineri/opt-qt511-trusty' + packages: + - qt51base + - qt51script + - qt51tools + + script: + - source /opt/qt51/bin/qt51-env.sh + - /opt/qt51/bin/qmake -r limereport.pro + - make + - make check + + - env: Qt5.1.1_Ubuntu_14.04 + os: linux + dist: trusty + language: cpp + compiler: clang + cache: ccache + addons: + apt: + sources: + - sourceline: 'ppa:beineri/opt-qt511-trusty' + packages: + - qt51base + - qt51script + - qt51tools + + script: + - source /opt/qt51/bin/qt51-env.sh + - /opt/qt51/bin/qmake -r limereport.pro + - make + - make check -sudo: required -dist: trusty + - env: Qt5.2.1_Ubuntu_14.04 + os: linux + dist: trusty + language: cpp + compiler: gcc + cache: ccache + addons: + apt: + sources: + - sourceline: 'ppa:beineri/opt-qt521-trusty' + packages: + - qt52base + - qt52script + - qt52tools + + script: + - source /opt/qt52/bin/qt52-env.sh + - /opt/qt52/bin/qmake -r limereport.pro + - make + - make check -env: - - QT_BASE=56 + - env: Qt5.2.1_Ubuntu_14.04 + os: linux + dist: trusty + language: cpp + compiler: clang + cache: ccache + addons: + apt: + sources: + - sourceline: 'ppa:beineri/opt-qt521-trusty' + packages: + - qt52base + - qt52script + - qt52tools + + script: + - source /opt/qt52/bin/qt52-env.sh + - /opt/qt52/bin/qmake -r limereport.pro + - make + - make check + + - env: Qt5.3.2_Ubuntu_14.04 + os: linux + dist: trusty + language: cpp + compiler: gcc + cache: ccache + addons: + apt: + sources: + - sourceline: 'ppa:beineri/opt-qt532-trusty' + packages: + - qt53base + - qt53script + - qt53tools + + script: + - source /opt/qt53/bin/qt53-env.sh + - /opt/qt53/bin/qmake -r limereport.pro + - make + - make check -before_install: - - if [ "$QT_BASE" = "56" ]; then sudo add-apt-repository ppa:beineri/opt-qt562-trusty -y; fi - - sudo apt-get update -qq + - env: Qt5.3.2_Ubuntu_14.04 + os: linux + dist: trusty + language: cpp + compiler: clang + cache: ccache + addons: + apt: + sources: + - sourceline: 'ppa:beineri/opt-qt532-trusty' + packages: + - qt53base + - qt53script + - qt53tools + + script: + - source /opt/qt53/bin/qt53-env.sh + - /opt/qt53/bin/qmake -r limereport.pro + - make + - make check + + - env: Qt5.4.2_Ubuntu_14.04 + os: linux + dist: trusty + language: cpp + compiler: gcc + cache: ccache + addons: + apt: + sources: + - sourceline: 'ppa:beineri/opt-qt542-trusty' + packages: + - qt54base + - qt54script + - qt54tools + + script: + - source /opt/qt54/bin/qt54-env.sh + - /opt/qt54/bin/qmake -r limereport.pro + - make + - make check -install: - - if [ "$QT_BASE" = "56" ]; then sudo apt-get install -qq qt56base qt56script qt56tools ; source /opt/qt56/bin/qt56-env.sh; fi - + - env: Qt5.4.2_Ubuntu_14.04 + os: linux + dist: trusty + language: cpp + compiler: clang + cache: ccache + addons: + apt: + sources: + - sourceline: 'ppa:beineri/opt-qt542-trusty' + packages: + - qt54base + - qt54script + - qt54tools + + script: + - source /opt/qt54/bin/qt54-env.sh + - /opt/qt54/bin/qmake -r limereport.pro + - make + - make check + + - env: Qt5.5.1_Ubuntu_14.04 + os: linux + dist: trusty + language: cpp + compiler: gcc + cache: ccache + addons: + apt: + sources: + - sourceline: 'ppa:beineri/opt-qt551-trusty' + packages: + - qt55base + - qt55script + - qt55tools + + script: + - source /opt/qt55/bin/qt55-env.sh + - /opt/qt55/bin/qmake -r limereport.pro + - make + - make check -script: - - qmake -r limereport.pro - - make - - make check + - env: Qt5.5.1_Ubuntu_14.04 + os: linux + dist: trusty + language: cpp + compiler: clang + cache: ccache + addons: + apt: + sources: + - sourceline: 'ppa:beineri/opt-qt551-trusty' + packages: + - qt55base + - qt55script + - qt55tools + + script: + - source /opt/qt55/bin/qt55-env.sh + - /opt/qt55/bin/qmake -r limereport.pro + - make + - make check + + - env: Qt5.6.3_Ubuntu_14.04 + os: linux + dist: trusty + language: cpp + compiler: gcc + cache: ccache + addons: + apt: + sources: + - sourceline: 'ppa:beineri/opt-qt563-trusty' + packages: + - qt56base + - qt56script + - qt56tools + + script: + - source /opt/qt56/bin/qt56-env.sh + - /opt/qt56/bin/qmake -r limereport.pro + - make + - make check + - env: Qt5.6.3_Ubuntu_14.04 + os: linux + dist: trusty + language: cpp + compiler: clang + cache: ccache + addons: + apt: + sources: + - sourceline: 'ppa:beineri/opt-qt563-trusty' + packages: + - qt56base + - qt56script + - qt56tools + + script: + - source /opt/qt56/bin/qt56-env.sh + - /opt/qt56/bin/qmake -r limereport.pro + - make + - make check + + - env: Qt5.7.1_Ubuntu_14.04 + os: linux + dist: trusty + language: cpp + compiler: gcc + cache: ccache + addons: + apt: + sources: + - sourceline: 'ppa:beineri/opt-qt571-trusty' + packages: + - qt57base + - qt57script + - qt57tools + + script: + - source /opt/qt57/bin/qt57-env.sh + - /opt/qt57/bin/qmake -r limereport.pro + - make + - make check + + - env: Qt5.7.1_Ubuntu_14.04 + os: linux + dist: trusty + language: cpp + compiler: clang + cache: ccache + addons: + apt: + sources: + - sourceline: 'ppa:beineri/opt-qt571-trusty' + packages: + - qt57base + - qt57script + - qt57tools + + script: + - source /opt/qt57/bin/qt57-env.sh + - /opt/qt57/bin/qmake -r limereport.pro + - make + - make check + + - env: Qt5.8.0_Ubuntu_14.04 + os: linux + dist: trusty + language: cpp + compiler: gcc + cache: ccache + addons: + apt: + sources: + - sourceline: 'ppa:beineri/opt-qt58-trusty' + packages: + - qt58base + - qt58script + - qt58tools + + script: + - source /opt/qt58/bin/qt58-env.sh + - /opt/qt58/bin/qmake -r limereport.pro + - make + - make check + + - env: Qt5.8.0_Ubuntu_14.04 + os: linux + dist: trusty + language: cpp + compiler: clang + cache: ccache + addons: + apt: + sources: + - sourceline: 'ppa:beineri/opt-qt58-trusty' + packages: + - qt58base + - qt58script + - qt58tools + + script: + - source /opt/qt58/bin/qt58-env.sh + - /opt/qt58/bin/qmake -r limereport.pro + - make + - make check + + - env: Qt5.9.7_Ubuntu_14.04 + os: linux + dist: trusty + language: cpp + compiler: gcc + cache: ccache + addons: + apt: + sources: + - sourceline: 'ppa:beineri/opt-qt597-trusty' + packages: + - qt59base + - qt59script + - qt59tools + + script: + - source /opt/qt59/bin/qt59-env.sh + - /opt/qt59/bin/qmake -r limereport.pro + - make + - make check + + - env: Qt5.9.7_Ubuntu_14.04 + os: linux + dist: trusty + language: cpp + compiler: clang + cache: ccache + addons: + apt: + sources: + - sourceline: 'ppa:beineri/opt-qt597-trusty' + packages: + - qt59base + - qt59script + - qt59tools + + script: + - source /opt/qt59/bin/qt59-env.sh + - /opt/qt59/bin/qmake -r limereport.pro + - make + - make check + + - env: Qt5.10.1_Ubuntu_14.04 + os: linux + dist: trusty + language: cpp + compiler: gcc + cache: ccache + addons: + apt: + sources: + - sourceline: 'ppa:beineri/opt-qt-5.10.1-trusty' + packages: + - qt510base + - qt510script + - qt510tools + + script: + - source /opt/qt510/bin/qt510-env.sh + - /opt/qt510/bin/qmake -r limereport.pro + - make + - make check + + - env: Qt5.10.1_Ubuntu_14.04 + os: linux + dist: trusty + language: cpp + compiler: clang + cache: ccache + addons: + apt: + sources: + - sourceline: 'ppa:beineri/opt-qt-5.10.1-trusty' + packages: + - qt510base + - qt510script + - qt510tools + + script: + - source /opt/qt510/bin/qt510-env.sh + - /opt/qt510/bin/qmake -r limereport.pro + - make + - make check + + - env: Qt5.11.3_Ubuntu_18.04 + os: linux + dist: bionic + language: cpp + compiler: gcc + cache: ccache + addons: + apt: + sources: + - sourceline: 'ppa:beineri/opt-qt-5.11.3-bionic' + packages: + - qt511base + - qt511script + - qt511tools + - mesa-common-dev + - libgl1-mesa-dev + + script: + - source /opt/qt511/bin/qt511-env.sh + - /opt/qt511/bin/qmake -r limereport.pro + - make + - make check + + - env: Qt5.11.3_Ubuntu_18.04 + os: linux + dist: bionic + language: cpp + compiler: clang + cache: ccache + addons: + apt: + sources: + - sourceline: 'ppa:beineri/opt-qt-5.11.3-bionic' + packages: + - qt511base + - qt511script + - qt511tools + - mesa-common-dev + - libgl1-mesa-dev + + script: + - source /opt/qt511/bin/qt511-env.sh + - /opt/qt511/bin/qmake -r limereport.pro + - make + - make check + + - env: Qt5.12.3_Ubuntu_18.04 + os: linux + dist: bionic + language: cpp + compiler: gcc + cache: ccache + addons: + apt: + sources: + - sourceline: 'ppa:beineri/opt-qt-5.12.3-bionic' + packages: + - qt512base + - qt512script + - qt512tools + - mesa-common-dev + - libgl1-mesa-dev + + script: + - source /opt/qt512/bin/qt512-env.sh + - /opt/qt512/bin/qmake -r limereport.pro + - make + - make check + + - env: Qt5.12.3_Ubuntu_18.04 + os: linux + dist: bionic + language: cpp + compiler: clang + cache: ccache + addons: + apt: + sources: + - sourceline: 'ppa:beineri/opt-qt-5.12.3-bionic' + packages: + - qt512base + - qt512script + - qt512tools + - mesa-common-dev + - libgl1-mesa-dev + + script: + - source /opt/qt512/bin/qt512-env.sh + - /opt/qt512/bin/qmake -r limereport.pro + - make + - make check + notifications: - email: false - + email: false \ No newline at end of file From c549035c7638f844ab86b944d5d6d687022cee38 Mon Sep 17 00:00:00 2001 From: Rodrigo Torres Date: Sat, 10 Aug 2019 18:45:27 -0300 Subject: [PATCH 08/13] Fix compilation Qt4 still have one remaining compiler error --- limereport.pro | 7 ++++++- limereport/exporters/lrpdfexporter.h | 2 +- limereport/items/lrimageitemeditor.h | 2 +- limereport/lrbanddesignintf.cpp | 2 +- limereport/lrreportdesignwidget.h | 4 ++-- limereport/lrreportengine.cpp | 4 ++-- limereport/lrscriptenginemanager.cpp | 2 +- limereport/objectinspector/lrobjectpropitem.h | 5 ++++- 8 files changed, 18 insertions(+), 10 deletions(-) diff --git a/limereport.pro b/limereport.pro index 9e33bcc..9bc801f 100644 --- a/limereport.pro +++ b/limereport.pro @@ -16,9 +16,14 @@ SUBDIRS += \ limereport \ demo_r1 \ demo_r2 \ - console \ designer +greaterThan(QT_MAJOR_VERSION, 4){ +greaterThan(QT_MINOR_VERSION, 1){ + SUBDIRS += console + } +} + !contains(CONFIG, embedded_designer){ !contains(CONFIG, static_build){ SUBDIRS += designer_plugin diff --git a/limereport/exporters/lrpdfexporter.h b/limereport/exporters/lrpdfexporter.h index 225c80b..d758ff1 100644 --- a/limereport/exporters/lrpdfexporter.h +++ b/limereport/exporters/lrpdfexporter.h @@ -11,7 +11,7 @@ class PDFExporter : public QObject, public ReportExporterInterface { Q_OBJECT public: - explicit PDFExporter(ReportEnginePrivate *parent = nullptr); + explicit PDFExporter(ReportEnginePrivate *parent = NULL); // ReportExporterInterface interface bool exportPages(ReportPages pages, const QString &fileName, const QMap ¶ms); QString exporterName() diff --git a/limereport/items/lrimageitemeditor.h b/limereport/items/lrimageitemeditor.h index a8cc474..551baae 100644 --- a/limereport/items/lrimageitemeditor.h +++ b/limereport/items/lrimageitemeditor.h @@ -16,7 +16,7 @@ class ImageItemEditor : public QWidget Q_OBJECT public: - explicit ImageItemEditor(LimeReport::ImageItem* item, QWidget *parent = nullptr); + explicit ImageItemEditor(LimeReport::ImageItem* item, QWidget *parent = NULL); ~ImageItemEditor(); private: void updateImage(); diff --git a/limereport/lrbanddesignintf.cpp b/limereport/lrbanddesignintf.cpp index d8a6bbb..1690bbc 100644 --- a/limereport/lrbanddesignintf.cpp +++ b/limereport/lrbanddesignintf.cpp @@ -176,7 +176,7 @@ BandDesignIntf::BandDesignIntf(BandsType bandType, const QString &xmlTypeName, Q if (parentItem) setWidth(parentItem->width()); } - setBackgroundMode(BGMode::TransparentMode); + setBackgroundMode(BaseDesignIntf::TransparentMode); setFillTransparentInDesignMode(false); setHeight(100); setFixedPos(true); diff --git a/limereport/lrreportdesignwidget.h b/limereport/lrreportdesignwidget.h index 4b7248e..ef3b81b 100644 --- a/limereport/lrreportdesignwidget.h +++ b/limereport/lrreportdesignwidget.h @@ -82,12 +82,12 @@ private: class PageView: public QGraphicsView{ public: - PageView(QWidget *parent = nullptr): QGraphicsView(parent), + PageView(QWidget *parent = NULL): QGraphicsView(parent), m_horizontalRuller(0), m_verticalRuller(0) { setViewportMargins(20,20,0,0); } - PageView(QGraphicsScene *scene, QWidget *parent = nullptr): + PageView(QGraphicsScene *scene, QWidget *parent = NULL): QGraphicsView(scene, parent), m_horizontalRuller(0), m_verticalRuller(0) { diff --git a/limereport/lrreportengine.cpp b/limereport/lrreportengine.cpp index c07cff4..8a624e2 100644 --- a/limereport/lrreportengine.cpp +++ b/limereport/lrreportengine.cpp @@ -299,7 +299,7 @@ void ReportEnginePrivate::printReport(ItemsReaderIntf::Ptr reader, QPrinter& pri void ReportEnginePrivate::printReport(ReportPages pages, QPrinter &printer) { int currenPage = 1; - QMap> printProcessors; + QMap > printProcessors; printProcessors.insert("default",QSharedPointer(new PrintProcessor(&printer))); foreach(PageItemDesignIntf::Ptr page, pages){ if ( @@ -320,7 +320,7 @@ void ReportEnginePrivate::printReport(ReportPages pages, QMap> printProcessors; + QMap > printProcessors; for (int i = 0; i < printers.keys().count(); ++i) { printProcessors.insert(printers.keys()[i],QSharedPointer(new PrintProcessor(printers[printers.keys()[i]]))); } diff --git a/limereport/lrscriptenginemanager.cpp b/limereport/lrscriptenginemanager.cpp index cb6e219..f126a4c 100644 --- a/limereport/lrscriptenginemanager.cpp +++ b/limereport/lrscriptenginemanager.cpp @@ -1930,7 +1930,7 @@ bool DatasourceFunctions::isEOF(const QString &datasourceName) bool DatasourceFunctions::invalidate(const QString& datasourceName) { if (m_dataManager && m_dataManager->dataSource(datasourceName)){ - m_dataManager->dataSourceHolder(datasourceName)->invalidate(IDataSource::DatasourceMode::RENDER_MODE); + m_dataManager->dataSourceHolder(datasourceName)->invalidate(IDataSource::RENDER_MODE); return true; } return false; diff --git a/limereport/objectinspector/lrobjectpropitem.h b/limereport/objectinspector/lrobjectpropitem.h index 46392fc..f765213 100644 --- a/limereport/objectinspector/lrobjectpropitem.h +++ b/limereport/objectinspector/lrobjectpropitem.h @@ -99,7 +99,7 @@ namespace LimeReport{ #endif private: bool m_valid; - void invalidate(){m_object=0; m_objects=0; m_valid = false; m_name = ""; m_value=QVariant(), m_isClass=false;} + void invalidate(){m_object=0; m_objects=0; m_valid = false; m_name = ""; m_value=QVariant(); m_isClass=false;} protected: void beginChangeValue(){ m_changingValue = true; } @@ -140,4 +140,7 @@ namespace LimeReport{ }; } + +Q_DECLARE_METATYPE(LimeReport::ObjectPropItem*) + #endif // LROBJECTPROPITEM_H From fa795fe3ab922320b13b0a8bd11ba53106021b49 Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Sun, 11 Aug 2019 12:48:16 +0300 Subject: [PATCH 09/13] Qt4 build has been fixed --- common.pri | 2 +- limereport/lrbasedesignintf.h | 4 +++- limereport/lrpagedesignintf.cpp | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/common.pri b/common.pri index cbe3fc1..64fa9c2 100644 --- a/common.pri +++ b/common.pri @@ -127,7 +127,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MINOR = 5 -LIMEREPORT_VERSION_RELEASE = 7 +LIMEREPORT_VERSION_RELEASE = 9 LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}' DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\" diff --git a/limereport/lrbasedesignintf.h b/limereport/lrbasedesignintf.h index 40c4761..b7fbbbb 100644 --- a/limereport/lrbasedesignintf.h +++ b/limereport/lrbasedesignintf.h @@ -262,7 +262,7 @@ public: QString itemTypeName() const; void setItemTypeName(const QString &itemTypeName); - void emitObjectNamePropertyChanged(const QString& oldName, const QString& newName); + int borderLineSize() const; void setBorderLineSize(int value); void showEditorDialog(); @@ -303,7 +303,9 @@ public: bool fillTransparentInDesignMode() const; void setFillTransparentInDesignMode(bool fillTransparentInDesignMode); + void emitPosChanged(QPointF oldPos, QPointF newPos); + void emitObjectNamePropertyChanged(const QString& oldName, const QString& newName); bool isGeometryLocked() const; void setGeometryLocked(bool itemLocked); diff --git a/limereport/lrpagedesignintf.cpp b/limereport/lrpagedesignintf.cpp index bc81b94..89a18f4 100644 --- a/limereport/lrpagedesignintf.cpp +++ b/limereport/lrpagedesignintf.cpp @@ -2136,7 +2136,7 @@ bool PosChangedCommand::doIt() if (reportItem && (reportItem->pos() != m_newPos[i].pos)){ QPointF oldValue = reportItem->pos(); reportItem->setPos(m_newPos[i].pos); - emit reportItem->posChanged(reportItem, oldValue, reportItem->pos()); + reportItem->emitPosChanged(oldValue, reportItem->pos()); } } From fde44e67c17d0470db991087d1448f9fb55e2c04 Mon Sep 17 00:00:00 2001 From: Arin Alex Date: Mon, 9 Sep 2019 21:25:08 +0300 Subject: [PATCH 10/13] Nested scripts have been fixed --- common.pri | 2 +- include/lrglobal.h | 4 ++ limereport/items/lrabstractlayout.h | 2 +- limereport/lrglobal.h | 4 ++ limereport/lrscriptenginemanager.cpp | 85 +++++++++++++++------------- limereport/lrscriptenginemanager.h | 74 ++++++++++++++---------- 6 files changed, 99 insertions(+), 72 deletions(-) diff --git a/common.pri b/common.pri index 64fa9c2..20eedaf 100644 --- a/common.pri +++ b/common.pri @@ -127,7 +127,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MINOR = 5 -LIMEREPORT_VERSION_RELEASE = 9 +LIMEREPORT_VERSION_RELEASE = 10 LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}' DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\" diff --git a/include/lrglobal.h b/include/lrglobal.h index da6ab47..3ba2b02 100644 --- a/include/lrglobal.h +++ b/include/lrglobal.h @@ -91,6 +91,10 @@ namespace Const{ const QString EOW("~!@#$%^&*()+{}|:\"<>?,/;'[]\\-="); const int DEFAULT_TAB_INDENTION = 4; const int DOCKWIDGET_MARGINS = 4; + + const char SCRIPT_SIGN = 'S'; + const char FIELD_SIGN = 'D'; + const char VARIABLE_SIGN = 'V'; } QString extractClassName(QString className); QString escapeSimbols(const QString& value); diff --git a/limereport/items/lrabstractlayout.h b/limereport/items/lrabstractlayout.h index 1324ff7..07a1d9f 100644 --- a/limereport/items/lrabstractlayout.h +++ b/limereport/items/lrabstractlayout.h @@ -34,7 +34,7 @@ public: int childrenCount(); int layoutSpacing() const; void setLayoutSpacing(int layoutSpacing); - qreal layoutSpacingMM(){ return m_layoutSpacing * unitFactor();} + qreal layoutSpacingMM(){ return m_layoutSpacing * Const::mmFACTOR;} protected: void beforeDelete(); void childAddedEvent(BaseDesignIntf *child); diff --git a/limereport/lrglobal.h b/limereport/lrglobal.h index da6ab47..3ba2b02 100644 --- a/limereport/lrglobal.h +++ b/limereport/lrglobal.h @@ -91,6 +91,10 @@ namespace Const{ const QString EOW("~!@#$%^&*()+{}|:\"<>?,/;'[]\\-="); const int DEFAULT_TAB_INDENTION = 4; const int DOCKWIDGET_MARGINS = 4; + + const char SCRIPT_SIGN = 'S'; + const char FIELD_SIGN = 'D'; + const char VARIABLE_SIGN = 'V'; } QString extractClassName(QString className); QString escapeSimbols(const QString& value); diff --git a/limereport/lrscriptenginemanager.cpp b/limereport/lrscriptenginemanager.cpp index f126a4c..05dba0a 100644 --- a/limereport/lrscriptenginemanager.cpp +++ b/limereport/lrscriptenginemanager.cpp @@ -465,15 +465,13 @@ QString ScriptEngineManager::expandScripts(QString context, QVariant& varValue, if (context.contains(rx)){ - if (ScriptEngineManager::instance().dataManager()!=dataManager()) + if (ScriptEngineManager::instance().dataManager() != dataManager()) ScriptEngineManager::instance().setDataManager(dataManager()); ScriptEngineType* se = ScriptEngineManager::instance().scriptEngine(); if (reportItem){ - ScriptValueType svThis; - #ifdef USE_QJSENGINE svThis = getJSValue(*se, reportItem); se->globalObject().setProperty("THIS",svThis); @@ -490,29 +488,37 @@ QString ScriptEngineManager::expandScripts(QString context, QVariant& varValue, ScriptExtractor scriptExtractor(context); if (scriptExtractor.parse()){ - for(int i=0; ievaluate(scriptBody); -#ifdef USE_QJSENGINE - if (!value.isError()){ - varValue = value.toVariant(); - context.replace(scriptExtractor.scriptAt(i),value.toString()); - } else { - context.replace(scriptExtractor.scriptAt(i),value.toString()); - } -#else - if (!se->hasUncaughtException()) { - varValue = value.toVariant(); - context.replace(scriptExtractor.scriptAt(i),value.toString()); - } else { - context.replace(scriptExtractor.scriptAt(i),se->uncaughtException().toString()); - } -#endif - } + context = replaceScripts(context, varValue, reportItem, se, scriptExtractor.scriptTree()); } - } + } + return context; +} + +QString ScriptEngineManager::replaceScripts(QString context, QVariant &varValue, QObject *reportItem, ScriptEngineType* se, ScriptNode *scriptTree) +{ + foreach(ScriptNode* item, scriptTree->children()){ + QString scriptBody = expandDataFields(item->body(), EscapeSymbols, varValue, reportItem); + if (item->children().size() > 0) + scriptBody = replaceScripts(scriptBody, varValue, reportItem, se, item); + scriptBody = expandUserVariables(scriptBody, FirstPass, EscapeSymbols, varValue); + ScriptValueType value = se->evaluate(scriptBody); +#ifdef USE_QJSENGINE + if (!value.isError()){ + varValue = value.toVariant(); + context.replace(item->script(), value.toString()); + } else { + context.replace(item->script(), value.toString()); + } +#else + if (!se->hasUncaughtException()) { + varValue = value.toVariant(); + context.replace(scriptTree->children()[i]->script(), value.toString()); + } else { + context.replace(scriptTree->children()[i]->script(), se->uncaughtException().toString()); + } +#endif + } return context; } @@ -530,7 +536,7 @@ QVariant ScriptEngineManager::evaluateScript(const QString& script){ ScriptExtractor scriptExtractor(script); if (scriptExtractor.parse()){ - QString scriptBody = expandDataFields(scriptExtractor.bodyAt(0),EscapeSymbols, varValue, 0); + QString scriptBody = expandDataFields(scriptExtractor.scriptTree()[0].body(), EscapeSymbols, varValue, 0); scriptBody = expandUserVariables(scriptBody, FirstPass, EscapeSymbols, varValue); ScriptValueType value = se->evaluate(scriptBody); #ifdef USE_QJSENGINE @@ -976,12 +982,11 @@ ScriptEngineManager::ScriptEngineManager() bool ScriptExtractor::parse() { int currentPos = 0; - parse(currentPos,None); - return m_scriptsBody.count()>0; - + parse(currentPos, None, m_scriptTree); + return m_scriptTree->children().count() > 0; } -bool ScriptExtractor::parse(int &curPos,const State& state) +bool ScriptExtractor::parse(int &curPos, const State& state, ScriptNode* scriptNode) { while (curPoscreateChildNode()); if (isStartFieldLexem(curPos) || isStartVariableLexem(curPos)) skipField(curPos); } @@ -1008,13 +1013,13 @@ bool ScriptExtractor::parse(int &curPos,const State& state) return false; } -void ScriptExtractor::extractScript(int &curPos, const QString& startStr) +void ScriptExtractor::extractScript(int &curPos, const QString& startStr, ScriptNode* scriptNode) { int startPos = curPos; - if (extractBracket(curPos)){ + if (extractBracket(curPos, scriptNode)){ QString scriptBody = substring(m_context,startPos+1,curPos); - m_scriptsBody.push_back(scriptBody); - m_scriptsStartLex.push_back(startStr+'{'); + scriptNode->setBody(scriptBody); + scriptNode->setStartLex(startStr+'{'); } } @@ -1028,10 +1033,10 @@ void ScriptExtractor::skipField(int &curPos){ } } -bool ScriptExtractor::extractBracket(int &curPos) +bool ScriptExtractor::extractBracket(int &curPos, ScriptNode* scriptNode) { curPos++; - return parse(curPos,OpenBracketFound); + return parse(curPos,OpenBracketFound, scriptNode); } bool ScriptExtractor::isStartLexem(int& curPos, QChar value){ @@ -1064,16 +1069,16 @@ bool ScriptExtractor::isStartLexem(int& curPos, QChar value){ bool ScriptExtractor::isStartScriptLexem(int& curPos) { - return isStartLexem(curPos, SCRIPT_SIGN); + return isStartLexem(curPos, Const::SCRIPT_SIGN); } bool ScriptExtractor::isStartFieldLexem(int& curPos){ - return isStartLexem(curPos, FIELD_SIGN); + return isStartLexem(curPos, Const::FIELD_SIGN); } bool ScriptExtractor::isStartVariableLexem(int &curPos) { - return isStartLexem(curPos, VARIABLE_SIGN); + return isStartLexem(curPos, Const::VARIABLE_SIGN); } diff --git a/limereport/lrscriptenginemanager.h b/limereport/lrscriptenginemanager.h index f59405c..784253d 100644 --- a/limereport/lrscriptenginemanager.h +++ b/limereport/lrscriptenginemanager.h @@ -396,6 +396,47 @@ private: QMap m_wrappersFactory; }; +class ScriptNode{ +public: + QString body(){return m_body;} + void setBody(const QString& body){ m_body = body;} + void setStartLex(const QString startLex){ m_startLex = startLex;} + QString script(){return m_startLex + m_body + '}';} + ScriptNode* createChildNode(){ + ScriptNode* result = new ScriptNode(); + m_children.append(result); + return result; + } + QVector children() const {return m_children;} +private: + QVector m_children; + QString m_body; + QString m_startLex; +}; + +class ScriptExtractor +{ +public: + enum State{None,BuksFound,SFound,StartScriptFound,OpenBracketFound,CloseBracketFound,DFound,VFound, SignFound}; + explicit ScriptExtractor(const QString& value): + m_context(value), m_scriptTree(new ScriptNode()){} + bool parse(); + ScriptNode* scriptTree(){return m_scriptTree;} +private: + bool isStartLexem(int &curPos, QChar value); + bool parse(int& curPos, const State &state, ScriptNode *scriptNode); + void skipField(int &curPos); + void extractScript(int& curPos, const QString &startStr, ScriptNode *scriptNode); + bool extractBracket(int& curPos, ScriptNode *scriptNode); + bool isStartScriptLexem(int &curPos); + bool isStartFieldLexem(int &curPos); + bool isStartVariableLexem(int &curPos); + QString substring(const QString& value, int start, int end); +private: + QString m_context; + ScriptNode* m_scriptTree; +}; + class ScriptEngineManager : public QObject, public Singleton, public IScriptEngineManager { Q_OBJECT @@ -423,6 +464,9 @@ public: QString expandUserVariables(QString context, RenderPass pass, ExpandType expandType, QVariant &varValue); QString expandDataFields(QString context, ExpandType expandType, QVariant &varValue, QObject* reportItem); QString expandScripts(QString context, QVariant &varValue, QObject* reportItem); + + QString replaceScripts(QString context, QVariant& varValue, QObject *reportItem, ScriptEngineType *se, ScriptNode* scriptTree); + QVariant evaluateScript(const QString &script); void addBookMark(const QString &uniqKey, const QString &content); int findPageIndexByBookmark(const QString& uniqKey); @@ -466,36 +510,6 @@ private: ScriptFunctionsManager* m_functionManager; }; -class ScriptExtractor -{ -public: - enum State{None,BuksFound,SFound,StartScriptFound,OpenBracketFound,CloseBracketFound,DFound,VFound, SignFound}; - explicit ScriptExtractor(const QString& value):m_context(value){} - bool parse(); - int count(){return m_scriptsBody.count();} - QString bodyAt(int index){return m_scriptsBody[index];} - QString scriptAt(int index){return m_scriptsStartLex[index]+m_scriptsBody[index]+'}';} - -private: - static const char SCRIPT_SIGN = 'S'; - static const char FIELD_SIGN = 'D'; - static const char VARIABLE_SIGN = 'V'; - - bool isStartLexem(int &curPos, QChar value); - bool parse(int& curPos, const State &state); - void skipField(int &curPos); - void extractScript(int& curPos, const QString &startStr); - bool extractBracket(int& curPos); - bool isStartScriptLexem(int &curPos); - bool isStartFieldLexem(int &curPos); - bool isStartVariableLexem(int &curPos); - QString substring(const QString& value, int start, int end); -private: - QString m_context; - QVector m_scriptsBody; - QVector m_scriptsStartLex; - -}; #ifdef USE_QTSCRIPTENGINE class QFontPrototype : public QObject, public QScriptable { From 3b360e0f71ea3771e40074b82bede7894e498fd8 Mon Sep 17 00:00:00 2001 From: Arin Alex Date: Mon, 9 Sep 2019 22:33:13 +0300 Subject: [PATCH 11/13] Qt4 build fixed --- common.pri | 2 +- limereport/lrscriptenginemanager.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common.pri b/common.pri index 20eedaf..e2a07e5 100644 --- a/common.pri +++ b/common.pri @@ -127,7 +127,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MINOR = 5 -LIMEREPORT_VERSION_RELEASE = 10 +LIMEREPORT_VERSION_RELEASE = 11 LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}' DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\" diff --git a/limereport/lrscriptenginemanager.cpp b/limereport/lrscriptenginemanager.cpp index 05dba0a..91bc9bc 100644 --- a/limereport/lrscriptenginemanager.cpp +++ b/limereport/lrscriptenginemanager.cpp @@ -513,9 +513,9 @@ QString ScriptEngineManager::replaceScripts(QString context, QVariant &varValue, #else if (!se->hasUncaughtException()) { varValue = value.toVariant(); - context.replace(scriptTree->children()[i]->script(), value.toString()); + context.replace(item->script(), value.toString()); } else { - context.replace(scriptTree->children()[i]->script(), se->uncaughtException().toString()); + context.replace(item->script(), se->uncaughtException().toString()); } #endif } From 5c7c9a1baca943471e4861d28d16f3f112a99872 Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Tue, 10 Sep 2019 22:49:49 +0300 Subject: [PATCH 12/13] Items alignment tools has been refactored --- common.pri | 2 +- limereport/lrpagedesignintf.cpp | 63 +++++++++++++++++++++++++++------ limereport/lrpagedesignintf.h | 2 ++ 3 files changed, 55 insertions(+), 12 deletions(-) diff --git a/common.pri b/common.pri index e2a07e5..fa50060 100644 --- a/common.pri +++ b/common.pri @@ -127,7 +127,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MINOR = 5 -LIMEREPORT_VERSION_RELEASE = 11 +LIMEREPORT_VERSION_RELEASE = 12 LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}' DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\" diff --git a/limereport/lrpagedesignintf.cpp b/limereport/lrpagedesignintf.cpp index 89a18f4..3e0ad34 100644 --- a/limereport/lrpagedesignintf.cpp +++ b/limereport/lrpagedesignintf.cpp @@ -1459,15 +1459,24 @@ void PageDesignIntf::sendToBack() } } +bool PageDesignIntf::selectionContainsBand(){ + foreach(QGraphicsItem * item,selectedItems()){ + BandDesignIntf *band = dynamic_cast(item); + if (band) return true; + } + return false; +} + void PageDesignIntf::alignToLeft() { if ((selectedItems().count() > 0) && m_firstSelectedItem) { CommandGroup::Ptr cm = CommandGroup::create(); + bool moveInBand = selectionContainsBand(); foreach(QGraphicsItem * item, selectedItems()) { BaseDesignIntf *bdItem = dynamic_cast(item); if (bdItem && !bdItem->isGeometryLocked()) { QRectF oldGeometry = bdItem->geometry(); - bdItem->setPos(QPoint(m_firstSelectedItem->pos().x(), item->pos().y())); + bdItem->setPos(QPointF(moveInBand ? 0 : m_firstSelectedItem->pos().x(), item->pos().y())); CommandIf::Ptr command = PropertyChangedCommand::create(this, bdItem->objectName(), "geometry", oldGeometry, bdItem->geometry()); cm->addCommand(command, false); } @@ -1480,11 +1489,19 @@ void PageDesignIntf::alignToRigth() { if ((selectedItems().count() > 0) && m_firstSelectedItem) { CommandGroup::Ptr cm = CommandGroup::create(); + bool moveInBand = selectionContainsBand(); foreach(QGraphicsItem * item, selectedItems()) { BaseDesignIntf *bdItem = dynamic_cast(item); - if (bdItem && !bdItem->isGeometryLocked()) { + if (bdItem && !bdItem->isGeometryLocked() && !bdItem->isBand()) { QRectF oldGeometry = bdItem->geometry(); - bdItem->setPos(QPoint(m_firstSelectedItem->geometry().right() - bdItem->width(), bdItem->pos().y())); + if (moveInBand && dynamic_cast(bdItem->parent())) + { + bdItem->setPos(QPointF(dynamic_cast(bdItem->parent())->geometry().width() - bdItem->width(), + bdItem->pos().y())); + } else { + qreal x = m_firstSelectedItem->geometry().right() - bdItem->width(); + bdItem->setPos(QPointF(x+1, bdItem->pos().y())); + } CommandIf::Ptr command = PropertyChangedCommand::create(this, bdItem->objectName(), "geometry", oldGeometry, bdItem->geometry()); cm->addCommand(command, false); } @@ -1497,11 +1514,18 @@ void PageDesignIntf::alignToVCenter() { if ((selectedItems().count() > 0) && m_firstSelectedItem) { CommandGroup::Ptr cm = CommandGroup::create(); + bool moveInBand = selectionContainsBand(); foreach(QGraphicsItem * item, selectedItems()) { BaseDesignIntf *bdItem = dynamic_cast(item); - if (bdItem && !bdItem->isGeometryLocked()) { + if (bdItem && !bdItem->isGeometryLocked() && !bdItem->isBand()) { QRectF oldGeometry = bdItem->geometry(); - bdItem->setPos(QPoint((m_firstSelectedItem->geometry().right() - m_firstSelectedItem->width() / 2) - bdItem->width() / 2, bdItem->pos().y())); + if (moveInBand && dynamic_cast(bdItem->parent())){ + bdItem->setPos(QPointF((dynamic_cast(bdItem->parent())->geometry().width() / 2) - bdItem->width() / 2, + bdItem->pos().y())); + } else { + qreal x = (m_firstSelectedItem->geometry().right() - m_firstSelectedItem->width() / 2) - bdItem->width() / 2; + bdItem->setPos(QPointF(x+1, bdItem->pos().y())); + } CommandIf::Ptr command = PropertyChangedCommand::create(this, bdItem->objectName(), "geometry", oldGeometry, bdItem->geometry()); cm->addCommand(command, false); } @@ -1514,11 +1538,16 @@ void PageDesignIntf::alignToTop() { if ((selectedItems().count() > 0) && m_firstSelectedItem) { CommandGroup::Ptr cm = CommandGroup::create(); + bool moveInBand = selectionContainsBand(); foreach(QGraphicsItem * item, selectedItems()) { BaseDesignIntf *bdItem = dynamic_cast(item); - if (bdItem && !bdItem->isGeometryLocked()) { + if (bdItem && !bdItem->isGeometryLocked() && !bdItem->isBand()) { QRectF oldGeometry = bdItem->geometry(); - bdItem->setPos(QPoint(bdItem->pos().x(), m_firstSelectedItem->pos().y())); + if (moveInBand){ + bdItem->setPos(QPointF(0, m_firstSelectedItem->pos().y())); + } else { + bdItem->setPos(QPointF(bdItem->pos().x(), m_firstSelectedItem->pos().y())); + } CommandIf::Ptr command = PropertyChangedCommand::create(this, bdItem->objectName(), "geometry", oldGeometry, bdItem->geometry()); cm->addCommand(command, false); } @@ -1531,11 +1560,17 @@ void PageDesignIntf::alignToBottom() { if ((selectedItems().count() > 0) && m_firstSelectedItem) { CommandGroup::Ptr cm = CommandGroup::create(); + bool moveInBand = selectionContainsBand(); foreach(QGraphicsItem * item, selectedItems()) { BaseDesignIntf *bdItem = dynamic_cast(item); - if (bdItem && !bdItem->isGeometryLocked()) { + if (bdItem && !bdItem->isGeometryLocked() && !bdItem->isBand()) { QRectF oldGeometry = bdItem->geometry(); - bdItem->setPos(QPoint(bdItem->pos().x(), m_firstSelectedItem->geometry().bottom() - bdItem->height())); + if (moveInBand && dynamic_cast(bdItem->parent())){ + bdItem->setPos(QPointF(bdItem->pos().x(), dynamic_cast(bdItem->parent())->height() - bdItem->height())); + } else { + qreal y = m_firstSelectedItem->geometry().bottom() - bdItem->height(); + bdItem->setPos(QPointF(bdItem->pos().x(), y+1)); + } CommandIf::Ptr command = PropertyChangedCommand::create(this, bdItem->objectName(), "geometry", oldGeometry, bdItem->geometry()); cm->addCommand(command, false); } @@ -1548,11 +1583,17 @@ void PageDesignIntf::alignToHCenter() { if ((selectedItems().count() > 0) && m_firstSelectedItem) { CommandGroup::Ptr cm = CommandGroup::create(); + bool moveInBand = selectionContainsBand(); foreach(QGraphicsItem * item, selectedItems()) { BaseDesignIntf *bdItem = dynamic_cast(item); - if (bdItem && !bdItem->isGeometryLocked()) { + if (bdItem && !bdItem->isGeometryLocked() && !bdItem->isBand()) { QRectF oldGeometry = bdItem->geometry(); - bdItem->setPos(QPoint(bdItem->pos().x(), (m_firstSelectedItem->geometry().bottom() - m_firstSelectedItem->height() / 2) - bdItem->height() / 2)); + if (moveInBand && dynamic_cast(bdItem->parent())){ + bdItem->setPos(QPointF(bdItem->pos().x(), (dynamic_cast(bdItem->parent())->height() / 2) - bdItem->height() / 2)); + } else { + qreal y = (m_firstSelectedItem->geometry().bottom() - m_firstSelectedItem->height() / 2) - bdItem->height() / 2; + bdItem->setPos(QPointF(bdItem->pos().x(), y+1)); + } CommandIf::Ptr command = PropertyChangedCommand::create(this, bdItem->objectName(), "geometry", oldGeometry, bdItem->geometry()); cm->addCommand(command, false); } diff --git a/limereport/lrpagedesignintf.h b/limereport/lrpagedesignintf.h index d94abfe..b02a2de 100644 --- a/limereport/lrpagedesignintf.h +++ b/limereport/lrpagedesignintf.h @@ -282,6 +282,7 @@ namespace LimeReport { void changeSelectedGroupProperty(const QString& name,const QVariant& value); void activateItemToJoin(QRectF itemRect, QList& items); void selectAllChildren(BaseDesignIntf* item); + bool selectionContainsBand(); private: enum JoinType{Width, Height}; LimeReport::PageItemDesignIntf::Ptr m_pageItem; @@ -322,6 +323,7 @@ namespace LimeReport { bool m_magneticMovement; ReportSettings* m_reportSettings; PageItemDesignIntf* m_currentPage; + }; class AbstractPageCommand : public CommandIf{ From 076576ce883888cc237718857a7fdfccf34ce074 Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Mon, 23 Sep 2019 14:20:00 +0300 Subject: [PATCH 13/13] setPageItems method has been fixed --- common.pri | 2 +- limereport/lrpagedesignintf.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/common.pri b/common.pri index fa50060..7913e8e 100644 --- a/common.pri +++ b/common.pri @@ -127,7 +127,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MINOR = 5 -LIMEREPORT_VERSION_RELEASE = 12 +LIMEREPORT_VERSION_RELEASE = 13 LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}' DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\" diff --git a/limereport/lrpagedesignintf.cpp b/limereport/lrpagedesignintf.cpp index 3e0ad34..52c1e4d 100644 --- a/limereport/lrpagedesignintf.cpp +++ b/limereport/lrpagedesignintf.cpp @@ -278,6 +278,7 @@ void PageDesignIntf::setPageItem(PageItemDesignIntf::Ptr pageItem) void PageDesignIntf::setPageItems(QList pages) { + m_currentPage = 0; if (!m_pageItem.isNull()) { removeItem(m_pageItem.data()); m_pageItem.clear();