QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
diagrameventaddmacro.h
Go to the documentation of this file.
1/*
2 C opyright 2006-2026 The QEle*ctroTech Team
3 This file is part of QElectroTech.
4 */
5#ifndef DIAGRAMEVENTADDMACRO_H
6#define DIAGRAMEVENTADDMACRO_H
7
10
11#include <QDomDocument>
12#include <QGraphicsPixmapItem>
13
14class QStatusBar;
15
20{
21 Q_OBJECT
22
23public:
24 DiagramEventAddMacro(const ElementsLocation &location, Diagram *diagram, QPointF pos = QPointF(0,0));
25 ~DiagramEventAddMacro() override;
26
27 void mouseMoveEvent (QGraphicsSceneMouseEvent *event) override;
28 void mousePressEvent (QGraphicsSceneMouseEvent *event) override;
29 void mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override;
30 void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event) override;
31 void keyPressEvent (QKeyEvent *event) override;
32 void init() override;
33
34private:
35 bool loadMacro();
36 void addMacro(QPointF final_pos);
37
38private:
40 QDomDocument m_macro_doc;
41 QGraphicsPixmapItem *m_preview_item;
42 QPointer<QStatusBar> m_status_bar;
43};
44
45#endif // DIAGRAMEVENTADDMACRO_H
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override
Definition diagrameventaddmacro.cpp:131
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override
Definition diagrameventaddmacro.cpp:114
DiagramEventAddMacro(const ElementsLocation &location, Diagram *diagram, QPointF pos=QPointF(0, 0))
Definition diagrameventaddmacro.cpp:21
QGraphicsPixmapItem * m_preview_item
Definition diagrameventaddmacro.h:41
QPointer< QStatusBar > m_status_bar
Definition diagrameventaddmacro.h:42
bool loadMacro()
Definition diagrameventaddmacro.cpp:171
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override
Definition diagrameventaddmacro.cpp:148
void mousePressEvent(QGraphicsSceneMouseEvent *event) override
Definition diagrameventaddmacro.cpp:127
void keyPressEvent(QKeyEvent *event) override
DiagramEventInterface::keyPressEvent By default, press escape key abort the current action.
Definition diagrameventaddmacro.cpp:160
ElementsLocation m_location
Definition diagrameventaddmacro.h:39
QDomDocument m_macro_doc
Definition diagrameventaddmacro.h:40
void addMacro(QPointF final_pos)
Definition diagrameventaddmacro.cpp:232
void init() override
Definition diagrameventaddmacro.cpp:165
~DiagramEventAddMacro() override
Definition diagrameventaddmacro.cpp:99
DiagramEventInterface(Diagram *diagram)
Definition diagrameventinterface.cpp:25
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition diagram.h:54
The ElementsLocation class This class represents the location, the location of an element or of a cat...
Definition elementslocation.h:47