QElectroTech  0.8-dev
terminaldata.h
Go to the documentation of this file.
1 #ifndef TERMINALDATA_H
2 #define TERMINALDATA_H
3 
4 #include "propertiesinterface.h"
5 #include "qet.h"
6 
7 #include <QUuid>
8 #include <QPointF>
9 
10 class QGraphicsObject;
11 
20 {
21  public:
22  TerminalData();
23  TerminalData(QGraphicsObject* parent);
24  ~TerminalData();
25 
26  void init();
27 
28  void setParent(QGraphicsObject* parent);
29  void toSettings(QSettings &settings,
30  const QString prefix = QString()) const override;
31  void fromSettings(const QSettings &settings,
32  const QString prefix = QString()) override;
33  QDomElement toXml(QDomDocument &xml_element) const override;
34  bool fromXml(const QDomElement &xml_element) override;
35 
36  // must be public, because this class is a private member
37  // of PartTerminal/Terminal and they must access this data
38  public:
49  QPointF second_point;
64  QUuid m_uuid;
70  QString m_name;
71 
82  QPointF m_pos;
83  private:
84  QGraphicsObject* q{nullptr};
85 };
86 
87 #endif // TERMINALDATA_H
TerminalData::m_orientation
Qet::Orientation m_orientation
m_orientation Orientation of the terminal
Definition: terminaldata.h:43
TerminalData::m_pos
QPointF m_pos
m_pos Position of the terminal. The second point is calculated from this position and the orientation
Definition: terminaldata.h:82
TerminalData::q
QGraphicsObject * q
Definition: terminaldata.h:84
TerminalData::fromSettings
void fromSettings(const QSettings &settings, const QString prefix=QString()) override
TerminalData::fromSettings load properties to setting file.
Definition: terminaldata.cpp:58
TerminalData::m_name
QString m_name
m_name Name of the element. It can be used to create wiring harness tables
Definition: terminaldata.h:70
qet.h
TerminalData::toXml
QDomElement toXml(QDomDocument &xml_element) const override
TerminalData::toXml Save properties to xml element write the name, number, position and orientation o...
Definition: terminaldata.cpp:76
TerminalData::~TerminalData
~TerminalData()
Definition: terminaldata.cpp:21
TerminalData::init
void init()
Definition: terminaldata.cpp:18
propertiesinterface.h
TerminalData
The TerminalData class Data of the terminal. Stored in extra class so it can be used by PartTerminal ...
Definition: terminaldata.h:20
Qet::Orientation
Orientation
Orientation (used for electrical elements and their terminals)
Definition: qet.h:206
TerminalData::second_point
QPointF second_point
second_point Position of the second point of the terminal in scene coordinates
Definition: terminaldata.h:49
Qet::orientationToString
static QString orientationToString(Qet::Orientation)
Definition: qet.cpp:48
TerminalData::TerminalData
TerminalData()
Definition: terminaldata.cpp:5
TerminalData::toSettings
void toSettings(QSettings &settings, const QString prefix=QString()) const override
TerminalData::toSettings Save properties to setting file.
Definition: terminaldata.cpp:43
terminaldata.h
Qet::orientationFromString
static Qet::Orientation orientationFromString(const QString &)
Definition: qet.cpp:36
TerminalData::m_uuid
QUuid m_uuid
m_uuid Uuid of the terminal.
Definition: terminaldata.h:64
PropertiesInterface
The PropertiesInterface class This class is an interface for have common way to use properties in QEl...
Definition: propertiesinterface.h:31
TerminalData::fromXml
bool fromXml(const QDomElement &xml_element) override
TerminalData::fromXml load properties to xml element.
Definition: terminaldata.cpp:106
TerminalData::setParent
void setParent(QGraphicsObject *parent)
TerminalData::setParent.
Definition: terminaldata.cpp:30
QET::attributeIsAReal
bool attributeIsAReal(const QDomElement &, const QString &, qreal *=nullptr)
Definition: qet.cpp:231