mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-03-17 07:29:58 +01:00
fix compile issues
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user