mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 13:30:34 +01:00
ElementEditor: partterminal.h code style
This commit is contained in:
committed by
Laurent Trinques
parent
0bae33e3f5
commit
ac5ec020a6
@@ -23,19 +23,15 @@
|
|||||||
#include "terminaldata.h"
|
#include "terminaldata.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This class represents a terminal which may be used to compose the drawing of
|
This class represents a terminal which may be used to compose the drawing of
|
||||||
an electrical element within the element editor.
|
an electrical element within the element editor.
|
||||||
*/
|
*/
|
||||||
class PartTerminal : public CustomElementGraphicPart
|
class PartTerminal : public CustomElementGraphicPart {
|
||||||
{
|
Q_OBJECT
|
||||||
Q_OBJECT
|
Q_PROPERTY(Qet::Orientation orientation READ orientation WRITE setOrientation)
|
||||||
|
Q_PROPERTY(QString name READ name WRITE setName)
|
||||||
|
|
||||||
Q_PROPERTY(Qet::Orientation orientation READ orientation WRITE setOrientation)
|
|
||||||
Q_PROPERTY(QString name READ name WRITE setName)
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// constructors, destructor
|
// constructors, destructor
|
||||||
PartTerminal(QETElementEditor *editor, QGraphicsItem *parent = nullptr);
|
PartTerminal(QETElementEditor *editor, QGraphicsItem *parent = nullptr);
|
||||||
@@ -45,7 +41,7 @@ class PartTerminal : public CustomElementGraphicPart
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void orientationChanged();
|
void orientationChanged();
|
||||||
void nameChanged();
|
void nameChanged();
|
||||||
|
|
||||||
// methods
|
// methods
|
||||||
public:
|
public:
|
||||||
@@ -55,7 +51,7 @@ class PartTerminal : public CustomElementGraphicPart
|
|||||||
* @return the QGraphicsItem type
|
* @return the QGraphicsItem type
|
||||||
*/
|
*/
|
||||||
int type() const override { return Type; }
|
int type() const override { return Type; }
|
||||||
QString name() const override { return d->m_name; }
|
QString name() const override { return d -> m_name; }
|
||||||
QString xmlName() const override { return(QString("terminal")); }
|
QString xmlName() const override { return(QString("terminal")); }
|
||||||
void fromXml(const QDomElement &) override;
|
void fromXml(const QDomElement &) override;
|
||||||
const QDomElement toXml(QDomDocument &) const override;
|
const QDomElement toXml(QDomDocument &) const override;
|
||||||
@@ -69,7 +65,7 @@ class PartTerminal : public CustomElementGraphicPart
|
|||||||
void startUserTransformation(const QRectF &) override;
|
void startUserTransformation(const QRectF &) override;
|
||||||
void handleUserTransformation(const QRectF &, const QRectF &) override;
|
void handleUserTransformation(const QRectF &, const QRectF &) override;
|
||||||
|
|
||||||
Qet::Orientation orientation() const {return d->m_orientation;}
|
Qet::Orientation orientation() const {return d -> m_orientation;}
|
||||||
void setOrientation(Qet::Orientation ori);
|
void setOrientation(Qet::Orientation ori);
|
||||||
|
|
||||||
void setName(QString& name);
|
void setName(QString& name);
|
||||||
@@ -77,8 +73,8 @@ class PartTerminal : public CustomElementGraphicPart
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void updateSecondPoint();
|
void updateSecondPoint();
|
||||||
TerminalData* d; // pointer to the terminal data
|
TerminalData* d; // pointer to the terminal data
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPointF saved_position_;
|
QPointF saved_position_;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user