mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-01-10 07:59:58 +01:00
Fix compilation warning (clang and gcc)
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5301 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -1020,7 +1020,13 @@ QDomElement Conductor::toXml(QDomDocument &dom_document, QHash<Terminal *, int>
|
||||
|
||||
// Export the properties and text
|
||||
m_properties. toXml(dom_element);
|
||||
m_text_item -> toXml(dom_element);
|
||||
if(m_text_item->wasMovedByUser())
|
||||
{
|
||||
dom_element.setAttribute("userx", QString::number(m_text_item->pos().x()));
|
||||
dom_element.setAttribute("usery", QString::number(m_text_item->pos().y()));
|
||||
}
|
||||
if(m_text_item->wasRotateByUser())
|
||||
dom_element.setAttribute("rotation", QString::number(m_text_item->rotation()));
|
||||
|
||||
return(dom_element);
|
||||
}
|
||||
|
||||
@@ -78,22 +78,6 @@ void ConductorTextItem::fromXml(const QDomElement &e) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ConductorTextItem::toXml
|
||||
* Export the properties of this text in the attribute of the xml element given in parameter
|
||||
* The properties exported are position and rotation (only if moved or rotate by user)
|
||||
* @param xml
|
||||
*/
|
||||
void ConductorTextItem::toXml(QDomElement &xml) const {
|
||||
if (moved_by_user_) {
|
||||
xml.setAttribute("userx", QString("%1").arg(pos().x()));
|
||||
xml.setAttribute("usery", QString("%1").arg(pos().y()));
|
||||
}
|
||||
if (rotate_by_user_) {
|
||||
xml.setAttribute("rotation", QString("%1").arg(rotation()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@return true si ce champ de texte a ete explictement deplace par
|
||||
l'utilisateur, false sinon
|
||||
|
||||
@@ -42,7 +42,6 @@ class ConductorTextItem : public DiagramTextItem
|
||||
enum { Type = UserType + 1006 };
|
||||
Conductor *parentConductor() const;
|
||||
void fromXml(const QDomElement &) override;
|
||||
virtual void toXml (QDomElement &xml) const;
|
||||
int type() const override { return Type; }
|
||||
virtual bool wasMovedByUser() const;
|
||||
virtual bool wasRotateByUser() const;
|
||||
|
||||
@@ -75,7 +75,7 @@ void CrossRefItem::init()
|
||||
{
|
||||
if(!m_element->diagram())
|
||||
{
|
||||
qDebug() << "CrossRefItem constructor", "element is not in a diagram";
|
||||
qDebug() << "CrossRefItem constructor" << "element is not in a diagram";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -253,6 +253,7 @@ bool CrossRefItem::sceneEvent(QEvent *event)
|
||||
case QEvent::GraphicsSceneMouseDoubleClick:
|
||||
mouseDoubleClickEvent(static_cast<QGraphicsSceneMouseEvent *>(event));
|
||||
break;
|
||||
default:break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -648,6 +648,7 @@ bool CustomElement::parsePolygon(QDomElement &e, QPainter &qp, bool addtolist) {
|
||||
@return true si l'analyse reussit, false sinon
|
||||
*/
|
||||
bool CustomElement::parseText(QDomElement &e, QPainter &qp, bool addtolist) {
|
||||
Q_UNUSED(addtolist);
|
||||
qreal pos_x, pos_y;
|
||||
int size;
|
||||
if (
|
||||
|
||||
@@ -963,7 +963,7 @@ void DynamicElementTextItem::clearFormulaConnection()
|
||||
|
||||
void DynamicElementTextItem::updateReportFormulaConnection()
|
||||
{
|
||||
if(!m_parent_element.data()->linkType() & Element::AllReport)
|
||||
if(!(m_parent_element.data()->linkType() & Element::AllReport))
|
||||
return;
|
||||
|
||||
removeConnectionForReportFormula(m_report_formula);
|
||||
@@ -977,7 +977,7 @@ void DynamicElementTextItem::updateReportFormulaConnection()
|
||||
*/
|
||||
void DynamicElementTextItem::updateReportText()
|
||||
{
|
||||
if(!m_parent_element.data()->linkType() & Element::AllReport)
|
||||
if(!(m_parent_element.data()->linkType() & Element::AllReport))
|
||||
return;
|
||||
|
||||
if (m_text_from == ElementInfo && m_info_name == "label" && m_other_report)
|
||||
|
||||
@@ -356,12 +356,6 @@ bool Element::valideXml(QDomElement &e) {
|
||||
*/
|
||||
bool Element::fromXml(QDomElement &e, QHash<int, Terminal *> &table_id_adr, bool handle_inputs_rotation)
|
||||
{
|
||||
QDomDocument doc = e.ownerDocument();
|
||||
QDomElement root = doc.documentElement();
|
||||
double saved_version = -1;
|
||||
if(root.tagName() == "project")
|
||||
saved_version = root.attribute("version", "-1").toDouble();
|
||||
|
||||
/*
|
||||
les bornes vont maintenant etre recensees pour associer leurs id a leur adresse reelle
|
||||
ce recensement servira lors de la mise en place des fils
|
||||
@@ -776,7 +770,7 @@ QDomElement Element::toXml(QDomDocument &document, QHash<Terminal *, int> &table
|
||||
//Dynamic texts
|
||||
QDomElement dyn_text = document.createElement("dynamic_texts");
|
||||
for (DynamicElementTextItem *deti : m_dynamic_text_list)
|
||||
dyn_text.appendChild(deti->toXml(document));
|
||||
dyn_text.appendChild(deti->toXml(document));
|
||||
|
||||
QDomElement texts_group = document.createElement("texts_groups");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user