mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
fix compile issues
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
#include <QtCore>
|
||||
#include <QtXml>
|
||||
|
||||
#include "propertiesinterface.h"
|
||||
#include "properties/propertiesinterface.h"
|
||||
|
||||
/**
|
||||
@brief The BorderProperties class
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include <QColor>
|
||||
#include <QSettings>
|
||||
|
||||
#include "propertiesinterface.h"
|
||||
#include "properties/propertiesinterface.h"
|
||||
|
||||
class QPainter;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#define CUSTOM_ELEMENT_PART_H
|
||||
|
||||
#include "../../qet.h"
|
||||
#include "propertiesinterface.h"
|
||||
#include "../../properties/propertiesinterface.h"
|
||||
|
||||
class CustomElement;
|
||||
class ElementPrimitiveDecorator;
|
||||
|
||||
@@ -250,7 +250,7 @@ QRectF PartTerminal::sceneGeometricRect() const
|
||||
*/
|
||||
void PartTerminal::startUserTransformation(const QRectF &initial_selection_rect) {
|
||||
Q_UNUSED(initial_selection_rect)
|
||||
saved_position_ = scenePos();
|
||||
m_saved_position = scenePos();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -258,6 +258,6 @@ void PartTerminal::startUserTransformation(const QRectF &initial_selection_rect)
|
||||
*/
|
||||
void PartTerminal::handleUserTransformation(const QRectF &initial_selection_rect, const QRectF &new_selection_rect) {
|
||||
QPointF mapped_point = mapPoints(
|
||||
initial_selection_rect, new_selection_rect, QList<QPointF>() << saved_position_).first();
|
||||
initial_selection_rect, new_selection_rect, QList<QPointF>() << m_saved_position).first();
|
||||
setPos(mapped_point);
|
||||
}
|
||||
|
||||
@@ -90,6 +90,6 @@ class PartTerminal : public CustomElementGraphicPart
|
||||
TerminalData* d{nullptr}; // pointer to the terminal data
|
||||
|
||||
private:
|
||||
QPointF saved_position_;
|
||||
QPointF m_saved_position;
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
#include "../qetxml.h"
|
||||
#include <QDebug>
|
||||
|
||||
void ElementData::toSettings(QSettings &settings, const QString prefix) const {
|
||||
void ElementData::toSettings(QSettings &settings, const QString& prefix) const {
|
||||
Q_UNUSED(settings)
|
||||
Q_UNUSED(prefix)
|
||||
}
|
||||
|
||||
void ElementData::fromSettings(const QSettings &settings, const QString prefix) {
|
||||
void ElementData::fromSettings(QSettings &settings, const QString& prefix) {
|
||||
Q_UNUSED(settings)
|
||||
Q_UNUSED(prefix)
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#ifndef ELEMENTDATA_H
|
||||
#define ELEMENTDATA_H
|
||||
|
||||
#include "propertiesinterface.h"
|
||||
#include "../properties/propertiesinterface.h"
|
||||
#include "../diagramcontext.h"
|
||||
#include "../NameList/nameslist.h"
|
||||
|
||||
@@ -85,8 +85,8 @@ class ElementData : public PropertiesInterface
|
||||
ElementData() {}
|
||||
~ElementData() override {}
|
||||
|
||||
void toSettings(QSettings &settings, const QString prefix = QString()) const override;
|
||||
void fromSettings(const QSettings &settings, const QString prefix = QString()) override;
|
||||
void toSettings(QSettings &settings, const QString& prefix = QString()) const override;
|
||||
void fromSettings(QSettings &settings, const QString& prefix = QString()) override;
|
||||
QDomElement toXml(QDomDocument &xml_element) const override;
|
||||
bool fromXml(const QDomElement &xml_element) override;
|
||||
QDomElement kindInfoToXml(QDomDocument &document);
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <QColor>
|
||||
#include <QDomElement>
|
||||
#include <limits>
|
||||
#include "qet.h"
|
||||
#include "sources/qet.h"
|
||||
#include <QUuid>
|
||||
|
||||
/**
|
||||
@@ -91,9 +91,6 @@ class PropertiesInterface
|
||||
// = 4
|
||||
};
|
||||
|
||||
/*!
|
||||
* Try not using the default Value feature. It is better to initialize the class members in the class definition!
|
||||
*/
|
||||
static PropertyFlags propertyInteger(const QDomElement &e, const QString& attribute_name, int *entier = nullptr);
|
||||
static PropertyFlags propertyDouble(const QDomElement &e, const QString& attribute_name, double *reel = nullptr);
|
||||
static PropertyFlags propertyString(const QDomElement& e, const QString& attribute_name, QString* string = nullptr);
|
||||
|
||||
@@ -103,7 +103,7 @@ QDomElement TerminalData::toXml(QDomDocument &xml_document) const
|
||||
xml_element.appendChild(createXmlProperty(xml_document, "y", m_pos.y()));
|
||||
xml_element.appendChild(createXmlProperty(xml_document, "name", m_name));
|
||||
xml_element.appendChild(createXmlProperty(xml_document, "orientation", orientationToString(m_orientation)));
|
||||
xml_element.appendChild(createXmlProperty(xml_document, "type", typeToString(m_type));
|
||||
xml_element.appendChild(createXmlProperty(xml_document, "type", typeToString(m_type)));
|
||||
|
||||
return(xml_element);
|
||||
}
|
||||
@@ -153,7 +153,7 @@ bool TerminalData::fromXml (const QDomElement &xml_element) // RETURNS True
|
||||
// lit l'orientation de la borne
|
||||
m_orientation = orientationFromString(o);
|
||||
|
||||
QStrint type;
|
||||
QString type;
|
||||
if (propertyString(xml_element, "type", &type))
|
||||
return false;
|
||||
m_type = typeFromString(type);
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#define TERMINALDATA_H
|
||||
|
||||
#include "../qet.h"
|
||||
#include "propertiesinterface.h"
|
||||
#include "../properties/propertiesinterface.h"
|
||||
|
||||
#include <QPointF>
|
||||
#include <QUuid>
|
||||
@@ -73,11 +73,11 @@ class TerminalData : public PropertiesInterface
|
||||
*/
|
||||
Qet::Orientation m_orientation{Qet::Orientation::North};
|
||||
/**
|
||||
@brief second_point
|
||||
@brief m_second_point
|
||||
Position of the second point of the terminal
|
||||
in scene coordinates
|
||||
*/
|
||||
QPointF second_point{0,0};
|
||||
QPointF m_second_point{0,0};
|
||||
/**
|
||||
@brief m_uuid
|
||||
Uuid of the terminal.
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
#include "../autoNum/assignvariables.h"
|
||||
#include "../conductorproperties.h"
|
||||
|
||||
#include "conductorproperties.h"
|
||||
#include "propertiesinterface.h"
|
||||
#include "../conductorproperties.h"
|
||||
#include "../properties/propertiesinterface.h"
|
||||
#include <QGraphicsPathItem>
|
||||
|
||||
class ConductorProfile;
|
||||
|
||||
@@ -41,7 +41,7 @@ const qreal Terminal::Z = 1000;
|
||||
@param name of terminal
|
||||
@param hiddenName
|
||||
*/
|
||||
void Terminal::init()
|
||||
void Terminal::init(QString number, QString name, bool hiddenName)
|
||||
{
|
||||
//Calcul the docking point of the element
|
||||
//m_pos of d is the docking point of conductor
|
||||
@@ -62,7 +62,13 @@ void Terminal::init()
|
||||
origin += QPointF(-3.0, -3.0);
|
||||
qreal w = qAbs(dcx - dex) + 7;
|
||||
qreal h = qAbs(dcy - dey) + 7;
|
||||
m_br = QRectF(origin, QSizeF(w, h));
|
||||
m_br = QRectF(origin, QSizeF(w, h));
|
||||
|
||||
// Number of terminal
|
||||
number_terminal_ = std::move(number);
|
||||
// Name of terminal
|
||||
d->m_name = std::move(name);
|
||||
name_terminal_hidden = hiddenName;
|
||||
|
||||
setAcceptHoverEvents(true);
|
||||
setAcceptedMouseButtons(Qt::LeftButton);
|
||||
@@ -84,7 +90,7 @@ void Terminal::init(
|
||||
Qet::Orientation o,
|
||||
QString number,
|
||||
QString name,
|
||||
bool hiddenName)
|
||||
bool hiddenName)
|
||||
{
|
||||
// definition du pount d'amarrage pour un conducteur
|
||||
d->m_pos = pf;
|
||||
@@ -93,7 +99,7 @@ void Terminal::init(
|
||||
if (o < Qet::North || o > Qet::West) d->m_orientation = Qet::South;
|
||||
else d->m_orientation = o;
|
||||
|
||||
init(number, name, hiddenName);
|
||||
init(number, name, hiddenName);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -154,7 +160,7 @@ Terminal::Terminal(TerminalData* data, Element* e) :
|
||||
parent_element_(e)
|
||||
{
|
||||
d->setParent(this);
|
||||
init();
|
||||
init("_", "_", false);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -162,7 +168,7 @@ Terminal::Terminal(TerminalData* data, Element* e) :
|
||||
* Destruction of the terminal, and also docked conductor
|
||||
*/
|
||||
Terminal::~Terminal() {
|
||||
qDeleteAll(m_conductors_list);
|
||||
qDeleteAll(m_conductors_list);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -563,7 +569,7 @@ void Terminal::mouseMoveEvent(QGraphicsSceneMouseEvent *e)
|
||||
//setCursor(Qt::CrossCursor);
|
||||
|
||||
// d'un mouvement a l'autre, il faut retirer l'effet hover de la borne precedente
|
||||
if (m_previous_terminal) {
|
||||
if (m_previous_terminal) {
|
||||
if (m_previous_terminal == this) m_hovered = true;
|
||||
else m_previous_terminal -> m_hovered = false;
|
||||
m_previous_terminal -> m_hovered_color = m_previous_terminal -> neutralColor;
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
|
||||
#include <QtWidgets>
|
||||
#include <QtXml>
|
||||
#include "qet.h"
|
||||
#include "propertiesinterface.h"
|
||||
#include "../qet.h"
|
||||
#include "../properties/propertiesinterface.h"
|
||||
|
||||
class Conductor;
|
||||
class Diagram;
|
||||
@@ -84,6 +84,11 @@ class Terminal : public QGraphicsObject, public PropertiesInterface
|
||||
int ID() const;
|
||||
QPointF dockPos();
|
||||
QPointF originPos();
|
||||
QString number() const;
|
||||
void setNumber(QString number);
|
||||
void setName(QString name, bool hiddenName);
|
||||
QString name() const;
|
||||
|
||||
|
||||
QList<Conductor *> conductors() const;
|
||||
Qet::Orientation orientation() const;
|
||||
@@ -142,19 +147,19 @@ class Terminal : public QGraphicsObject, public PropertiesInterface
|
||||
QPointF dock_elmt_;
|
||||
private:
|
||||
/// List of conductors attached to the terminal
|
||||
QList<Conductor *> conductors_;
|
||||
QList<Conductor *> m_conductors_list;
|
||||
/**
|
||||
Pointer to a rectangle representing the terminal bounding rect;
|
||||
used to calculate the bounding rect once only;
|
||||
used a pointer because boundingRect() is supposed to be const.
|
||||
*/
|
||||
QRectF *br_{nullptr};
|
||||
QRectF m_br;
|
||||
/// Last terminal seen through an attached conductor
|
||||
Terminal *previous_terminal_{nullptr};
|
||||
Terminal *m_previous_terminal{nullptr};
|
||||
/// Whether the mouse pointer is hovering the terminal
|
||||
bool hovered_{false};
|
||||
bool m_hovered{false};
|
||||
/// Color used for the hover effect
|
||||
QColor hovered_color_{Terminal::neutralColor};
|
||||
QColor m_hovered_color{Terminal::neutralColor};
|
||||
/// Number of Terminal
|
||||
QString number_terminal_;
|
||||
bool name_terminal_hidden{true};
|
||||
@@ -163,8 +168,8 @@ class Terminal : public QGraphicsObject, public PropertiesInterface
|
||||
int m_id{-1};
|
||||
|
||||
private:
|
||||
void init();
|
||||
void init(QPointF pf, Qet::Orientation o);
|
||||
void init(QString number, QString name, bool hiddenName);
|
||||
void init(QPointF pf, Qet::Orientation o,QString number, QString name, bool hiddenName);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -173,7 +178,7 @@ class Terminal : public QGraphicsObject, public PropertiesInterface
|
||||
*/
|
||||
inline int Terminal::conductorsCount() const
|
||||
{
|
||||
return(m_conductors_list.size());
|
||||
return(m_conductors_list.size());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include "diagramcontext.h"
|
||||
#include "qet.h"
|
||||
|
||||
#include "propertiesinterface.h"
|
||||
#include "properties/propertiesinterface.h"
|
||||
|
||||
/**
|
||||
This class provides a container for the properties of a particular title
|
||||
|
||||
Reference in New Issue
Block a user