Minor : imrpove method

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4753 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2016-10-20 17:48:10 +00:00
parent ea27c6f823
commit 537c0ad95a
2 changed files with 120 additions and 125 deletions

View File

@@ -58,98 +58,93 @@ class DiagramView : public QGraphicsView
bool fresh_focus_in_; ///< Indicate the focus was freshly gained
bool m_first_activation;
// methods
public:
QString title() const;
void editDiagramProperties();
void addColumn();
void removeColumn();
void addRow();
void removeRow();
/// @return the diagram rendered by this view
Diagram *diagram() { return(scene); }
QETDiagramEditor *diagramEditor() const;
bool hasSelectedItems();
bool hasCopiableItems();
bool hasTextItems();
bool hasDeletableItems();
void editSelection();
void setEventInterface (DVEventInterface *event_interface);
QString title() const;
void editDiagramProperties();
void addColumn();
void removeColumn();
void addRow();
void removeRow();
/// @return the diagram rendered by this view
Diagram *diagram() { return(scene); }
QETDiagramEditor *diagramEditor() const;
bool hasSelectedItems();
bool hasCopiableItems();
bool hasTextItems();
bool hasDeletableItems();
void editSelection();
void setEventInterface (DVEventInterface *event_interface);
protected:
virtual void mouseDoubleClickEvent(QMouseEvent *);
virtual void contextMenuEvent(QContextMenuEvent *);
virtual void wheelEvent(QWheelEvent *);
virtual void focusInEvent(QFocusEvent *);
virtual void keyPressEvent(QKeyEvent *);
virtual void keyReleaseEvent(QKeyEvent *);
virtual bool event(QEvent *);
virtual bool switchToVisualisationModeIfNeeded(QInputEvent *e);
virtual bool switchToSelectionModeIfNeeded(QInputEvent *e);
virtual bool isCtrlShifting(QInputEvent *);
virtual bool selectedItemHasFocus();
virtual void mouseDoubleClickEvent(QMouseEvent *);
virtual void contextMenuEvent(QContextMenuEvent *);
virtual void wheelEvent(QWheelEvent *);
virtual void focusInEvent(QFocusEvent *);
virtual void keyPressEvent(QKeyEvent *);
virtual void keyReleaseEvent(QKeyEvent *);
virtual bool event(QEvent *);
virtual bool switchToVisualisationModeIfNeeded(QInputEvent *e);
virtual bool switchToSelectionModeIfNeeded(QInputEvent *e);
virtual bool isCtrlShifting(QInputEvent *);
virtual bool selectedItemHasFocus();
private:
void mousePressEvent(QMouseEvent *);
void mouseMoveEvent(QMouseEvent *);
void mouseReleaseEvent(QMouseEvent *);
void dragEnterEvent(QDragEnterEvent *);
void dragLeaveEvent(QDragLeaveEvent *);
void dragMoveEvent(QDragMoveEvent *);
void dropEvent(QDropEvent *);
void handleElementDrop(QDropEvent *);
void handleTitleBlockDrop(QDropEvent *);
void handleTextDrop(QDropEvent *);
void scrollOnMovement(QKeyEvent *);
bool gestureEvent(QGestureEvent *event);
QRectF viewedSceneRect() const;
bool mustIntegrateTitleBlockTemplate(const TitleBlockTemplateLocation &) const;
bool gestures() const;
void mousePressEvent(QMouseEvent *);
void mouseMoveEvent(QMouseEvent *);
void mouseReleaseEvent(QMouseEvent *);
void dragEnterEvent(QDragEnterEvent *);
void dragLeaveEvent(QDragLeaveEvent *);
void dragMoveEvent(QDragMoveEvent *);
void dropEvent(QDropEvent *);
void handleElementDrop(QDropEvent *);
void handleTitleBlockDrop(QDropEvent *);
void handleTextDrop(QDropEvent *);
void scrollOnMovement(QKeyEvent *);
bool gestureEvent(QGestureEvent *event);
QRectF viewedSceneRect() const;
bool mustIntegrateTitleBlockTemplate(const TitleBlockTemplateLocation &) const;
bool gestures() const;
signals:
/// Signal emitted after the selection changed
void selectionChanged();
/// Signal emitted after the selection mode changed
void modeChanged();
/// Signal emitted after the diagram title changed
void titleChanged(DiagramView *, const QString &);
/// Signal emitted before integrating a title block template
void aboutToSetDroppedTitleBlockTemplate(const TitleBlockTemplateLocation &);
/// Signal emitted when users wish to locate an element from the diagram within elements collection
void findElementRequired(const ElementsLocation &);
/// Signal emitted when users wish to edit an element from the diagram
void editElementRequired(const ElementsLocation &);
/// Signal emmitted when diagram must be show
void showDiagram (Diagram *);
/// Signal emitted after the selection changed
void selectionChanged();
/// Signal emitted after the selection mode changed
void modeChanged();
/// Signal emitted after the diagram title changed
void titleChanged(DiagramView *, const QString &);
/// Signal emitted when users wish to locate an element from the diagram within elements collection
void findElementRequired(const ElementsLocation &);
/// Signal emitted when users wish to edit an element from the diagram
void editElementRequired(const ElementsLocation &);
/// Signal emmitted when diagram must be show
void showDiagram (Diagram *);
public slots:
void selectNothing();
void selectAll();
void selectInvert();
void deleteSelection();
void rotateSelection();
void rotateTexts();
void setVisualisationMode();
void setSelectionMode();
void zoom(const qreal zoom_factor);
void zoomFit();
void zoomContent();
void zoomReset();
void cut();
void copy();
void paste(const QPointF & = QPointF(), QClipboard::Mode = QClipboard::Clipboard);
void pasteHere();
void adjustSceneRect();
void updateWindowTitle();
void editSelectionProperties();
void editSelectedConductorColor();
void editConductorColor(Conductor *);
void resetConductors();
void selectNothing();
void selectAll();
void selectInvert();
void deleteSelection();
void rotateSelection();
void rotateTexts();
void setVisualisationMode();
void setSelectionMode();
void zoom(const qreal zoom_factor);
void zoomFit();
void zoomContent();
void zoomReset();
void cut();
void copy();
void paste(const QPointF & = QPointF(), QClipboard::Mode = QClipboard::Clipboard);
void pasteHere();
void adjustSceneRect();
void updateWindowTitle();
void editSelectionProperties();
void editSelectedConductorColor();
void editConductorColor(Conductor *);
void resetConductors();
private slots:
void setDroppedTitleBlockTemplate(const TitleBlockTemplateLocation &);
void adjustGridToZoom();
void applyReadOnly();
void adjustGridToZoom();
void applyReadOnly();
};
#endif