mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-02-21 20:09:59 +01:00
Element editor : minor fix
In the part list widget, the terminal name is empty if terminal haven't got name. Now "terminal" is always displayed and if the terminal have a name the name is appended to "terminal". Example : if the terminal name is 24 then the the part list widget show "terminal : 24"
This commit is contained in:
@@ -179,10 +179,10 @@ qreal PartTerminal::rotation() const {
|
||||
}
|
||||
|
||||
/**
|
||||
@brief PartTerminal::setName
|
||||
@brief PartTerminal::setTerminalName
|
||||
@param name
|
||||
*/
|
||||
void PartTerminal::setName(QString& name) {
|
||||
void PartTerminal::setTerminalName(const QString& name) {
|
||||
if (d -> m_name == name) return;
|
||||
d -> m_name = name;
|
||||
emit nameChanged();
|
||||
|
||||
@@ -32,7 +32,7 @@ class PartTerminal : public CustomElementGraphicPart
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(Qet::Orientation orientation READ orientation WRITE setOrientation)
|
||||
Q_PROPERTY(QString name READ name WRITE setName)
|
||||
Q_PROPERTY(QString terminal_name READ terminalName WRITE setTerminalName)
|
||||
Q_PROPERTY(TerminalData::Type terminal_type READ terminalType WRITE setTerminalType)
|
||||
|
||||
public:
|
||||
@@ -78,8 +78,10 @@ class PartTerminal : public CustomElementGraphicPart
|
||||
void setRotation(qreal angle);
|
||||
|
||||
|
||||
QString name() const override { return d -> m_name; }
|
||||
void setName(QString& name);
|
||||
QString terminalName() const { return d -> m_name; }
|
||||
void setTerminalName(const QString& name);
|
||||
|
||||
QString name() const override { return QObject::tr("Borne");}
|
||||
|
||||
TerminalData::Type terminalType() const {return d->m_type;}
|
||||
void setTerminalType(TerminalData::Type type);
|
||||
|
||||
Reference in New Issue
Block a user