QElectroTech
0.70
|
#include <elementview.h>
Public Slots | |
void | setVisualisationMode () |
void | setSelectionMode () |
void | zoomIn () |
void | zoomOut () |
void | zoomInSlowly () |
void | zoomOutSlowly () |
void | zoomFit () |
void | zoomReset () |
void | adjustSceneRect () |
ElementView::adjustSceneRect Adjust the scenRect, so that he include all primitives of element plus the viewport of the scene with a margin of 1/3 of herself. More... | |
void | resetSceneRect () |
ElementView::resetSceneRect reset le sceneRect (zone du schéma visualisée par l'ElementView) afin que celui-ci inclut uniquement les primitives de l'élément dessiné. More... | |
void | cut () |
void | copy () |
void | paste () |
void | pasteInArea () |
Signals | |
void | modeChanged () |
Signal emitted after the mode changed. More... | |
Public Member Functions | |
ElementView (ElementScene *, QWidget *=nullptr) | |
~ElementView () override | |
Destructeur. More... | |
ElementScene * | scene () const |
void | setScene (ElementScene *) |
QRectF | viewedSceneRect () const |
Protected Member Functions | |
void | mousePressEvent (QMouseEvent *) override |
void | mouseMoveEvent (QMouseEvent *) override |
ElementView::mouseMoveEvent Manage the event move mouse. More... | |
void | mouseReleaseEvent (QMouseEvent *) override |
ElementView::mouseReleaseEvent Manage event release click mouse. More... | |
bool | gestureEvent (QGestureEvent *event) |
ElementView::gestureEvent. More... | |
bool | event (QEvent *event) override |
void | wheelEvent (QWheelEvent *) override |
ElementView::wheelEvent. More... | |
void | drawBackground (QPainter *, const QRectF &) override |
Private Slots | |
void | getPasteArea (const QRectF &) |
ElementContent | pasteAreaDefined (const QRectF &) |
ElementContent | paste (const QPointF &) |
ElementContent | paste (const QDomDocument &, const QPointF &) |
ElementContent | pasteWithOffset (const QDomDocument &) |
Private Member Functions | |
ElementView (const ElementView &) | |
QRectF | applyMovement (const QRectF &, const QPointF &) |
bool | gestures () const |
ElementView::gestures. More... | |
Private Attributes | |
ElementScene * | m_scene |
QString | to_paste_in_area_ |
int | offset_paste_count_ |
QPointF | start_top_left_corner_ |
QPointF | reference_view_ |
Friends | |
class | PastePartsCommand |
This class provides a widget to render an ElementScene instance, i.e. the edition class for electrical elements.
Definition at line 27 of file elementview.h.
ElementView::ElementView | ( | ElementScene * | scene, |
QWidget * | parent = nullptr |
||
) |
Constructeur
scene | ElementScene visualisee par cette ElementView |
parent | QWidget parent de cette ElementView |
Definition at line 27 of file elementview.cpp.
References m_scene, pasteAreaDefined(), zoomFit(), and zoomReset().
|
override |
Destructeur.
Definition at line 44 of file elementview.cpp.
|
private |
|
slot |
ElementView::adjustSceneRect Adjust the scenRect, so that he include all primitives of element plus the viewport of the scene with a margin of 1/3 of herself.
Definition at line 151 of file elementview.cpp.
References m_scene.
Referenced by mouseReleaseEvent(), zoomIn(), and zoomOut().
|
private |
Applique le decalage offset dans le sens movement au rectangle start
start | rectangle a decaler |
movement | Orientation du decalage a appliquer |
offset | Decalage a appliquer |
Definition at line 547 of file elementview.cpp.
Referenced by pasteWithOffset().
|
slot |
Gere le fait de copier la selection = l'exporter en XML dans le presse-papier.
Definition at line 181 of file elementview.cpp.
References m_scene, and offset_paste_count_.
|
slot |
Gere le fait de couper la selection = l'exporter en XML dans le presse-papier puis la supprimer.
Definition at line 171 of file elementview.cpp.
References m_scene, and offset_paste_count_.
|
overrideprotected |
Dessine l'arriere-plan de l'editeur, cad la grille.
p | Le QPainter a utiliser pour dessiner |
r | Le rectangle de la zone a dessiner |
Definition at line 468 of file elementview.cpp.
References m_scene, and ElementScene::setGrid().
|
overrideprotected |
Gere les evenements de la ElementView
e | Evenement |
Definition at line 430 of file elementview.cpp.
References gestureEvent().
Referenced by gestureEvent().
|
protected |
Utilise le pincement du trackpad pour zoomer
event |
Definition at line 447 of file elementview.cpp.
References event(), zoomInSlowly(), and zoomOutSlowly().
Referenced by event().
|
private |
|
privateslot |
to_paste | Rectangle englobant les parties a coller |
Definition at line 257 of file elementview.cpp.
References m_scene.
Referenced by paste(), and pasteInArea().
|
signal |
Signal emitted after the mode changed.
Referenced by setSelectionMode(), and setVisualisationMode().
|
overrideprotected |
ElementView::mouseMoveEvent Manage the event move mouse.
Definition at line 372 of file elementview.cpp.
References reference_view_.
|
overrideprotected |
Gere les clics sur la vue - permet de coller lorsaue l'on enfonce le bouton du milieu de la souris.
e | QMouseEvent decrivant l'evenement souris |
Definition at line 358 of file elementview.cpp.
References reference_view_.
|
overrideprotected |
ElementView::mouseReleaseEvent Manage event release click mouse.
Definition at line 390 of file elementview.cpp.
References adjustSceneRect().
|
slot |
Gere le fait de coller le contenu du presse-papier = l'importer dans l'element. Cette methode examine le contenu du presse-papier. Si celui-ci semble avoir ete copie depuis cet element, il est colle a cote de sa zone d'origine ; s'il est recolle, il sera colle un cran a cote de la zone deja recollee, etc. Sinon, cette methode demande a l'utilisateur de definir la zone ou le collage devra s'effectuer.
Definition at line 197 of file elementview.cpp.
References getPasteArea(), m_scene, pasteWithOffset(), and to_paste_in_area_.
Referenced by paste(), and pasteAreaDefined().
|
privateslot |
Gere le fait de coller le contenu du presse-papier = l'importer dans l'element. Cette methode examine le contenu du presse-papier. Si celui-ci est exploitable, elle le colle a la position passee en parametre.
position | Point de collage |
Definition at line 243 of file elementview.cpp.
References paste().
|
privateslot |
Colle le document XML xml_document a la position pos
xml_document | Document XML a coller |
pos | Coin superieur gauche du rectangle cible |
Definition at line 291 of file elementview.cpp.
References m_scene, and PastePartsCommand.
|
privateslot |
Slot appele lorsque la scene annonce avoir defini une zone de collage
target_rect | Rectangle cible pour le collage |
Definition at line 274 of file elementview.cpp.
References paste(), and to_paste_in_area_.
Referenced by ElementView().
|
slot |
Colle le contenu du presse-papier en demandant systematiquement a l'utilisateur de choisir une zone de collage
Definition at line 221 of file elementview.cpp.
References getPasteArea(), m_scene, and to_paste_in_area_.
|
privateslot |
Colle le document XML xml_document a la position pos
xml_document | Document XML a coller |
Definition at line 309 of file elementview.cpp.
References applyMovement(), m_scene, offset_paste_count_, QETElementEditor::pasteOffset(), PastePartsCommand, and start_top_left_corner_.
Referenced by paste().
|
slot |
ElementView::resetSceneRect reset le sceneRect (zone du schéma visualisée par l'ElementView) afin que celui-ci inclut uniquement les primitives de l'élément dessiné.
Definition at line 163 of file elementview.cpp.
References m_scene.
Referenced by zoomFit(), and zoomReset().
ElementScene * ElementView::scene | ( | ) | const |
Definition at line 48 of file elementview.cpp.
References m_scene.
void ElementView::setScene | ( | ElementScene * | s | ) |
Definit l'ElementScene visualisee par cette ElementView
s | l'ElementScene visualisee par cette ElementView |
Definition at line 74 of file elementview.cpp.
References m_scene.
|
slot |
Set the Diagram in Selection mode
Definition at line 91 of file elementview.cpp.
References modeChanged().
|
slot |
Set the Diagram in visualisation mode
Definition at line 82 of file elementview.cpp.
References modeChanged().
QRectF ElementView::viewedSceneRect | ( | ) | const |
Definition at line 55 of file elementview.cpp.
|
overrideprotected |
e |
Definition at line 414 of file elementview.cpp.
References gestures(), zoomIn(), zoomInSlowly(), zoomOut(), and zoomOutSlowly().
|
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
Definition at line 132 of file elementview.cpp.
References resetSceneRect().
Referenced by ElementView().
|
slot |
Agrandit le schema (+33% = inverse des -25 % de zoomMoins())
Definition at line 100 of file elementview.cpp.
References adjustSceneRect().
Referenced by wheelEvent().
|
slot |
Agrandit le schema avec le trackpad
Definition at line 116 of file elementview.cpp.
Referenced by gestureEvent(), and wheelEvent().
|
slot |
Retrecit le schema (-25% = inverse des +33 % de zoomPlus())
Definition at line 108 of file elementview.cpp.
References adjustSceneRect().
Referenced by wheelEvent().
|
slot |
Retrecit le schema avec le trackpad
Definition at line 123 of file elementview.cpp.
Referenced by gestureEvent(), and wheelEvent().
|
slot |
Reinitialise le zoom
Definition at line 140 of file elementview.cpp.
References resetSceneRect().
Referenced by ElementView().
|
friend |
Definition at line 29 of file elementview.h.
Referenced by paste(), and pasteWithOffset().
|
private |
Definition at line 86 of file elementview.h.
Referenced by adjustSceneRect(), copy(), cut(), drawBackground(), ElementView(), getPasteArea(), paste(), pasteInArea(), pasteWithOffset(), resetSceneRect(), scene(), and setScene().
|
private |
Definition at line 88 of file elementview.h.
Referenced by copy(), cut(), and pasteWithOffset().
|
private |
Definition at line 90 of file elementview.h.
Referenced by mouseMoveEvent(), and mousePressEvent().
|
private |
Definition at line 89 of file elementview.h.
Referenced by pasteWithOffset().
|
private |
Definition at line 87 of file elementview.h.
Referenced by paste(), pasteAreaDefined(), and pasteInArea().