QElectroTech 0.100.0-dev
|
#include <diagramview.h>
Inherits QGraphicsView.
Public Slots | |
void | setVisualisationMode () |
void | setSelectionMode () |
void | zoom (const qreal zoom_factor) |
DiagramView::zoom Zomm the view. A zoom_factor > 1 zoom in. A zoom_factor < 1 zoom out. | |
void | zoomFit () |
void | zoomContent () |
void | zoomReset () |
void | cut () |
void | copy () |
void | paste (const QPointF &=QPointF(), QClipboard::Mode=QClipboard::Clipboard) |
DiagramView::paste Import the element stored in the clipboard to the diagram. | |
void | pasteHere () |
void | adjustSceneRect () |
DiagramView::adjustSceneRect Calcul and set the area of the scene visualized by this view. | |
void | updateWindowTitle () |
void | resetConductors () |
Signals | |
void | modeChanged () |
Signal emitted after the selection mode changed. | |
void | titleChanged (DiagramView *, const QString &) |
Signal emitted after the diagram title changed. | |
void | findElementRequired (const ElementsLocation &) |
Signal emitted when users wish to locate an element from the diagram within elements collection. | |
void | showDiagram (Diagram *) |
Signal emitted when diagram must be show. | |
void | freeRubberBandChanged (QPolygonF polygon) |
Public Member Functions | |
DiagramView (Diagram *diagram, QWidget *=nullptr) | |
~DiagramView () override | |
QString | title () const |
void | editDiagramProperties () |
DiagramView::editDiagramProperties Edit the properties of the viewed digram. | |
Diagram * | diagram () |
QETDiagramEditor * | diagramEditor () const |
void | editSelection () |
DiagramView::editSelection Edit the selected item if he can be edited and if only one item is selected. | |
void | setEventInterface (DVEventInterface *event_interface) |
DiagramView::setEventInterface Set an event interface to diagram view. If diagram view already have an event interface, he delete it before. Diagram view take ownership of event interface and delete it when event interface is finish. | |
QList< QAction * > | contextMenuActions () const |
DiagramView::contextMenuActions. | |
Protected Member Functions | |
void | mouseDoubleClickEvent (QMouseEvent *) override |
DiagramView::mouseDoubleClickEvent. | |
void | contextMenuEvent (QContextMenuEvent *) override |
DiagramView::contextMenuEvent. | |
void | wheelEvent (QWheelEvent *) override |
DiagramView::wheelEvent Manage wheel event of mouse. | |
void | focusInEvent (QFocusEvent *) override |
void | keyPressEvent (QKeyEvent *) override |
DiagramView::keyPressEvent Handles "key press" events. Reimplemented here to switch to visualisation mode if needed. | |
void | keyReleaseEvent (QKeyEvent *) override |
bool | event (QEvent *) override |
DiagramView::event Manage the event on this diagram view. -At first activation (QEvent::WindowActivate or QEvent::Show) we zoomFit. -Convert event interpreted to mouse event to gesture event if needed. -send Shortcut to view (by default send to QMenu /QAction) Gere les evenements de la DiagramView. | |
void | paintEvent (QPaintEvent *event) override |
DiagramView::paintEvent Reimplemented from QGraphicsView. | |
void | mousePressEvent (QMouseEvent *) override |
void | mouseMoveEvent (QMouseEvent *) override |
DiagramView::mouseMoveEvent Manage the event move mouse. | |
void | mouseReleaseEvent (QMouseEvent *) override |
DiagramView::mouseReleaseEvent Manage event release click mouse. | |
void | dragEnterEvent (QDragEnterEvent *) override |
void | dragMoveEvent (QDragMoveEvent *) override |
void | dropEvent (QDropEvent *) override |
virtual bool | switchToVisualisationModeIfNeeded (QInputEvent *e) |
virtual bool | switchToSelectionModeIfNeeded (QInputEvent *e) |
virtual bool | isCtrlShifting (QInputEvent *) |
virtual bool | selectedItemHasFocus () |
Private Slots | |
void | adjustGridToZoom () |
void | applyReadOnly () |
Private Member Functions | |
DiagramView (const DiagramView &) | |
void | handleElementDrop (QDropEvent *) |
DiagramView::handleElementDrop Handle the drop of an element. | |
void | handleTitleBlockDrop (QDropEvent *) |
DiagramView::handleTitleBlockDrop Handle the dropEvent that contain data of a titleblock. | |
void | handleTextDrop (QDropEvent *) |
void | scrollOnMovement (QKeyEvent *) |
bool | gestureEvent (QGestureEvent *event) |
DiagramView::gestureEvent Use the pinch of the trackpad for zoom. | |
QRectF | viewedSceneRect () const |
bool | mustIntegrateTitleBlockTemplate (const TitleBlockTemplateLocation &) const |
bool | gestures () const |
DiagramView::gestures. | |
Private Attributes | |
Diagram * | m_diagram = nullptr |
DVEventInterface * | m_event_interface = nullptr |
QAction * | m_paste_here = nullptr |
QAction * | m_multi_paste = nullptr |
QPoint | m_paste_here_pos |
QPointF | m_drag_last_pos |
bool | m_fresh_focus_in |
bool | m_first_activation = true |
QList< QAction * > | m_separators |
QPolygonF | m_free_rubberband |
bool | m_free_rubberbanding = false |
This class provides a widget to render an electric diagram in an editable, interactive way.
DiagramView::DiagramView | ( | Diagram * | diagram, |
QWidget * | parent = nullptr |
||
) |
Constructeur
diagram | Schema a afficher ; si diagram vaut 0, un nouveau Diagram est utilise |
parent | Le QWidget parent de cette vue de schema |
|
override |
Destructeur
|
private |
|
privateslot |
Enables or disables the drawing grid according to the amount of pixels display
|
slot |
DiagramView::adjustSceneRect Calcul and set the area of the scene visualized by this view.
|
privateslot |
Fait en sorte que le schema ne soit editable que s'il n'est pas en lecture seule
QList< QAction * > DiagramView::contextMenuActions | ( | ) | const |
DiagramView::contextMenuActions.
|
overrideprotected |
|
slot |
Copie les elements selectionnes du schema dans le presse-papier
|
slot |
Copie les elements selectionnes du schema dans le presse-papier puis les supprime
|
inline |
QETDiagramEditor * DiagramView::diagramEditor | ( | ) | const |
|
overrideprotected |
Accepte ou refuse le drag'n drop en fonction du type de donnees entrant
e | le QDragEnterEvent correspondant au drag'n drop tente |
|
overrideprotected |
Accepte ou refuse le drag'n drop en fonction du type de donnees entrant
e | le QDragMoveEvent correspondant au drag'n drop tente |
|
overrideprotected |
Handle the drops accepted on diagram (elements and title block templates).
e | the QDropEvent describing the current drag'n drop |
void DiagramView::editDiagramProperties | ( | ) |
DiagramView::editDiagramProperties Edit the properties of the viewed digram.
void DiagramView::editSelection | ( | ) |
DiagramView::editSelection Edit the selected item if he can be edited and if only one item is selected.
|
overrideprotected |
DiagramView::event Manage the event on this diagram view. -At first activation (QEvent::WindowActivate or QEvent::Show) we zoomFit. -Convert event interpreted to mouse event to gesture event if needed. -send Shortcut to view (by default send to QMenu /QAction) Gere les evenements de la DiagramView.
e | : the event. |
|
signal |
Signal emitted when users wish to locate an element from the diagram within elements collection.
|
overrideprotected |
Handles "Focus in" events. Reimplemented here to store the fact the focus was freshly acquired again using the mouse. This information is later used in DiagramView::mousePressEvent().
|
signal |
Signal emitted when free rubberband changed. When free rubberband selection ends this signal will be emitted with null value.
|
private |
DiagramView::gestureEvent Use the pinch of the trackpad for zoom.
event |
|
private |
|
private |
DiagramView::handleElementDrop Handle the drop of an element.
event | the QDropEvent describing the current drag'n drop |
|
private |
@brief DiagramView::handleTextDrop
handle the drop of text
e | the QDropEvent describing the current drag'n drop |
|
private |
DiagramView::handleTitleBlockDrop Handle the dropEvent that contain data of a titleblock.
e |
|
protectedvirtual |
|
overrideprotected |
DiagramView::keyPressEvent Handles "key press" events. Reimplemented here to switch to visualisation mode if needed.
e |
|
overrideprotected |
Handles "key release" events. Reimplemented here to switch to selection mode if needed.
|
signal |
Signal emitted after the selection mode changed.
|
overrideprotected |
DiagramView::mouseDoubleClickEvent.
e |
|
overrideprotected |
|
overrideprotected |
Manage the events press click : click to add an independent text field
|
overrideprotected |
DiagramView::mouseReleaseEvent Manage event release click mouse.
|
private |
tbt_loc | A title block template location |
|
overrideprotected |
DiagramView::paintEvent Reimplemented from QGraphicsView.
event |
|
slot |
DiagramView::paste Import the element stored in the clipboard to the diagram.
pos | : top left corner of the bounding rect of imported elements |
clipboard_mode |
|
slot |
Colle le contenu du presse-papier sur le schema a la position de la souris
|
slot |
Reinitialise le profil des conducteurs selectionnes
|
private |
Handles element movement when editor is zoomed in and scrolls vertical and horizontal bar. If element is moved to the right side of the editor or below the editor SceneRect is expanded
|
protectedvirtual |
void DiagramView::setEventInterface | ( | DVEventInterface * | event_interface | ) |
DiagramView::setEventInterface Set an event interface to diagram view. If diagram view already have an event interface, he delete it before. Diagram view take ownership of event interface and delete it when event interface is finish.
|
slot |
Set the Diagram in Selection mode
|
slot |
Set the Diagram in visualisation mode
|
signal |
Signal emitted when diagram must be show.
|
protectedvirtual |
Switch back to selection mode if the user is not pressing Ctrl and Shift.
|
protectedvirtual |
Switch to visualisation mode if the user is pressing Ctrl and Shift.
QString DiagramView::title | ( | ) | const |
|
signal |
Signal emitted after the diagram title changed.
|
slot |
Met a jour le titre du widget
|
private |
|
overrideprotected |
DiagramView::wheelEvent Manage wheel event of mouse.
event | QWheelEvent |
|
slot |
DiagramView::zoom Zomm the view. A zoom_factor > 1 zoom in. A zoom_factor < 1 zoom out.
zoom_factor |
|
slot |
Adjust zoom to fit all elements in the view, regardless of diagram borders.
|
slot |
Agrandit ou rectrecit le schema de facon a ce que tous les elements du schema soient visibles a l'ecran. S'il n'y a aucun element sur le schema, le zoom est reinitialise
|
slot |
Reinitialise le zoom
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |