From 7bc3a7e1cd9590afa6eac052e7bcc86b29031b7e Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Tue, 15 Jan 2019 13:59:00 +0300 Subject: [PATCH 01/10] Layout painting has been refactored --- limereport/items/lrabstractlayout.cpp | 36 +++++++++++++++++---------- limereport/items/lrabstractlayout.h | 3 ++- limereport/lrpagedesignintf.cpp | 2 ++ 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/limereport/items/lrabstractlayout.cpp b/limereport/items/lrabstractlayout.cpp index 02b8ca8..47283b7 100644 --- a/limereport/items/lrabstractlayout.cpp +++ b/limereport/items/lrabstractlayout.cpp @@ -116,22 +116,32 @@ bool AbstractLayout::isEmpty() const return (isEmpty && allItemsIsText); } -void AbstractLayout::paint(QPainter* ppainter, const QStyleOptionGraphicsItem* option, QWidget* widget) +void AbstractLayout::paintChild(BaseDesignIntf *child, QPointF parentPos, QPainter *painter) { - if (isSelected()){ - foreach( BaseDesignIntf* item, m_children){ - ppainter->save(); - ppainter->setPen(Qt::red); - ppainter->drawRect( - QRectF(item->pos().x(),item->pos().y(), - item->rect().bottomRight().rx(), - item->rect().bottomRight().ry() - ) - ); - ppainter->restore(); + if (!child->childBaseItems().isEmpty()){ + foreach (BaseDesignIntf* item, child->childBaseItems()) { + paintChild(item, child->pos(),painter); } } - LayoutDesignIntf::paint(ppainter, option, widget); + painter->drawRect( + QRectF(parentPos.x()+child->pos().x(), parentPos.y()+child->pos().y(), + child->rect().bottomRight().rx(), + child->rect().bottomRight().ry() + ) + ); +} + +void AbstractLayout::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) +{ + if (isSelected()){ + painter->save(); + painter->setPen(Qt::red); + foreach( BaseDesignIntf* item, m_children){ + paintChild(item, QPointF(0,0), painter); + } + painter->restore(); + } + LayoutDesignIntf::paint(painter, option, widget); } int AbstractLayout::childrenCount() diff --git a/limereport/items/lrabstractlayout.h b/limereport/items/lrabstractlayout.h index 52deaed..6f5e796 100644 --- a/limereport/items/lrabstractlayout.h +++ b/limereport/items/lrabstractlayout.h @@ -24,7 +24,8 @@ public: void addChild(BaseDesignIntf *item,bool updateSize=true); void restoreChild(BaseDesignIntf *item); bool isEmpty() const; - void paint(QPainter* ppainter, const QStyleOptionGraphicsItem* option, QWidget* widget); + void paintChild(BaseDesignIntf* child, QPointF parentPos, QPainter* painter); + void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget); bool hideEmptyItems() const; void setHideEmptyItems(bool hideEmptyItems); diff --git a/limereport/lrpagedesignintf.cpp b/limereport/lrpagedesignintf.cpp index d712528..6581029 100644 --- a/limereport/lrpagedesignintf.cpp +++ b/limereport/lrpagedesignintf.cpp @@ -2200,6 +2200,7 @@ void InsertHLayoutCommand::undoIt() bi->setPos(m_elements.value(bi->objectName())); bi->setFixedPos(false); bi->setPossibleResizeDirectionFlags(BaseDesignIntf::AllDirections); + bi->setVisible(true); } } page()->removeReportItem(layout,false); @@ -2384,6 +2385,7 @@ void InsertVLayoutCommand::undoIt() bi->setPos(m_elements.value(bi->objectName())); bi->setFixedPos(false); bi->setPossibleResizeDirectionFlags(BaseDesignIntf::AllDirections); + bi->setVisible(true); } } page()->removeReportItem(layout,false); From a79a4f6b6823abcf81e7997c1aa242041dfac762 Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Wed, 16 Jan 2019 04:00:54 +0300 Subject: [PATCH 02/10] designer_plugin.pro fixed --- designer_plugin/designer_plugin.pro | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/designer_plugin/designer_plugin.pro b/designer_plugin/designer_plugin.pro index 1c39b32..219a796 100644 --- a/designer_plugin/designer_plugin.pro +++ b/designer_plugin/designer_plugin.pro @@ -38,9 +38,9 @@ contains(CONFIG,zint){ INCLUDEPATH += $$ZINT_PATH/backend $$ZINT_PATH/backend_qt DEPENDPATH += $$ZINT_PATH/backend $$ZINT_PATH/backend_qt LIBS += -L$${DEST_LIBS} - contains(CONFIG,release) { - LIBS += -lQtZint - } else { + CONFIG(debug, debug|release){ LIBS += -lQtZintd + } else { + LIBS += -lQtZint } } From 561f64b1b65abf7b0ac0a4b352545645c5d66308 Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Wed, 16 Jan 2019 20:26:17 +0300 Subject: [PATCH 03/10] Some unused code was deleted --- common.pri | 2 +- limereport/lrpagedesignintf.cpp | 62 +++--- limereport/lrpagedesignintf.h | 368 +++++++++++++++----------------- 3 files changed, 204 insertions(+), 228 deletions(-) diff --git a/common.pri b/common.pri index c1fbd66..b2d17a5 100644 --- a/common.pri +++ b/common.pri @@ -77,7 +77,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MINOR = 4 -LIMEREPORT_VERSION_RELEASE = 113 +LIMEREPORT_VERSION_RELEASE = 114 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 9f7705b..f8c983c 100644 --- a/limereport/lrpagedesignintf.cpp +++ b/limereport/lrpagedesignintf.cpp @@ -67,8 +67,6 @@ bool bandSortBandLessThen(const BandDesignIntf *c1, const BandDesignIntf *c2) PageDesignIntf::PageDesignIntf(QObject *parent): QGraphicsScene(parent), - m_pageSize(A4), - m_orientation(Portrait), m_pageItem(0), m_insertMode(false), m_itemInsertRect(0), @@ -84,8 +82,6 @@ PageDesignIntf::PageDesignIntf(QObject *parent): m_executingGroupCommand(false), m_settings(0), m_selectionRect(0), - //m_verticalGridStep(1*Const::mmFACTOR), - //m_horizontalGridStep(1*Const::mmFACTOR) m_verticalGridStep(2), m_horizontalGridStep(2), m_updating(false), @@ -134,22 +130,22 @@ void PageDesignIntf::updatePageRect() emit sceneRectChanged(sceneRect()); } -PageDesignIntf::Orientation PageDesignIntf::getOrientation() -{ - return m_orientation; -} +//PageDesignIntf::Orientation PageDesignIntf::getOrientation() +//{ +// return m_orientation; +//} -void PageDesignIntf::setPageSize(PageDesignIntf::PageSize sizeType, QSizeF sizeValue) -{ - m_pageSize = sizeType; - m_pageSizeValue = sizeValue; - updatePageRect(); -} +//void PageDesignIntf::setPageSize(PageDesignIntf::PageSize sizeType, QSizeF sizeValue) +//{ +// m_pageSize = sizeType; +// m_pageSizeValue = sizeValue; +// updatePageRect(); +//} -PageDesignIntf::PageSize PageDesignIntf::pageSize() const -{ - return m_pageSize; -} +//PageDesignIntf::PageSize PageDesignIntf::pageSize() const +//{ +// return m_pageSize; +//} void PageDesignIntf::keyPressEvent(QKeyEvent *event) { @@ -672,22 +668,22 @@ bool PageDesignIntf::isExistsObjectName(const QString &objectName, QList pages); + QList pageItems(){return m_reportPages;} - void startInsertMode(const QString& ItemType); - void startEditMode(); + bool isItemInsertMode(); + ReportEnginePrivate* reportEditor(); + void setReportEditor(ReportEnginePrivate* value){m_reportEditor=value;} - PageItemDesignIntf *pageItem(); - void setPageItem(PageItemDesignIntf::Ptr pageItem); - void setPageItems(QList pages); - QList pageItems(){return m_reportPages;} + QStringList possibleParentItems(); + void registerItem(BaseDesignIntf* item); + void registerBand(BandDesignIntf* band); + void removeAllItems(); - bool isItemInsertMode(); - ReportEnginePrivate* reportEditor(); - void setReportEditor(ReportEnginePrivate* value){m_reportEditor=value;} + void setItemMode(BaseDesignIntf::ItemMode state); + BaseDesignIntf::ItemMode itemMode(){return m_itemMode;} + BaseDesignIntf* reportItemByName(const QString& name); + QList reportItemsByName(const QString &name); + BaseDesignIntf* addReportItem(const QString& itemType, QPointF pos, QSizeF size); + BaseDesignIntf* addReportItem(const QString& itemType, QObject *owner=0, BaseDesignIntf *parent=0); + BaseDesignIntf* createReportItem(const QString& itemType, QObject *owner=0, BaseDesignIntf *parent=0); + void removeReportItem(BaseDesignIntf* item, bool createComand = true); + CommandIf::Ptr removeReportItemCommand(BaseDesignIntf *item); + bool saveCommand(CommandIf::Ptr command, bool runCommand = true); - QStringList possibleParentItems(); - void registerItem(BaseDesignIntf* item); - void registerBand(BandDesignIntf* band); - void removeAllItems(); + bool isCanRedo(); + bool isCanUndo(); + bool isHasChanges(); - void setItemMode(BaseDesignIntf::ItemMode state); - BaseDesignIntf::ItemMode itemMode(){return m_itemMode;} - BaseDesignIntf* reportItemByName(const QString& name); - QList reportItemsByName(const QString &name); - BaseDesignIntf* addReportItem(const QString& itemType, QPointF pos, QSizeF size); - BaseDesignIntf* addReportItem(const QString& itemType, QObject *owner=0, BaseDesignIntf *parent=0); - BaseDesignIntf* createReportItem(const QString& itemType, QObject *owner=0, BaseDesignIntf *parent=0); - void removeReportItem(BaseDesignIntf* item, bool createComand = true); - CommandIf::Ptr removeReportItemCommand(BaseDesignIntf *item); - bool saveCommand(CommandIf::Ptr command, bool runCommand = true); + void reactivatePageItem(PageItemDesignIntf::Ptr pageItem); - bool isCanRedo(); - bool isCanUndo(); - bool isHasChanges(); + void setSettings(QSettings* settings){ m_settings = settings;} + QSettings* settings(){ return m_settings;} - void reactivatePageItem(PageItemDesignIntf::Ptr pageItem); + QString genObjectName(const QObject& object); - void setSettings(QSettings* settings){ m_settings = settings;} - QSettings* settings(){ return m_settings;} + void animateItem(BaseDesignIntf* item); + void setSelectionRect(QRectF selectionRect); + void emitRegisterdItem(BaseDesignIntf *item); + void emitItemRemoved(BaseDesignIntf* item); - QString genObjectName(const QObject& object); + DataSourceManager* datasourceManager(); + bool isSaved(){ return !m_hasHanges;} + void changeSelectedGrpoupTextAlignPropperty(const bool& horizontalAlign, Qt::AlignmentFlag flag); - void animateItem(BaseDesignIntf* item); - void setSelectionRect(QRectF selectionRect); - void emitRegisterdItem(BaseDesignIntf *item); - void emitItemRemoved(BaseDesignIntf* item); + int verticalGridStep() const; + void setVerticalGridStep(int verticalGridStep); - DataSourceManager* datasourceManager(); - bool isSaved(){ return !m_hasHanges;} - void changeSelectedGrpoupTextAlignPropperty(const bool& horizontalAlign, Qt::AlignmentFlag flag); + int horizontalGridStep() const; + void setHorizontalGridStep(int horizontalGridStep); - int verticalGridStep() const; - void setVerticalGridStep(int verticalGridStep); + void beginUpdate(){m_updating = true;} + bool isUpdating(){return m_updating;} + void endUpdate(); - int horizontalGridStep() const; - void setHorizontalGridStep(int horizontalGridStep); - - void beginUpdate(){m_updating = true;} - bool isUpdating(){return m_updating;} - void endUpdate(); - - void itemMoved(BaseDesignIntf* item); - bool magneticMovement() const; - void setMagneticMovement(bool magneticMovement); - - ReportSettings *getReportSettings() const; - void setReportSettings(ReportSettings *reportSettings); - - void setPropertyToSelectedItems(const char *name, const QVariant &value); + void itemMoved(BaseDesignIntf* item); + bool magneticMovement() const; + void setMagneticMovement(bool magneticMovement); + ReportSettings *getReportSettings() const; + void setReportSettings(ReportSettings *reportSettings); + void setPropertyToSelectedItems(const char *name, const QVariant &value); protected: + virtual void keyPressEvent(QKeyEvent *event); + virtual void keyReleaseEvent(QKeyEvent *event); + virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event); + virtual void mousePressEvent(QGraphicsSceneMouseEvent *event); + virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); - virtual void keyPressEvent(QKeyEvent *event); - virtual void keyReleaseEvent(QKeyEvent *event); - virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event); - virtual void mousePressEvent(QGraphicsSceneMouseEvent *event); - virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); + virtual void dragEnterEvent(QGraphicsSceneDragDropEvent *event); + virtual void dragMoveEvent(QGraphicsSceneDragDropEvent *); + virtual void dragLeaveEvent(QGraphicsSceneDragDropEvent *event); + virtual void dropEvent(QGraphicsSceneDragDropEvent *event); - virtual void dragEnterEvent(QGraphicsSceneDragDropEvent *event); - virtual void dragMoveEvent(QGraphicsSceneDragDropEvent *); - virtual void dragLeaveEvent(QGraphicsSceneDragDropEvent *event); - virtual void dropEvent(QGraphicsSceneDragDropEvent *event); + LimeReport::BandDesignIntf::BandsType findPriorType(LimeReport::BandDesignIntf::BandsType bandType); + BaseDesignIntf *findDestObject(BaseDesignIntf *item); - LimeReport::BandDesignIntf::BandsType findPriorType(LimeReport::BandDesignIntf::BandsType bandType); - BaseDesignIntf *findDestObject(BaseDesignIntf *item); + bool isExistsObjectName (const QString& objectName, QList &itemsList) const; - bool isExistsObjectName (const QString& objectName, QList &itemsList) const; - QRectF getRectByPageSize(PageSize pageSize); + bool isLoading(); + void objectLoadStarted(); + void objectLoadFinished(); - bool isLoading(); - void objectLoadStarted(); - void objectLoadFinished(); - - HorizontalLayout* internalAddHLayout(); - QPointF placePosOnGrid(QPointF point); - QSizeF placeSizeOnGrid(QSizeF size); + HorizontalLayout* internalAddHLayout(); + QPointF placePosOnGrid(QPointF point); + QSizeF placeSizeOnGrid(QSizeF size); signals: - void geometryChanged(QRectF newGeometry); - void insertModeStarted(); - void itemInserted(LimeReport::PageDesignIntf* report, QPointF pos, const QString& ItemType); - void itemInsertCanceled(const QString& ItemType); - void itemSelected(LimeReport::BaseDesignIntf *item); - void multiItemsSelected(QList* objectsList); - void miltiItemsSelectionFinished(); - void commandHistoryChanged(); - void itemPropertyChanged(const QString& objectName, const QString& propertyName, const QVariant& oldValue, const QVariant& newValue); - void itemAdded(LimeReport::PageDesignIntf* page, LimeReport::BaseDesignIntf* item); - void itemRemoved(LimeReport::PageDesignIntf* page, LimeReport::BaseDesignIntf* item); - void bandAdded(LimeReport::PageDesignIntf* page, LimeReport::BandDesignIntf* band); - void bandRemoved(LimeReport::PageDesignIntf* page, LimeReport::BandDesignIntf* band); - void pageUpdateFinished(LimeReport::PageDesignIntf* page); - public slots: - BaseDesignIntf* addBand(const QString& bandType); - BaseDesignIntf* addBand(BandDesignIntf::BandsType bandType); - void removeBand(LimeReport::BandDesignIntf* band); - void bandGeometryChanged(QObject* object, QRectF newGeometry, QRectF oldGeometry); - void bandPosChanged(QObject* object, QPointF newPos, QPointF oldPos); - void slotUpdateItemSize(); - void undo(); - void redo(); - void copy(); - void paste(); - void deleteSelected(); - void cut(); - void setToSaved(); - void bringToFront(); - void sendToBack(); - void alignToLeft(); - void alignToRigth(); - void alignToVCenter(); - void alignToTop(); - void alignToBottom(); - void alignToHCenter(); - void sameWidth(); - void sameHeight(); - void addHLayout(); - void setFont(const QFont &font); - void setTextAlign(const Qt::Alignment& alignment); - void setBorders(const BaseDesignIntf::BorderLines& border); - private slots: - void slotPageGeometryChanged(QObject*, QRectF, QRectF ); - void slotItemPropertyChanged(QString propertyName, const QVariant &oldValue, const QVariant &newValue); - void slotItemPropertyObjectNameChanged(const QString& oldName, const QString& newName); - void bandDeleted(QObject* band); - void slotPageItemLoaded(QObject *); - void slotSelectionChanged(); - void slotAnimationStoped(QObject *animation); - private: - template - BaseDesignIntf* internalAddBand(T bandType); - void finalizeInsertMode(); - void saveSelectedItemsPos(); - void saveSelectedItemsGeometry(); - void checkSizeOrPosChanges(); - CommandIf::Ptr createChangePosCommand(); - CommandIf::Ptr createChangeSizeCommand(); - void saveChangeProppertyCommand(const QString& objectName, const QString& propertyName, const QVariant& oldPropertyValue, const QVariant& newPropertyValue); - void changeSelectedGroupProperty(const QString& name,const QVariant& value); - - private: - enum JoinType{Width, Height}; - PageSize m_pageSize; - QSizeF m_pageSizeValue; - Orientation m_orientation; - QRectF m_geometry; - LimeReport::PageItemDesignIntf::Ptr m_pageItem; - QList m_reportPages; - ReportEnginePrivate* m_reportEditor; - bool m_insertMode; - QGraphicsItem * m_itemInsertRect; - QString m_insertItemType; - BaseDesignIntf::ItemMode m_itemMode; - QGraphicsRectItem* m_cutterBorder; - QGraphicsRectItem* m_pageRect; - QVector m_commandsList; - QVector m_positionStamp; - QVector m_geometryStamp; - BaseDesignIntf* m_firstSelectedItem; - int m_currentCommand; - bool m_changeSizeMode; - bool m_changePosMode; - bool m_changePosOrSizeMode; - bool m_executingCommand; - bool m_hasHanges; - bool m_isLoading; - bool m_executingGroupCommand; - QSettings* m_settings; - QList m_animationList; - QPointF m_startSelectionPoint; - QGraphicsRectItem* m_selectionRect; - int m_verticalGridStep; - int m_horizontalGridStep; - bool m_updating; - int m_currentObjectIndex; - bool m_multiSelectStarted; - QList m_projections; - BaseDesignIntf* m_movedItem; - BaseDesignIntf* m_movedItemContainer; - BaseDesignIntf* m_joinItem; - JoinType m_joinType; - bool m_magneticMovement; - ReportSettings* m_reportSettings; + void geometryChanged(QRectF newGeometry); + void insertModeStarted(); + void itemInserted(LimeReport::PageDesignIntf* report, QPointF pos, const QString& ItemType); + void itemInsertCanceled(const QString& ItemType); + void itemSelected(LimeReport::BaseDesignIntf *item); + void multiItemsSelected(QList* objectsList); + void miltiItemsSelectionFinished(); + void commandHistoryChanged(); + void itemPropertyChanged(const QString& objectName, const QString& propertyName, const QVariant& oldValue, const QVariant& newValue); + void itemAdded(LimeReport::PageDesignIntf* page, LimeReport::BaseDesignIntf* item); + void itemRemoved(LimeReport::PageDesignIntf* page, LimeReport::BaseDesignIntf* item); + void bandAdded(LimeReport::PageDesignIntf* page, LimeReport::BandDesignIntf* band); + void bandRemoved(LimeReport::PageDesignIntf* page, LimeReport::BandDesignIntf* band); + void pageUpdateFinished(LimeReport::PageDesignIntf* page); + public slots: + BaseDesignIntf* addBand(const QString& bandType); + BaseDesignIntf* addBand(BandDesignIntf::BandsType bandType); + void removeBand(LimeReport::BandDesignIntf* band); + void bandGeometryChanged(QObject* object, QRectF newGeometry, QRectF oldGeometry); + void bandPosChanged(QObject* object, QPointF newPos, QPointF oldPos); + void slotUpdateItemSize(); + void undo(); + void redo(); + void copy(); + void paste(); + void deleteSelected(); + void cut(); + void setToSaved(); + void bringToFront(); + void sendToBack(); + void alignToLeft(); + void alignToRigth(); + void alignToVCenter(); + void alignToTop(); + void alignToBottom(); + void alignToHCenter(); + void sameWidth(); + void sameHeight(); + void addHLayout(); + void setFont(const QFont &font); + void setTextAlign(const Qt::Alignment& alignment); + void setBorders(const BaseDesignIntf::BorderLines& border); + private slots: + void slotPageGeometryChanged(QObject*, QRectF, QRectF ); + void slotItemPropertyChanged(QString propertyName, const QVariant &oldValue, const QVariant &newValue); + void slotItemPropertyObjectNameChanged(const QString& oldName, const QString& newName); + void bandDeleted(QObject* band); + void slotPageItemLoaded(QObject *); + void slotSelectionChanged(); + void slotAnimationStoped(QObject *animation); + private: + template + BaseDesignIntf* internalAddBand(T bandType); + void finalizeInsertMode(); + void saveSelectedItemsPos(); + void saveSelectedItemsGeometry(); + void checkSizeOrPosChanges(); + CommandIf::Ptr createChangePosCommand(); + CommandIf::Ptr createChangeSizeCommand(); + void saveChangeProppertyCommand(const QString& objectName, const QString& propertyName, const QVariant& oldPropertyValue, const QVariant& newPropertyValue); + void changeSelectedGroupProperty(const QString& name,const QVariant& value); + private: + enum JoinType{Width, Height}; + LimeReport::PageItemDesignIntf::Ptr m_pageItem; + QList m_reportPages; + ReportEnginePrivate* m_reportEditor; + bool m_insertMode; + QGraphicsItem * m_itemInsertRect; + QString m_insertItemType; + BaseDesignIntf::ItemMode m_itemMode; + QGraphicsRectItem* m_cutterBorder; + QGraphicsRectItem* m_pageRect; + QVector m_commandsList; + QVector m_positionStamp; + QVector m_geometryStamp; + BaseDesignIntf* m_firstSelectedItem; + int m_currentCommand; + bool m_changeSizeMode; + bool m_changePosMode; + bool m_changePosOrSizeMode; + bool m_executingCommand; + bool m_hasHanges; + bool m_isLoading; + bool m_executingGroupCommand; + QSettings* m_settings; + QList m_animationList; + QPointF m_startSelectionPoint; + QGraphicsRectItem* m_selectionRect; + int m_verticalGridStep; + int m_horizontalGridStep; + bool m_updating; + int m_currentObjectIndex; + bool m_multiSelectStarted; + QList m_projections; + BaseDesignIntf* m_movedItem; + BaseDesignIntf* m_movedItemContainer; + BaseDesignIntf* m_joinItem; + JoinType m_joinType; + bool m_magneticMovement; + ReportSettings* m_reportSettings; }; class AbstractPageCommand : public CommandIf{ From f154909c69813d08622a56b7fd8435f5bf35af8a Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Thu, 17 Jan 2019 00:55:26 +0300 Subject: [PATCH 04/10] Redundant geometry change event has been removed --- common.pri | 2 +- limereport/lrbasedesignintf.cpp | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/common.pri b/common.pri index b2d17a5..222482d 100644 --- a/common.pri +++ b/common.pri @@ -77,7 +77,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MINOR = 4 -LIMEREPORT_VERSION_RELEASE = 114 +LIMEREPORT_VERSION_RELEASE = 116 LIMEREPORT_VERSION = '\\"$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}\\"' DEFINES += LIMEREPORT_VERSION_STR=\"$${LIMEREPORT_VERSION}\" diff --git a/limereport/lrbasedesignintf.cpp b/limereport/lrbasedesignintf.cpp index 732933c..3a3a22b 100644 --- a/limereport/lrbasedesignintf.cpp +++ b/limereport/lrbasedesignintf.cpp @@ -1124,12 +1124,6 @@ void BaseDesignIntf::setItemPos(const QPointF &newPos) void BaseDesignIntf::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { QGraphicsItem::mouseReleaseEvent(event); - QRectF newGeometry = geometry(); - if (newGeometry != m_oldGeometry) { - geometryChangedEvent(newGeometry, m_oldGeometry); - updateSelectionMarker(); - emit(geometryChanged(this, newGeometry, m_oldGeometry)); - } } void BaseDesignIntf::showEditorDialog(){ From 5d019fbd87e6c40faf41c0151b7e333cd2d00e0d Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Fri, 18 Jan 2019 20:18:45 +0300 Subject: [PATCH 05/10] Null pointer access has been fixed --- common.pri | 2 +- limereport/items/lrtextitem.cpp | 24 +++++++++++++----------- limereport/lrbasedesignintf.cpp | 28 +++++++++++++++------------- limereport/lrpageitemdesignintf.cpp | 7 +++---- 4 files changed, 32 insertions(+), 29 deletions(-) diff --git a/common.pri b/common.pri index 222482d..ab95c10 100644 --- a/common.pri +++ b/common.pri @@ -77,7 +77,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MINOR = 4 -LIMEREPORT_VERSION_RELEASE = 116 +LIMEREPORT_VERSION_RELEASE = 117 LIMEREPORT_VERSION = '\\"$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}\\"' DEFINES += LIMEREPORT_VERSION_STR=\"$${LIMEREPORT_VERSION}\" diff --git a/limereport/items/lrtextitem.cpp b/limereport/items/lrtextitem.cpp index a4384b0..eae907f 100644 --- a/limereport/items/lrtextitem.cpp +++ b/limereport/items/lrtextitem.cpp @@ -113,17 +113,19 @@ void TextItem::processPopUpAction(QAction *action) if (action->text().compare(tr("Edit")) == 0){ this->showEditorDialog(); } - if (action->text().compare(tr("Auto height")) == 0){ - page()->setPropertyToSelectedItems("autoHeight",action->isChecked()); - } - if (action->text().compare(tr("Allow HTML")) == 0){ - page()->setPropertyToSelectedItems("allowHTML",action->isChecked()); - } - if (action->text().compare(tr("Allow HTML in fields")) == 0){ - page()->setPropertyToSelectedItems("allowHTMLInFields",action->isChecked()); - } - if (action->text().compare(tr("Stretch to max height")) == 0){ - page()->setPropertyToSelectedItems("stretchToMaxHeight",action->isChecked()); + if (page()){ + if (action->text().compare(tr("Auto height")) == 0){ + page()->setPropertyToSelectedItems("autoHeight",action->isChecked()); + } + if (action->text().compare(tr("Allow HTML")) == 0){ + page()->setPropertyToSelectedItems("allowHTML",action->isChecked()); + } + if (action->text().compare(tr("Allow HTML in fields")) == 0){ + page()->setPropertyToSelectedItems("allowHTMLInFields",action->isChecked()); + } + if (action->text().compare(tr("Stretch to max height")) == 0){ + page()->setPropertyToSelectedItems("stretchToMaxHeight",action->isChecked()); + } } } diff --git a/limereport/lrbasedesignintf.cpp b/limereport/lrbasedesignintf.cpp index 3a3a22b..39de032 100644 --- a/limereport/lrbasedesignintf.cpp +++ b/limereport/lrbasedesignintf.cpp @@ -544,10 +544,12 @@ void BaseDesignIntf::mouseMoveEvent(QGraphicsSceneMouseEvent *event) setItemPos(QPointF(div(m_startPos.x(), hStep).quot * hStep, div(m_startPos.y(), vStep).quot * vStep) - delta); - if (!isBand() && scene()->selectedItems().count()>1) - moveSelectedItems(tmpPos - pos()); - if (scene()->selectedItems().count()==1 && (page()->magneticMovement())) - page()->itemMoved(this); + if (page()){ + if (!isBand() && page()->selectedItems().count()>1) + moveSelectedItems(tmpPos - pos()); + if (page()->selectedItems().count()==1 && (page()->magneticMovement())) + page()->itemMoved(this); + } } } @@ -806,29 +808,29 @@ void BaseDesignIntf::setBorderLineSize(int value) void BaseDesignIntf::moveRight() { - if (!m_fixedPos) setItemPos(pos().x() + page()->horizontalGridStep(), pos().y()); + if (!m_fixedPos && page()) setItemPos(pos().x() + page()->horizontalGridStep(), pos().y()); } void BaseDesignIntf::moveLeft() { - if (!m_fixedPos) setItemPos(pos().x() - page()->horizontalGridStep(), pos().y()); + if (!m_fixedPos && page()) setItemPos(pos().x() - page()->horizontalGridStep(), pos().y()); } void BaseDesignIntf::moveDown() { - if (!m_fixedPos) setItemPos(pos().x(), pos().y() + page()->verticalGridStep()); + if (!m_fixedPos && page()) setItemPos(pos().x(), pos().y() + page()->verticalGridStep()); } void BaseDesignIntf::moveUp() { - if (!m_fixedPos) setItemPos(pos().x(), pos().y() - page()->verticalGridStep()); + if (!m_fixedPos && page()) setItemPos(pos().x(), pos().y() - page()->verticalGridStep()); } void BaseDesignIntf::sizeRight() { if ((m_possibleResizeDirectionFlags & ResizeLeft) || (m_possibleResizeDirectionFlags & ResizeRight)) { - setWidth(width() + page()->horizontalGridStep()); + if (page()) setWidth(width() + page()->horizontalGridStep()); } } @@ -836,7 +838,7 @@ void BaseDesignIntf::sizeLeft() { if ((m_possibleResizeDirectionFlags & ResizeLeft) || (m_possibleResizeDirectionFlags & ResizeRight)) { - setWidth(width() - page()->horizontalGridStep()); + if(page()) setWidth(width() - page()->horizontalGridStep()); } } @@ -844,7 +846,7 @@ void BaseDesignIntf::sizeUp() { if ((m_possibleResizeDirectionFlags & ResizeTop) || (m_possibleResizeDirectionFlags & ResizeBottom)) { - setHeight(height() - page()->verticalGridStep()); + if (page()) setHeight(height() - page()->verticalGridStep()); } } @@ -852,7 +854,7 @@ void BaseDesignIntf::sizeDown() { if ((m_possibleResizeDirectionFlags & ResizeTop) || (m_possibleResizeDirectionFlags & ResizeBottom)) { - setHeight(height() + page()->verticalGridStep()); + if (page()) setHeight(height() + page()->verticalGridStep()); } } @@ -1325,7 +1327,7 @@ void BaseDesignIntf::collectionLoadFinished(const QString &collectionName) foreach(QObject * obj, QObject::children()) { #endif BaseDesignIntf *item = dynamic_cast(obj); - if (item) { + if (item && page()) { page()->registerItem(item); } } diff --git a/limereport/lrpageitemdesignintf.cpp b/limereport/lrpageitemdesignintf.cpp index 364d42e..af65436 100644 --- a/limereport/lrpageitemdesignintf.cpp +++ b/limereport/lrpageitemdesignintf.cpp @@ -690,10 +690,9 @@ void PageItemDesignIntf::bandGeometryChanged(QObject* object, QRectF newGeometry } } } - if (curIndex != band->bandIndex()){ - //swapBands(band, bandToSwap); - //page()->saveCommand(BandSwapCommand::create(page(), band->objectName(), bandToSwap->objectName()), true); - page()->saveCommand(BandMoveFromToCommand::create(page(), band->bandIndex(), bandToSwap->bandIndex()), true); + if (curIndex != band->bandIndex() && itemMode() == DesignMode){ + if (page()) + page()->saveCommand(BandMoveFromToCommand::create(page(), band->bandIndex(), bandToSwap->bandIndex()), true); } relocateBands(); } From 603d80e1a5b16727b2179852a65d6119d1ab6096 Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Fri, 18 Jan 2019 23:44:58 +0300 Subject: [PATCH 06/10] Geometry change event has been reverted --- limereport/lrbasedesignintf.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/limereport/lrbasedesignintf.cpp b/limereport/lrbasedesignintf.cpp index 39de032..610bd5f 100644 --- a/limereport/lrbasedesignintf.cpp +++ b/limereport/lrbasedesignintf.cpp @@ -1126,6 +1126,12 @@ void BaseDesignIntf::setItemPos(const QPointF &newPos) void BaseDesignIntf::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { QGraphicsItem::mouseReleaseEvent(event); + QRectF newGeometry = geometry(); + if (newGeometry != m_oldGeometry) { + geometryChangedEvent(newGeometry, m_oldGeometry); + updateSelectionMarker(); + emit(geometryChanged(this, newGeometry, m_oldGeometry)); + } } void BaseDesignIntf::showEditorDialog(){ From 1135cbd4243dd269a121fedee11ec0a7fd51f234 Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Fri, 18 Jan 2019 23:45:16 +0300 Subject: [PATCH 07/10] Designtime behavior has been removed from render process --- common.pri | 2 +- limereport/lrpageitemdesignintf.cpp | 52 +++++++++++++++-------------- 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/common.pri b/common.pri index ab95c10..38ad957 100644 --- a/common.pri +++ b/common.pri @@ -77,7 +77,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MINOR = 4 -LIMEREPORT_VERSION_RELEASE = 117 +LIMEREPORT_VERSION_RELEASE = 118 LIMEREPORT_VERSION = '\\"$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}\\"' DEFINES += LIMEREPORT_VERSION_STR=\"$${LIMEREPORT_VERSION}\" diff --git a/limereport/lrpageitemdesignintf.cpp b/limereport/lrpageitemdesignintf.cpp index af65436..c3a20e7 100644 --- a/limereport/lrpageitemdesignintf.cpp +++ b/limereport/lrpageitemdesignintf.cpp @@ -666,33 +666,35 @@ void PageItemDesignIntf::moveBandFromTo(int from, int to) void PageItemDesignIntf::bandGeometryChanged(QObject* object, QRectF newGeometry, QRectF oldGeometry) { - BandDesignIntf* band = dynamic_cast(object); - int curIndex = band->bandIndex(); - BandDesignIntf* bandToSwap = 0; - foreach(BandDesignIntf* curBand, bands()){ - if (newGeometry.y() > oldGeometry.y()) { - if (curBand->bandType() == band->bandType() - && curIndex < curBand->bandIndex() - && (curBand->pos().y() + (curBand->height()/2)) < newGeometry.y() - && curBand->parentBand() == band->parentBand()) - { - curIndex = curBand->bandIndex(); - bandToSwap = curBand; - } - } else { - if (curBand->bandType() == band->bandType() - && curIndex>curBand->bandIndex() - && (curBand->pos().y() + (curBand->height()/2)) > newGeometry.y() - && curBand->parentBand() == band->parentBand()) - { - curIndex = curBand->bandIndex(); - bandToSwap = curBand; + if (itemMode() == DesignMode){ + BandDesignIntf* band = dynamic_cast(object); + int curIndex = band->bandIndex(); + BandDesignIntf* bandToSwap = 0; + foreach(BandDesignIntf* curBand, bands()){ + if (newGeometry.y() > oldGeometry.y()) { + if (curBand->bandType() == band->bandType() + && curIndex < curBand->bandIndex() + && (curBand->pos().y() + (curBand->height()/2)) < newGeometry.y() + && curBand->parentBand() == band->parentBand()) + { + curIndex = curBand->bandIndex(); + bandToSwap = curBand; + } + } else { + if (curBand->bandType() == band->bandType() + && curIndex>curBand->bandIndex() + && (curBand->pos().y() + (curBand->height()/2)) > newGeometry.y() + && curBand->parentBand() == band->parentBand()) + { + curIndex = curBand->bandIndex(); + bandToSwap = curBand; + } } } - } - if (curIndex != band->bandIndex() && itemMode() == DesignMode){ - if (page()) - page()->saveCommand(BandMoveFromToCommand::create(page(), band->bandIndex(), bandToSwap->bandIndex()), true); + if (curIndex != band->bandIndex() && itemMode() == DesignMode){ + if (page()) + page()->saveCommand(BandMoveFromToCommand::create(page(), band->bandIndex(), bandToSwap->bandIndex()), true); + } } relocateBands(); } From d4fb85dafd0d014479fbb00b71c63a15d2d5c9f2 Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Sat, 19 Jan 2019 00:04:01 +0300 Subject: [PATCH 08/10] TextItem editor size restoring has been fixed --- common.pri | 2 +- limereport/objectinspector/propertyItems/lrcontentpropitem.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/common.pri b/common.pri index 38ad957..337b2c1 100644 --- a/common.pri +++ b/common.pri @@ -77,7 +77,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MINOR = 4 -LIMEREPORT_VERSION_RELEASE = 118 +LIMEREPORT_VERSION_RELEASE = 119 LIMEREPORT_VERSION = '\\"$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}\\"' DEFINES += LIMEREPORT_VERSION_STR=\"$${LIMEREPORT_VERSION}\" diff --git a/limereport/objectinspector/propertyItems/lrcontentpropitem.cpp b/limereport/objectinspector/propertyItems/lrcontentpropitem.cpp index 1b49128..53c9806 100644 --- a/limereport/objectinspector/propertyItems/lrcontentpropitem.cpp +++ b/limereport/objectinspector/propertyItems/lrcontentpropitem.cpp @@ -30,6 +30,7 @@ void ContentEditor::editButtonClicked() dialog->setWindowTitle(propertyName()); QWidget* editor = dynamic_cast(m_object)->defaultEditor(); dialog->layout()->addWidget(editor); + dialog->resize(editor->size()); connect(editor,SIGNAL(destroyed()),dialog,SLOT(close())); connect(editor,SIGNAL(destroyed()),this,SIGNAL(editingFinished())); dialog->exec(); From 76ae6dfb2409810e6dfd705d2b994c77e8a73e78 Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Mon, 21 Jan 2019 14:17:34 +0300 Subject: [PATCH 09/10] Layout has been fixed --- common.pri | 2 +- limereport/lrbasedesignintf.cpp | 7 ++++--- limereport/lrbasedesignintf.h | 2 +- limereport/lrpageitemdesignintf.cpp | 10 +++++----- limereport/lrpageitemdesignintf.h | 2 +- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/common.pri b/common.pri index 337b2c1..9534741 100644 --- a/common.pri +++ b/common.pri @@ -77,7 +77,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MINOR = 4 -LIMEREPORT_VERSION_RELEASE = 119 +LIMEREPORT_VERSION_RELEASE = 120 LIMEREPORT_VERSION = '\\"$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}\\"' DEFINES += LIMEREPORT_VERSION_STR=\"$${LIMEREPORT_VERSION}\" diff --git a/limereport/lrbasedesignintf.cpp b/limereport/lrbasedesignintf.cpp index 610bd5f..898c9a7 100644 --- a/limereport/lrbasedesignintf.cpp +++ b/limereport/lrbasedesignintf.cpp @@ -1026,6 +1026,7 @@ QVariant BaseDesignIntf::itemChange(QGraphicsItem::GraphicsItemChange change, co if (change == QGraphicsItem::ItemPositionHasChanged) { updateSelectionMarker(); } + if (change == QGraphicsItem::ItemSelectedChange) { turnOnSelectionMarker(value.toBool()); emit itemSelectedHasBeenChanged(this, value.toBool()); @@ -1120,18 +1121,18 @@ void BaseDesignIntf::setItemPos(const QPointF &newPos) QPointF oldPos = pos(); QPointF finalPos = modifyPosForAlignedItem(newPos); QGraphicsItem::setPos(finalPos); - emit posChanged(this, finalPos, oldPos); + emit posChanging(this, finalPos, oldPos); } void BaseDesignIntf::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { - QGraphicsItem::mouseReleaseEvent(event); QRectF newGeometry = geometry(); if (newGeometry != m_oldGeometry) { geometryChangedEvent(newGeometry, m_oldGeometry); updateSelectionMarker(); - emit(geometryChanged(this, newGeometry, m_oldGeometry)); + emit(posChanged(this, newGeometry.topLeft(), m_oldGeometry.topLeft())); } + QGraphicsItem::mouseReleaseEvent(event); } void BaseDesignIntf::showEditorDialog(){ diff --git a/limereport/lrbasedesignintf.h b/limereport/lrbasedesignintf.h index 904b64e..313c0f4 100644 --- a/limereport/lrbasedesignintf.h +++ b/limereport/lrbasedesignintf.h @@ -401,6 +401,7 @@ private: bool m_watermark; signals: void geometryChanged(QObject* object, QRectF newGeometry, QRectF oldGeometry); + void posChanging(QObject* object, QPointF newPos, QPointF oldPos); void posChanged(QObject* object, QPointF newPos, QPointF oldPos); void itemSelected(LimeReport::BaseDesignIntf *item); void itemSelectedHasBeenChanged(BaseDesignIntf *item, bool value); @@ -412,7 +413,6 @@ signals: void propertyesChanged(QVector propertyNames); void itemAlignChanged(BaseDesignIntf* item, const ItemAlign& oldValue, const ItemAlign& newValue); void itemVisibleHasChanged(BaseDesignIntf* item); - void beforeRender(); void afterData(); void afterRender(); diff --git a/limereport/lrpageitemdesignintf.cpp b/limereport/lrpageitemdesignintf.cpp index c3a20e7..b4ba954 100644 --- a/limereport/lrpageitemdesignintf.cpp +++ b/limereport/lrpageitemdesignintf.cpp @@ -303,7 +303,7 @@ void PageItemDesignIntf::registerBand(BandDesignIntf *band) band->setParentItem(this); band->setWidth(pageRect().width()/band->columnsCount()); connect(band, SIGNAL(destroyed(QObject*)),this,SLOT(bandDeleted(QObject*))); - connect(band, SIGNAL(geometryChanged(QObject*,QRectF,QRectF)),this,SLOT(bandGeometryChanged(QObject*,QRectF,QRectF))); + connect(band, SIGNAL(posChanged(QObject*,QPointF,QPointF)),this,SLOT(bandPositionChanged(QObject*,QPointF,QPointF))); } } @@ -664,17 +664,17 @@ void PageItemDesignIntf::moveBandFromTo(int from, int to) } -void PageItemDesignIntf::bandGeometryChanged(QObject* object, QRectF newGeometry, QRectF oldGeometry) +void PageItemDesignIntf::bandPositionChanged(QObject* object, QPointF newPos, QPointF oldPos) { if (itemMode() == DesignMode){ BandDesignIntf* band = dynamic_cast(object); int curIndex = band->bandIndex(); BandDesignIntf* bandToSwap = 0; foreach(BandDesignIntf* curBand, bands()){ - if (newGeometry.y() > oldGeometry.y()) { + if (newPos.y() > oldPos.y()) { if (curBand->bandType() == band->bandType() && curIndex < curBand->bandIndex() - && (curBand->pos().y() + (curBand->height()/2)) < newGeometry.y() + && (curBand->pos().y() + (curBand->height()/2)) < newPos.y() && curBand->parentBand() == band->parentBand()) { curIndex = curBand->bandIndex(); @@ -683,7 +683,7 @@ void PageItemDesignIntf::bandGeometryChanged(QObject* object, QRectF newGeometry } else { if (curBand->bandType() == band->bandType() && curIndex>curBand->bandIndex() - && (curBand->pos().y() + (curBand->height()/2)) > newGeometry.y() + && (curBand->pos().y() + (curBand->height()/2)) > newPos.y() && curBand->parentBand() == band->parentBand()) { curIndex = curBand->bandIndex(); diff --git a/limereport/lrpageitemdesignintf.h b/limereport/lrpageitemdesignintf.h index 2287cf8..315ce08 100644 --- a/limereport/lrpageitemdesignintf.h +++ b/limereport/lrpageitemdesignintf.h @@ -122,7 +122,7 @@ public: protected slots: void bandDeleted(QObject* band); - void bandGeometryChanged(QObject* object, QRectF newGeometry, QRectF oldGeometry); + void bandPositionChanged(QObject* object, QPointF newPos, QPointF oldPos); protected: void collectionLoadFinished(const QString& collectionName); QRectF& pageRect(){return m_pageRect;} From 070508db0bbd73a786e6afe84e2f4fe3978356ea Mon Sep 17 00:00:00 2001 From: Arin Alex Date: Fri, 25 Jan 2019 01:10:37 +0300 Subject: [PATCH 10/10] PageSize enum's values are accorded with QPrinter::PageSize's values. --- common.pri | 2 +- limereport/lrpageitemdesignintf.h | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/common.pri b/common.pri index 9534741..fb015f5 100644 --- a/common.pri +++ b/common.pri @@ -77,7 +77,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MINOR = 4 -LIMEREPORT_VERSION_RELEASE = 120 +LIMEREPORT_VERSION_RELEASE = 121 LIMEREPORT_VERSION = '\\"$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}\\"' DEFINES += LIMEREPORT_VERSION_STR=\"$${LIMEREPORT_VERSION}\" diff --git a/limereport/lrpageitemdesignintf.h b/limereport/lrpageitemdesignintf.h index 315ce08..d7fd6b0 100644 --- a/limereport/lrpageitemdesignintf.h +++ b/limereport/lrpageitemdesignintf.h @@ -34,6 +34,7 @@ #include "lritemscontainerdesignitf.h" #include #include +#include namespace LimeReport{ @@ -55,12 +56,19 @@ class PageItemDesignIntf : public LimeReport::ItemsContainerDesignInft Q_PROPERTY(bool resetPageNumber READ resetPageNumber WRITE setResetPageNumber) friend class ReportRender; public: - enum Orientation { Portrait, Landscape }; - enum PageSize {A4, B5, Letter, Legal, Executive, - A0, A1, A2, A3, A5, A6, A7, A8, A9, B0, B1, - B10, B2, B3, B4, B6, B7, B8, B9, C5E, Comm10E, - DLE, Folio, Ledger, Tabloid, Custom, NPageSize = Custom - }; + enum Orientation { Portrait = QPrinter::Portrait, Landscape = QPrinter::Landscape }; + enum PageSize { + A4 = QPrinter::A4, B5 = QPrinter::B5, Letter = QPrinter::Letter, + Legal = QPrinter::Legal, Executive = QPrinter::Executive, + A0 = QPrinter::A0, A1 = QPrinter::A1, A2 = QPrinter::A2, A3 = QPrinter::A3, + A5 = QPrinter::A5, A6 = QPrinter::A6, A7 = QPrinter::A7, A8 = QPrinter::A8, + A9 = QPrinter::A9, B0 = QPrinter::B0, B1 = QPrinter::B1, B10 = QPrinter::B10, + B2 = QPrinter::B2, B3 = QPrinter::B3, B4 = QPrinter::B4, B6 = QPrinter::B6, + B7 = QPrinter::B7, B8 = QPrinter::B8, B9 = QPrinter::B9, C5E = QPrinter::C5E, + Comm10E = QPrinter::Comm10E, DLE = QPrinter::DLE, Folio = QPrinter::Folio, + Ledger = QPrinter::Ledger, Tabloid = QPrinter::Tabloid, Custom = QPrinter::Custom, + NPageSize = Custom + }; typedef QList BandsList; typedef QList::const_iterator BandsIterator; typedef QSharedPointer Ptr;