mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-19 14:50:53 +01:00
fix compile issues
This commit is contained in:
@@ -167,7 +167,7 @@ void BorderProperties::toSettings(QSettings &settings, const QString &prefix) co
|
|||||||
\~ @param prefix : prefix to be added before the names of the parameters
|
\~ @param prefix : prefix to be added before the names of the parameters
|
||||||
\~French prefixe a ajouter devant les noms des parametres
|
\~French prefixe a ajouter devant les noms des parametres
|
||||||
*/
|
*/
|
||||||
void BorderProperties::fromSettings(const QSettings &settings, const QString &prefix) {
|
void BorderProperties::fromSettings(QSettings &settings, const QString &prefix) {
|
||||||
columns_count = settings.value(prefix + "cols", columns_count).toInt();
|
columns_count = settings.value(prefix + "cols", columns_count).toInt();
|
||||||
columns_width = qRound(settings.value(prefix + "colsize", columns_width).toDouble());
|
columns_width = qRound(settings.value(prefix + "colsize", columns_width).toDouble());
|
||||||
display_columns = settings.value(prefix + "displaycols", display_columns).toBool();
|
display_columns = settings.value(prefix + "displaycols", display_columns).toBool();
|
||||||
|
|||||||
@@ -40,8 +40,8 @@ class BorderProperties : public PropertiesInterface {
|
|||||||
QDomElement toXml(QDomDocument &dom_doc) const override;
|
QDomElement toXml(QDomDocument &dom_doc) const override;
|
||||||
bool fromXml(const QDomElement &) override;
|
bool fromXml(const QDomElement &) override;
|
||||||
static bool valideXml(QDomElement& e);
|
static bool valideXml(QDomElement& e);
|
||||||
void toSettings(QSettings &, const QString & = QString()) const;
|
void toSettings(QSettings &, const QString & = QString()) const override;
|
||||||
void fromSettings(QSettings &, const QString & = QString());
|
void fromSettings(QSettings &, const QString & = QString()) override;
|
||||||
|
|
||||||
static BorderProperties defaultProperties();
|
static BorderProperties defaultProperties();
|
||||||
|
|
||||||
|
|||||||
@@ -391,16 +391,6 @@ bool ConductorProperties::fromXml(const QDomElement &e)
|
|||||||
propertyDouble(e, "horizrotatetext", &horiz_rotate_text);
|
propertyDouble(e, "horizrotatetext", &horiz_rotate_text);
|
||||||
|
|
||||||
QMetaEnum me = QMetaEnum::fromType<Qt::Alignment>();
|
QMetaEnum me = QMetaEnum::fromType<Qt::Alignment>();
|
||||||
e.attribute(
|
|
||||||
"horizontal-alignment",
|
|
||||||
"AlignBottom"
|
|
||||||
).toStdString().data()));
|
|
||||||
m_vertical_alignment = Qt::Alignment(
|
|
||||||
me.keyToValue(
|
|
||||||
e.attribute(
|
|
||||||
"vertical-alignment",
|
|
||||||
"AlignRight"
|
|
||||||
).toStdString().data()));
|
|
||||||
|
|
||||||
QString alinment_temp;
|
QString alinment_temp;
|
||||||
if (propertyString(e, "horizontal-alignment", &alinment_temp) == PropertyFlags::Success)
|
if (propertyString(e, "horizontal-alignment", &alinment_temp) == PropertyFlags::Success)
|
||||||
@@ -475,7 +465,7 @@ void ConductorProperties::toSettings(QSettings &settings, const QString &prefix)
|
|||||||
@param settings Parametres a lire
|
@param settings Parametres a lire
|
||||||
@param prefix prefixe a ajouter devant les noms des parametres
|
@param prefix prefixe a ajouter devant les noms des parametres
|
||||||
*/
|
*/
|
||||||
void ConductorProperties::fromSettings(const QSettings &settings, const QString &prefix)
|
void ConductorProperties::fromSettings(QSettings &settings, const QString &prefix)
|
||||||
{
|
{
|
||||||
QColor settings_color = QColor(settings.value(prefix + "color").toString());
|
QColor settings_color = QColor(settings.value(prefix + "color").toString());
|
||||||
color = (settings_color.isValid()? settings_color : QColor(Qt::black));
|
color = (settings_color.isValid()? settings_color : QColor(Qt::black));
|
||||||
|
|||||||
@@ -100,12 +100,11 @@ class ConductorProperties: public PropertiesInterface
|
|||||||
m_bus,
|
m_bus,
|
||||||
m_cable;
|
m_cable;
|
||||||
|
|
||||||
int text_size{9},
|
int text_size{9},
|
||||||
text_size,
|
|
||||||
m_dash_size = 1;
|
m_dash_size = 1;
|
||||||
|
|
||||||
double cond_size{1},
|
double
|
||||||
cond_size,
|
cond_size{1},
|
||||||
verti_rotate_text,
|
verti_rotate_text,
|
||||||
horiz_rotate_text;
|
horiz_rotate_text;
|
||||||
|
|
||||||
@@ -114,8 +113,7 @@ class ConductorProperties: public PropertiesInterface
|
|||||||
m_bicolor = false;
|
m_bicolor = false;
|
||||||
|
|
||||||
Qt::Alignment
|
Qt::Alignment
|
||||||
m_horizontal_alignment = Qt::AlignBottom,
|
m_horizontal_alignment = Qt::AlignBottom,
|
||||||
m_horizontal_alignment = Qt::AlignBottom,
|
|
||||||
m_vertical_alignment = Qt::AlignRight;
|
m_vertical_alignment = Qt::AlignRight;
|
||||||
|
|
||||||
Qt::PenStyle style{Qt::PenStyle::SolidLine};
|
Qt::PenStyle style{Qt::PenStyle::SolidLine};
|
||||||
@@ -126,8 +124,8 @@ class ConductorProperties: public PropertiesInterface
|
|||||||
QDomElement toXml(QDomDocument &doc) const override;
|
QDomElement toXml(QDomDocument &doc) const override;
|
||||||
bool fromXml(const QDomElement &) override;
|
bool fromXml(const QDomElement &) override;
|
||||||
static bool valideXml(QDomElement& element);
|
static bool valideXml(QDomElement& element);
|
||||||
void toSettings(QSettings &, const QString & = QString()) const;
|
void toSettings(QSettings &, const QString & = QString()) const override;
|
||||||
void fromSettings(QSettings &, const QString & = QString());
|
void fromSettings(QSettings &, const QString & = QString()) override;
|
||||||
static QString typeToString(ConductorType);
|
static QString typeToString(ConductorType);
|
||||||
void applyForEqualAttributes(QList<ConductorProperties> list);
|
void applyForEqualAttributes(QList<ConductorProperties> list);
|
||||||
|
|
||||||
|
|||||||
@@ -987,7 +987,7 @@ void Diagram::folioSequentialsToXml(QHash<QString,
|
|||||||
QDomElement folioseq = doc->createElement(type);
|
QDomElement folioseq = doc->createElement(type);
|
||||||
folioseq.setAttribute("title", i.key());
|
folioseq.setAttribute("title", i.key());
|
||||||
for (int j = 0; j < i.value().size(); j++) {
|
for (int j = 0; j < i.value().size(); j++) {
|
||||||
folioseq.setAttribute(seq_type + QString::number(j+1), i.value().at(j));
|
folioseq.setAttribute(seq_type + QString::number(j+1),
|
||||||
i.value().at(j));
|
i.value().at(j));
|
||||||
}
|
}
|
||||||
domElement->appendChild(folioseq);
|
domElement->appendChild(folioseq);
|
||||||
@@ -1090,7 +1090,7 @@ bool Diagram::initFromXml(QDomElement &document,
|
|||||||
@return
|
@return
|
||||||
*/
|
*/
|
||||||
Terminal* findTerminal(int conductor_index,
|
Terminal* findTerminal(int conductor_index,
|
||||||
QDomElement& f,
|
QDomElement& conductor,
|
||||||
QHash<int,
|
QHash<int,
|
||||||
Terminal *>& table_adr_id,
|
Terminal *>& table_adr_id,
|
||||||
QList<Element *>& added_elements) {
|
QList<Element *>& added_elements) {
|
||||||
|
|||||||
@@ -209,10 +209,8 @@ void DiagramContext::toSettings(QSettings &settings, const QString &array_name)
|
|||||||
Read this context properties from \a settings by running through the array
|
Read this context properties from \a settings by running through the array
|
||||||
named \a array_name.
|
named \a array_name.
|
||||||
*/
|
*/
|
||||||
void DiagramContext::fromSettings(const QSettings &settings, const QString &array_name) {
|
void DiagramContext::fromSettings(QSettings &settings, const QString &array_name) {
|
||||||
int size = settings.beginReadArray(array_name);
|
int size = settings.beginReadArray(array_name);
|
||||||
QSettings& s = const_cast<QSettings&>(settings);
|
|
||||||
int size = s.beginReadArray(array_name);
|
|
||||||
for (int i = 0 ; i < size; ++ i) {
|
for (int i = 0 ; i < size; ++ i) {
|
||||||
settings.setArrayIndex(i);
|
settings.setArrayIndex(i);
|
||||||
QString key = settings.value("name").toString();
|
QString key = settings.value("name").toString();
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ void PartArc::paint(QPainter *painter, const QStyleOptionGraphicsItem *options,
|
|||||||
@param xml_document : Xml document to use for create the xml element.
|
@param xml_document : Xml document to use for create the xml element.
|
||||||
@return : an xml element that describe this arc
|
@return : an xml element that describe this arc
|
||||||
*/
|
*/
|
||||||
QDomElement PartArc::toXml(QDomDocument &xml_document) const {
|
QDomElement PartArc::toXml(QDomDocument &xml_document) const
|
||||||
{
|
{
|
||||||
QDomElement xml_element = xml_document.createElement("arc");
|
QDomElement xml_element = xml_document.createElement("arc");
|
||||||
QPointF top_left(sceneTopLeft());
|
QPointF top_left(sceneTopLeft());
|
||||||
|
|||||||
@@ -54,6 +54,8 @@ class PartArc : public AbstractPartEllipse
|
|||||||
QDomElement toXml (QDomDocument &) const override;
|
QDomElement toXml (QDomDocument &) const override;
|
||||||
bool fromXml (const QDomElement &) override;
|
bool fromXml (const QDomElement &) override;
|
||||||
static bool valideXml(QDomElement& element);
|
static bool valideXml(QDomElement& element);
|
||||||
|
void toSettings(QSettings &,const QString & = QString()) const override {/*TODO: implement*/}
|
||||||
|
void fromSettings(QSettings &,const QString & = QString()) override{/*TODO: implement*/}
|
||||||
|
|
||||||
QPainterPath shape() const override;
|
QPainterPath shape() const override;
|
||||||
QPainterPath shadowShape() const override;
|
QPainterPath shadowShape() const override;
|
||||||
|
|||||||
@@ -157,15 +157,13 @@ QDomElement PartDynamicTextField::toXml(QDomDocument &dom_doc) const
|
|||||||
@param dom_elmt
|
@param dom_elmt
|
||||||
*/
|
*/
|
||||||
bool PartDynamicTextField::fromXml(const QDomElement &dom_elmt)
|
bool PartDynamicTextField::fromXml(const QDomElement &dom_elmt)
|
||||||
|
{
|
||||||
if (dom_elmt.tagName() != xmlName()) {
|
if (dom_elmt.tagName() != xmlName()) {
|
||||||
qDebug() << "PartDynamicTextField::fromXml : Wrong tagg name";
|
qDebug() << "PartDynamicTextField::fromXml : Wrong tagg name";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
double x=0, y=0, z=0, rot=0;
|
double x=0, y=0, z=0, rot=0;
|
||||||
dom_elmt.attribute("y", QString::number(0)).toDouble()
|
|
||||||
);
|
|
||||||
|
|
||||||
if (propertyDouble(dom_elmt, "x", &x) == PropertyFlags::NoValidConversion ||
|
if (propertyDouble(dom_elmt, "x", &x) == PropertyFlags::NoValidConversion ||
|
||||||
propertyDouble(dom_elmt, "y", &y) == PropertyFlags::NoValidConversion ||
|
propertyDouble(dom_elmt, "y", &y) == PropertyFlags::NoValidConversion ||
|
||||||
propertyDouble(dom_elmt, "z", &z) == PropertyFlags::NoValidConversion ||
|
propertyDouble(dom_elmt, "z", &z) == PropertyFlags::NoValidConversion ||
|
||||||
@@ -183,7 +181,6 @@ bool PartDynamicTextField::fromXml(const QDomElement &dom_elmt)
|
|||||||
font_.fromString(font);
|
font_.fromString(font);
|
||||||
setFont(font_);
|
setFont(font_);
|
||||||
} else { //Keep compatibility TODO remove in futur
|
} else { //Keep compatibility TODO remove in futur
|
||||||
else {
|
|
||||||
#if TODO_LIST
|
#if TODO_LIST
|
||||||
#pragma message("@TODO remove in futur")
|
#pragma message("@TODO remove in futur")
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -79,6 +79,8 @@ class PartDynamicTextField : public QGraphicsTextItem, public CustomElementPart
|
|||||||
bool fromXml(const QDomElement &dom_elmt) override;
|
bool fromXml(const QDomElement &dom_elmt) override;
|
||||||
void fromTextFieldXml(const QDomElement &dom_element);
|
void fromTextFieldXml(const QDomElement &dom_element);
|
||||||
static bool valideXml(QDomElement& dom_elmt);
|
static bool valideXml(QDomElement& dom_elmt);
|
||||||
|
void toSettings(QSettings &,const QString & = QString()) const override {/*TODO: implement*/}
|
||||||
|
void fromSettings(QSettings &,const QString & = QString()) override{/*TODO: implement*/}
|
||||||
|
|
||||||
DynamicElementTextItem::TextFrom textFrom() const;
|
DynamicElementTextItem::TextFrom textFrom() const;
|
||||||
void setTextFrom (DynamicElementTextItem::TextFrom text_from);
|
void setTextFrom (DynamicElementTextItem::TextFrom text_from);
|
||||||
|
|||||||
@@ -55,6 +55,8 @@ class PartEllipse : public AbstractPartEllipse
|
|||||||
QDomElement toXml (QDomDocument &) const override;
|
QDomElement toXml (QDomDocument &) const override;
|
||||||
bool fromXml (const QDomElement &) override;
|
bool fromXml (const QDomElement &) override;
|
||||||
static bool valideXml(QDomElement& element);
|
static bool valideXml(QDomElement& element);
|
||||||
|
void toSettings(QSettings &,const QString & = QString()) const override {/*TODO: implement*/}
|
||||||
|
void fromSettings(QSettings &,const QString & = QString()) override{/*TODO: implement*/}
|
||||||
QPainterPath shape() const override;
|
QPainterPath shape() const override;
|
||||||
QPainterPath shadowShape() const override;
|
QPainterPath shadowShape() const override;
|
||||||
void setRect(const QRectF &rect) override {AbstractPartEllipse::setRect(rect); adjusteHandlerPos();}
|
void setRect(const QRectF &rect) override {AbstractPartEllipse::setRect(rect); adjusteHandlerPos();}
|
||||||
|
|||||||
@@ -73,6 +73,8 @@ class PartLine : public CustomElementGraphicPart
|
|||||||
QDomElement toXml(QDomDocument &) const override;
|
QDomElement toXml(QDomDocument &) const override;
|
||||||
bool fromXml(const QDomElement &) override;
|
bool fromXml(const QDomElement &) override;
|
||||||
bool valideXml(QDomElement& element) const;
|
bool valideXml(QDomElement& element) const;
|
||||||
|
void toSettings(QSettings &,const QString & = QString()) const override {/*TODO: implement*/}
|
||||||
|
void fromSettings(QSettings &,const QString & = QString()) override{/*TODO: implement*/}
|
||||||
virtual QPointF sceneP1() const;
|
virtual QPointF sceneP1() const;
|
||||||
virtual QPointF sceneP2() const;
|
virtual QPointF sceneP2() const;
|
||||||
QPainterPath shape() const override;
|
QPainterPath shape() const override;
|
||||||
|
|||||||
@@ -64,6 +64,8 @@ class PartPolygon : public CustomElementGraphicPart
|
|||||||
bool fromXml(const QDomElement &) override;
|
bool fromXml(const QDomElement &) override;
|
||||||
QDomElement toXml(QDomDocument &) const override;
|
QDomElement toXml(QDomDocument &) const override;
|
||||||
static bool valideXml(QDomElement& element);
|
static bool valideXml(QDomElement& element);
|
||||||
|
void toSettings(QSettings &,const QString & = QString()) const override {/*TODO: implement*/}
|
||||||
|
void fromSettings(QSettings &,const QString & = QString()) override{/*TODO: implement*/}
|
||||||
|
|
||||||
|
|
||||||
QPainterPath shape () const override;
|
QPainterPath shape () const override;
|
||||||
|
|||||||
@@ -63,6 +63,8 @@ class PartRectangle : public CustomElementGraphicPart
|
|||||||
QDomElement toXml (QDomDocument &) const override;
|
QDomElement toXml (QDomDocument &) const override;
|
||||||
bool fromXml (const QDomElement &) override;
|
bool fromXml (const QDomElement &) override;
|
||||||
static bool valideXml(QDomElement& element);
|
static bool valideXml(QDomElement& element);
|
||||||
|
void toSettings(QSettings &,const QString & = QString()) const override {/*TODO: implement*/}
|
||||||
|
void fromSettings(QSettings &,const QString & = QString()) override{/*TODO: implement*/}
|
||||||
|
|
||||||
QRectF rect() const;
|
QRectF rect() const;
|
||||||
void setRect(const QRectF &rect);
|
void setRect(const QRectF &rect);
|
||||||
|
|||||||
@@ -56,6 +56,8 @@ class PartTerminal : public CustomElementGraphicPart {
|
|||||||
bool fromXml(const QDomElement &) override;
|
bool fromXml(const QDomElement &) override;
|
||||||
QDomElement toXml(QDomDocument &) const override;
|
QDomElement toXml(QDomDocument &) const override;
|
||||||
static bool valideXml(QDomElement& element);
|
static bool valideXml(QDomElement& element);
|
||||||
|
void toSettings(QSettings &,const QString & = QString()) const override {/*TODO: implement*/}
|
||||||
|
void fromSettings(QSettings &,const QString & = QString()) override{/*TODO: implement*/}
|
||||||
void paint(
|
void paint(
|
||||||
QPainter *painter,
|
QPainter *painter,
|
||||||
const QStyleOptionGraphicsItem *,
|
const QStyleOptionGraphicsItem *,
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ PartText::~PartText()
|
|||||||
@param xml_element Element XML a lire
|
@param xml_element Element XML a lire
|
||||||
*/
|
*/
|
||||||
bool PartText::fromXml(const QDomElement &xml_element)
|
bool PartText::fromXml(const QDomElement &xml_element)
|
||||||
|
{
|
||||||
int size;
|
int size;
|
||||||
QString font;
|
QString font;
|
||||||
|
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ class PartText : public QGraphicsTextItem, public CustomElementPart {
|
|||||||
QString xmlName() const override { return(QString("text")); }
|
QString xmlName() const override { return(QString("text")); }
|
||||||
bool fromXml(const QDomElement &) override;
|
bool fromXml(const QDomElement &) override;
|
||||||
static bool valideXml(QDomElement& element);
|
static bool valideXml(QDomElement& element);
|
||||||
|
void toSettings(QSettings &,const QString & = QString()) const override {/*TODO: implement*/}
|
||||||
|
void fromSettings(QSettings &,const QString & = QString()) override{/*TODO: implement*/}
|
||||||
QDomElement toXml(QDomDocument &) const override;
|
QDomElement toXml(QDomDocument &) const override;
|
||||||
void setRotation(qreal angle) {(QGraphicsObject::setRotation(QET::correctAngle(angle)));}
|
void setRotation(qreal angle) {(QGraphicsObject::setRotation(QET::correctAngle(angle)));}
|
||||||
bool isUseless() const override;
|
bool isUseless() const override;
|
||||||
|
|||||||
@@ -16,8 +16,9 @@
|
|||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include "propertiesinterface.h"
|
#include "propertiesinterface.h"
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
|
/*!
|
||||||
* Available property types
|
* Available property types
|
||||||
*/
|
*/
|
||||||
namespace {
|
namespace {
|
||||||
|
|||||||
@@ -43,8 +43,8 @@ class PropertiesInterface
|
|||||||
befor the name of each paramètre
|
befor the name of each paramètre
|
||||||
@param QString
|
@param QString
|
||||||
*/
|
*/
|
||||||
virtual void toSettings (QSettings &settings,
|
virtual void toSettings(QSettings &,
|
||||||
const QString = QString()) const =0;
|
const QString & = QString()) const =0;
|
||||||
/**
|
/**
|
||||||
@brief fromSettings
|
@brief fromSettings
|
||||||
load properties to setting file.
|
load properties to setting file.
|
||||||
@@ -52,8 +52,8 @@ class PropertiesInterface
|
|||||||
befor the name of each paramètre
|
befor the name of each paramètre
|
||||||
@param QString
|
@param QString
|
||||||
*/
|
*/
|
||||||
virtual void fromSettings (const QSettings &settings,
|
virtual void fromSettings(QSettings &,
|
||||||
const QString = QString()) =0;
|
const QString & = QString()) = 0;
|
||||||
/**
|
/**
|
||||||
@brief toXml
|
@brief toXml
|
||||||
Save properties to xml element
|
Save properties to xml element
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ void TerminalData::setParent(QGraphicsObject* parent)
|
|||||||
@param settings UNUSED
|
@param settings UNUSED
|
||||||
@param prefix UNUSED
|
@param prefix UNUSED
|
||||||
*/
|
*/
|
||||||
void TerminalData::toSettings(QSettings &settings, const QString prefix) const
|
void TerminalData::toSettings(QSettings &settings, const QString &prefix) const
|
||||||
|
|
||||||
{
|
{
|
||||||
Q_UNUSED(settings);
|
Q_UNUSED(settings);
|
||||||
@@ -56,7 +56,7 @@ void TerminalData::toSettings(QSettings &settings, const QString prefix) const
|
|||||||
@param settings UNUSED
|
@param settings UNUSED
|
||||||
@param prefix UNUSED
|
@param prefix UNUSED
|
||||||
*/
|
*/
|
||||||
void TerminalData::fromSettings(const QSettings &settings, const QString prefix)
|
void TerminalData::fromSettings(QSettings &settings, const QString& prefix)
|
||||||
{
|
{
|
||||||
Q_UNUSED(settings);
|
Q_UNUSED(settings);
|
||||||
Q_UNUSED(prefix);
|
Q_UNUSED(prefix);
|
||||||
@@ -134,8 +134,7 @@ bool TerminalData::fromXml (const QDomElement &xml_element) // RETURNS True
|
|||||||
|
|
||||||
// read the orientation of the terminal
|
// read the orientation of the terminal
|
||||||
// lit l'orientation de la borne
|
// lit l'orientation de la borne
|
||||||
m_orientation = Qet::orientationFromString(
|
m_orientation = orientationFromString(o);
|
||||||
xml_element.attribute("orientation"));
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,9 +27,9 @@ class TerminalData : public PropertiesInterface
|
|||||||
|
|
||||||
void setParent(QGraphicsObject* parent);
|
void setParent(QGraphicsObject* parent);
|
||||||
void toSettings(QSettings &settings,
|
void toSettings(QSettings &settings,
|
||||||
const QString prefix = QString()) const override;
|
const QString& prefix = QString()) const override;
|
||||||
void toSettings(QSettings &settings, const QString& = QString()) const override;
|
void fromSettings(QSettings &settings,
|
||||||
void fromSettings(const QSettings &settings, const QString& = QString()) override;
|
const QString& = QString()) override;
|
||||||
QDomElement toXml(QDomDocument &xml_element) const override;
|
QDomElement toXml(QDomDocument &xml_element) const override;
|
||||||
bool fromXml(const QDomElement &xml_element) override;
|
bool fromXml(const QDomElement &xml_element) override;
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ XRefProperties::XRefProperties()
|
|||||||
@param prefix: prefix before properties name
|
@param prefix: prefix before properties name
|
||||||
*/
|
*/
|
||||||
void XRefProperties::toSettings(QSettings &settings,
|
void XRefProperties::toSettings(QSettings &settings,
|
||||||
const QString prefix) const
|
const QString &prefix) const
|
||||||
{
|
{
|
||||||
settings.setValue(prefix + "showpowerctc", m_show_power_ctc);
|
settings.setValue(prefix + "showpowerctc", m_show_power_ctc);
|
||||||
QString display = m_display == Cross? "cross" : "contacts";
|
QString display = m_display == Cross? "cross" : "contacts";
|
||||||
@@ -65,8 +65,8 @@ void XRefProperties::toSettings(QSettings &settings,
|
|||||||
@param settings: QSettings to use
|
@param settings: QSettings to use
|
||||||
@param prefix: prefix before properties name
|
@param prefix: prefix before properties name
|
||||||
*/
|
*/
|
||||||
void XRefProperties::fromSettings(const QSettings &settings,
|
void XRefProperties::fromSettings(QSettings &settings,
|
||||||
const QString prefix)
|
const QString &prefix)
|
||||||
{
|
{
|
||||||
m_show_power_ctc = settings.value(prefix + "showpowerctc", true).toBool();
|
m_show_power_ctc = settings.value(prefix + "showpowerctc", true).toBool();
|
||||||
QString display = settings.value(prefix + "displayhas", "cross").toString();
|
QString display = settings.value(prefix + "displayhas", "cross").toString();
|
||||||
@@ -147,7 +147,7 @@ bool XRefProperties::fromXml(const QDomElement &xml_element) {
|
|||||||
propertyString(xml_element, "slave_label", &m_slave_label);
|
propertyString(xml_element, "slave_label", &m_slave_label);
|
||||||
QString value;
|
QString value;
|
||||||
foreach (QString key, m_prefix_keys) {
|
foreach (QString key, m_prefix_keys) {
|
||||||
if (!propertyString(xml_element, key + "prefix", &value));
|
if (!propertyString(xml_element, key + "prefix", &value))
|
||||||
m_prefix.insert(key, value);
|
m_prefix.insert(key, value);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -42,10 +42,9 @@ class XRefProperties : public PropertiesInterface
|
|||||||
Label
|
Label
|
||||||
};
|
};
|
||||||
|
|
||||||
void toSettings (QSettings &settings, const QString& = QString()) const override;
|
void toSettings (QSettings &settings, const QString& = QString()) const override;
|
||||||
void fromSettings (const QSettings &settings, const QString& = QString()) override;
|
void fromSettings (QSettings &settings,
|
||||||
void fromSettings (const QSettings &settings,
|
const QString& = QString()) override;
|
||||||
const QString = QString()) override;
|
|
||||||
QDomElement toXml (QDomDocument &xml_document) const override;
|
QDomElement toXml (QDomDocument &xml_document) const override;
|
||||||
bool fromXml(const QDomElement &xml_element) override;
|
bool fromXml(const QDomElement &xml_element) override;
|
||||||
|
|
||||||
|
|||||||
@@ -987,6 +987,7 @@ bool Conductor::fromXml(const QDomElement &dom_element)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// does not support legacy method
|
// does not support legacy method
|
||||||
|
/*!
|
||||||
@brief Conductor::toXml
|
@brief Conductor::toXml
|
||||||
Exporte les caracteristiques du conducteur sous forme d'une element XML.
|
Exporte les caracteristiques du conducteur sous forme d'une element XML.
|
||||||
@param dom_document :
|
@param dom_document :
|
||||||
@@ -995,6 +996,7 @@ bool Conductor::fromXml(const QDomElement &dom_element)
|
|||||||
Hash stockant les correspondances entre les ids des
|
Hash stockant les correspondances entre les ids des
|
||||||
bornes dans le document XML et leur adresse en memoire
|
bornes dans le document XML et leur adresse en memoire
|
||||||
@return Un element XML representant le conducteur
|
@return Un element XML representant le conducteur
|
||||||
|
*/
|
||||||
QDomElement Conductor::toXml(QDomDocument & doc) const {
|
QDomElement Conductor::toXml(QDomDocument & doc) const {
|
||||||
QDomElement dom_element = doc.createElement("conductor");
|
QDomElement dom_element = doc.createElement("conductor");
|
||||||
|
|
||||||
|
|||||||
@@ -102,8 +102,9 @@ class Conductor : public QGraphicsObject, public PropertiesInterface
|
|||||||
public:
|
public:
|
||||||
static bool valideXml (QDomElement &);
|
static bool valideXml (QDomElement &);
|
||||||
bool fromXml (const QDomElement &) override;
|
bool fromXml (const QDomElement &) override;
|
||||||
//QDomElement toXml (QDomDocument &, QHash<Terminal *, int> &) const;
|
|
||||||
QDomElement toXml (QDomDocument &doc) const override;
|
QDomElement toXml (QDomDocument &doc) const override;
|
||||||
|
void toSettings(QSettings &, const QString & = QString()) const override {}
|
||||||
|
void fromSettings(QSettings &, const QString & = QString()) override {}
|
||||||
private:
|
private:
|
||||||
bool pathFromXml(const QDomElement &);
|
bool pathFromXml(const QDomElement &);
|
||||||
|
|
||||||
|
|||||||
@@ -539,13 +539,12 @@ bool Element::buildFromXml(const QDomElement &xml_def_elmt, int *state)
|
|||||||
m_state = QET::GIOK;
|
m_state = QET::GIOK;
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
if (state)
|
||||||
if (state)
|
*state = 0;
|
||||||
*state = 0;
|
m_state = QET::GIOK;
|
||||||
m_state = QET::GIOK;
|
return(true);
|
||||||
return(true);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief Element::parseElement
|
@brief Element::parseElement
|
||||||
@@ -709,8 +708,7 @@ bool Element::valideXml(QDomElement &e) {
|
|||||||
*/
|
*/
|
||||||
bool Element::fromXml(
|
bool Element::fromXml(
|
||||||
QDomElement &e,
|
QDomElement &e,
|
||||||
QHash<int,
|
QHash<int, Terminal *> &table_id_adr)
|
||||||
Terminal *> &table_id_adr)
|
|
||||||
{
|
{
|
||||||
m_state = QET::GILoadingFromXml;
|
m_state = QET::GILoadingFromXml;
|
||||||
/*
|
/*
|
||||||
@@ -778,7 +776,7 @@ bool Element::fromXml(
|
|||||||
}
|
}
|
||||||
// copie des associations id / adr
|
// copie des associations id / adr
|
||||||
foreach(int id_trouve, priv_id_adr.keys()) {
|
foreach(int id_trouve, priv_id_adr.keys()) {
|
||||||
table_id_adr.insert(id_trouve, priv_id_adr.value(id_trouve));
|
table_id_adr.insert(id_trouve,
|
||||||
priv_id_adr.value(id_trouve));
|
priv_id_adr.value(id_trouve));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1078,6 +1076,7 @@ bool Element::fromXml(
|
|||||||
}
|
}
|
||||||
|
|
||||||
QPointF pos = deti->pos();
|
QPointF pos = deti->pos();
|
||||||
|
// TODO: check
|
||||||
if (m_link_type !=PreviousReport
|
if (m_link_type !=PreviousReport
|
||||||
|| m_link_type !=NextReport)
|
|| m_link_type !=NextReport)
|
||||||
{
|
{
|
||||||
@@ -1182,9 +1181,7 @@ bool Element::fromXml(
|
|||||||
\~French L'element XML representant cet element electrique
|
\~French L'element XML representant cet element electrique
|
||||||
*/
|
*/
|
||||||
QDomElement Element::toXml(
|
QDomElement Element::toXml(
|
||||||
QDomDocument &document,
|
QDomDocument &document) const
|
||||||
QHash<Terminal *,
|
|
||||||
int> &table_adr_id) const
|
|
||||||
{
|
{
|
||||||
QDomElement element = document.createElement("element");
|
QDomElement element = document.createElement("element");
|
||||||
|
|
||||||
@@ -1211,7 +1208,6 @@ QDomElement Element::toXml(
|
|||||||
element.setAttribute("z", QString::number(this->zValue()));
|
element.setAttribute("z", QString::number(this->zValue()));
|
||||||
element.setAttribute("orientation", QString::number(orientation()));
|
element.setAttribute("orientation", QString::number(orientation()));
|
||||||
|
|
||||||
* recupere le premier id a utiliser pour les bornes de cet element */
|
|
||||||
// registration of device terminals
|
// registration of device terminals
|
||||||
// enregistrement des bornes de l'appareil
|
// enregistrement des bornes de l'appareil
|
||||||
QDomElement xml_terminals = document.createElement("terminals");
|
QDomElement xml_terminals = document.createElement("terminals");
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ class Element : public QetGraphicsItem // TODO: derive from propertiesInterface!
|
|||||||
QPoint hotspot() const;
|
QPoint hotspot() const;
|
||||||
void editProperty() override;
|
void editProperty() override;
|
||||||
static bool valideXml(QDomElement &);
|
static bool valideXml(QDomElement &);
|
||||||
virtual bool fromXml(QDomElement &, QHash<int, Terminal *> &, bool = false);
|
virtual bool fromXml(QDomElement &, QHash<int, Terminal *> &);
|
||||||
virtual QDomElement toXml(QDomDocument &) const;
|
virtual QDomElement toXml(QDomDocument &) const;
|
||||||
QUuid uuid() const;
|
QUuid uuid() const;
|
||||||
int orientation() const;
|
int orientation() const;
|
||||||
|
|||||||
@@ -209,6 +209,7 @@ void Terminal::setNumber(QString number)
|
|||||||
@param hiddenName : bool
|
@param hiddenName : bool
|
||||||
*/
|
*/
|
||||||
void Terminal::setName(QString name, bool hiddenName)
|
void Terminal::setName(QString name, bool hiddenName)
|
||||||
|
{
|
||||||
d->m_name = std::move(name);
|
d->m_name = std::move(name);
|
||||||
name_terminal_hidden = hiddenName;
|
name_terminal_hidden = hiddenName;
|
||||||
}
|
}
|
||||||
@@ -798,7 +799,7 @@ QDomElement Terminal::toXml(QDomDocument &doc) const
|
|||||||
@param terminal Le QDomElement a analyser
|
@param terminal Le QDomElement a analyser
|
||||||
@return true si le QDomElement passe en parametre est une borne, false sinon
|
@return true si le QDomElement passe en parametre est une borne, false sinon
|
||||||
*/
|
*/
|
||||||
bool Terminal::valideXml(const QDomElement &terminal) {
|
bool Terminal::valideXml(const QDomElement &terminal)
|
||||||
{
|
{
|
||||||
if (terminal.tagName() != "terminal") return(false);
|
if (terminal.tagName() != "terminal") return(false);
|
||||||
|
|
||||||
|
|||||||
@@ -100,6 +100,9 @@ class Terminal : public QGraphicsObject, public PropertiesInterface
|
|||||||
bool fromXml (const QDomElement &) override;
|
bool fromXml (const QDomElement &) override;
|
||||||
QDomElement toXml (QDomDocument &) const override;
|
QDomElement toXml (QDomDocument &) const override;
|
||||||
|
|
||||||
|
void toSettings(QSettings &,const QString & = QString()) const override {/*TODO: implement*/}
|
||||||
|
void fromSettings(QSettings &,const QString & = QString()) override{/*TODO: implement*/}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// methods related to events management
|
// methods related to events management
|
||||||
void hoverEnterEvent (QGraphicsSceneHoverEvent *) override;
|
void hoverEnterEvent (QGraphicsSceneHoverEvent *) override;
|
||||||
@@ -132,7 +135,7 @@ class Terminal : public QGraphicsObject, public PropertiesInterface
|
|||||||
QGraphicsLineItem *m_help_line_a{nullptr};
|
QGraphicsLineItem *m_help_line_a{nullptr};
|
||||||
|
|
||||||
|
|
||||||
TerminalData* d;
|
TerminalData* d{nullptr};
|
||||||
|
|
||||||
/// Parent electrical element
|
/// Parent electrical element
|
||||||
Element *parent_element_{nullptr};
|
Element *parent_element_{nullptr};
|
||||||
@@ -185,7 +188,7 @@ inline QString Terminal::number() const
|
|||||||
return(number_terminal_);
|
return(number_terminal_);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
QList<Terminal *> relatedPotentialTerminal (const Terminal *terminal,
|
QList<Terminal *> relatedPotentialTerminal (const Terminal *terminal,
|
||||||
const bool all_diagram = true);
|
const bool all_diagram = true);
|
||||||
|
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ void TitleBlockProperties::toSettings(QSettings &settings, const QString &prefix
|
|||||||
@param settings Parametres a lire
|
@param settings Parametres a lire
|
||||||
@param prefix prefixe a ajouter devant les noms des parametres
|
@param prefix prefixe a ajouter devant les noms des parametres
|
||||||
*/
|
*/
|
||||||
void TitleBlockProperties::fromSettings(const QSettings &settings, const QString &prefix) {
|
void TitleBlockProperties::fromSettings(QSettings &settings, const QString &prefix) {
|
||||||
title = settings.value(prefix + "title").toString();
|
title = settings.value(prefix + "title").toString();
|
||||||
author = settings.value(prefix + "author").toString();
|
author = settings.value(prefix + "author").toString();
|
||||||
filename = settings.value(prefix + "filename").toString();
|
filename = settings.value(prefix + "filename").toString();
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class TitleBlockProperties: public PropertiesInterface {
|
|||||||
void toXml(QDomElement &e) const;
|
void toXml(QDomElement &e) const;
|
||||||
bool fromXml(const QDomElement &) override;
|
bool fromXml(const QDomElement &) override;
|
||||||
void toSettings(QSettings &, const QString & = QString()) const override;
|
void toSettings(QSettings &, const QString & = QString()) const override;
|
||||||
void fromSettings(const QSettings &, const QString & = QString()) override;
|
void fromSettings(QSettings &, const QString & = QString()) override;
|
||||||
|
|
||||||
void setAutoPageNum(QString autonum) {auto_page_num = autonum;}
|
void setAutoPageNum(QString autonum) {auto_page_num = autonum;}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user