mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-24 03:10:52 +01:00
TEST a Merge branch 'XMLProperties'
it gets built let's test it for bugs Conflicts: sources/ElementsCollection/fileelementcollectionitem.cpp sources/QetGraphicsItemModeler/qetgraphicshandleritem.h sources/borderproperties.cpp sources/conductorproperties.cpp sources/conductorproperties.h sources/diagram.cpp sources/diagram.h sources/diagramprintdialog.cpp sources/diagramprintdialog.h sources/editor/graphicspart/customelementgraphicpart.cpp sources/editor/graphicspart/partarc.cpp sources/editor/graphicspart/partdynamictextfield.cpp sources/editor/graphicspart/partdynamictextfield.h sources/editor/graphicspart/partellipse.cpp sources/editor/graphicspart/partline.cpp sources/editor/graphicspart/partpolygon.cpp sources/editor/graphicspart/partrectangle.cpp sources/editor/graphicspart/partterminal.cpp sources/editor/graphicspart/partterminal.h sources/editor/graphicspart/parttext.cpp sources/properties/propertiesinterface.cpp sources/properties/propertiesinterface.h sources/properties/terminaldata.cpp sources/properties/terminaldata.h sources/properties/xrefproperties.cpp sources/properties/xrefproperties.h sources/qetgraphicsitem/conductor.cpp sources/qetgraphicsitem/conductor.h sources/qetgraphicsitem/conductortextitem.h sources/qetgraphicsitem/dynamicelementtextitem.h sources/qetgraphicsitem/element.cpp sources/qetgraphicsitem/element.h sources/qetgraphicsitem/elementtextitemgroup.h sources/qetgraphicsitem/slaveelement.cpp sources/qetgraphicsitem/slaveelement.h sources/qetgraphicsitem/terminal.cpp sources/qetgraphicsitem/terminal.h sources/qetproject.cpp sources/titleblockproperties.cpp
This commit is contained in:
@@ -26,62 +26,58 @@ class TerminalData : public PropertiesInterface
|
||||
void init();
|
||||
|
||||
void setParent(QGraphicsObject* parent);
|
||||
void toSettings(QSettings &settings,
|
||||
const QString prefix = QString()) const override;
|
||||
void fromSettings(const QSettings &settings,
|
||||
const QString prefix = QString()) override;
|
||||
QDomElement toXml(QDomDocument &xml_element) const override;
|
||||
bool fromXml(const QDomElement &xml_element) override;
|
||||
|
||||
// must be public, because this class is a private member
|
||||
// of PartTerminal/Terminal and they must access this data
|
||||
public:
|
||||
/**
|
||||
@brief m_orientation
|
||||
Orientation of the terminal
|
||||
*/
|
||||
Qet::Orientation m_orientation;
|
||||
/**
|
||||
@brief second_point
|
||||
Position of the second point of the terminal
|
||||
in scene coordinates
|
||||
*/
|
||||
QPointF second_point;
|
||||
/**
|
||||
@brief m_uuid
|
||||
Uuid of the terminal.
|
||||
// Save/load properties to setting file. QString is use for prefix a word befor the name of each paramètre
|
||||
void toSettings(
|
||||
QSettings &settings, const QString& = QString()) const override;
|
||||
void fromSettings(
|
||||
const QSettings &settings, const QString& = QString()) override;
|
||||
// Save/load properties to xml element
|
||||
// This method is only called from the PartTerminal and should never called from the Terminal class
|
||||
QDomElement toXml(QDomDocument &xml_element) const override;
|
||||
bool fromXml(const QDomElement &xml_element) override;
|
||||
|
||||
In elementscene.cpp an element gets a new uuid when
|
||||
saving the element. In the current state
|
||||
each connection is made by using the local position
|
||||
of the terminal and a dynamic id. In the new
|
||||
case, each terminal should have it's own uuid to
|
||||
identify it uniquely. When changing each time this
|
||||
uuid, the conductor after updating the part is anymore
|
||||
valid. So if in the loaded document a uuid exists,
|
||||
use this one and don't create a new one.
|
||||
*/
|
||||
QUuid m_uuid;
|
||||
/**
|
||||
@brief m_name
|
||||
Name of the element.
|
||||
It can be used to create wiring harness tables
|
||||
*/
|
||||
QString m_name;
|
||||
static bool valideXml(const QDomElement &xml_element);
|
||||
|
||||
/**
|
||||
@brief m_pos
|
||||
Position of the terminal. The second point is calculated
|
||||
from this position and the orientation
|
||||
@note
|
||||
Important: this variable is only updated during read
|
||||
from xml and not during mouse move!
|
||||
It is used to store the initial position so that
|
||||
PartTerminal and Terminal have access to it.
|
||||
*/
|
||||
QPointF m_pos;
|
||||
private:
|
||||
QGraphicsObject* q{nullptr};
|
||||
// must be public, because this class is a private member of PartTerminal/Terminal and they must
|
||||
// access this data
|
||||
public:
|
||||
/*!
|
||||
* \brief m_orientation
|
||||
* Orientation of the terminal
|
||||
*/
|
||||
Qet::Orientation m_orientation{Qet::Orientation::North};
|
||||
/*!
|
||||
* \brief second_point
|
||||
* Position of the second point of the terminal in scene coordinates
|
||||
*/
|
||||
QPointF second_point{0,0};
|
||||
/*!
|
||||
* \brief m_uuid
|
||||
* Uuid of the terminal.
|
||||
*
|
||||
* In elementscene.cpp an element gets a new uuid when saving the element. In the current state
|
||||
* each connection is made by using the local position of the terminal and a dynamic id. In the new
|
||||
* case, each terminal should have it's own uuid to identify it uniquely. When changing each time this
|
||||
* uuid, the conductor after updating the part is anymore valid. So if in the loaded document a uuid exists,
|
||||
* use this one and don't create a new one.
|
||||
*/
|
||||
QUuid m_uuid; // default is an invalid uuid.
|
||||
/*!
|
||||
* \brief m_name
|
||||
* Name of the element. It can be used to create wiring harness tables
|
||||
*/
|
||||
QString m_name;
|
||||
|
||||
/*!
|
||||
* \brief m_pos
|
||||
* Position of the terminal. The second point is calculated from this position and the orientation
|
||||
* Important: this variable is only updated during read from xml and not during mouse move!
|
||||
* It is used to store the initial position so that PartTerminal and Terminal have access to it.
|
||||
*/
|
||||
QPointF m_pos{0,0};
|
||||
private:
|
||||
QGraphicsObject* q{nullptr};
|
||||
};
|
||||
|
||||
#endif // TERMINALDATA_H
|
||||
|
||||
Reference in New Issue
Block a user