From 561f64b1b65abf7b0ac0a4b352545645c5d66308 Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Wed, 16 Jan 2019 20:26:17 +0300 Subject: [PATCH] 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{