QElectroTech  0.70
partterminal.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2019 The QElectroTech Team
3  This file is part of QElectroTech.
4 
5  QElectroTech is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 2 of the License, or
8  (at your option) any later version.
9 
10  QElectroTech is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef PART_TERMINAL_H
19 #define PART_TERMINAL_H
20 
22 
23 
24 
30 {
31  Q_OBJECT
32 
34 
35 
36  public:
37  // constructors, destructor
38  PartTerminal(QETElementEditor *editor, QGraphicsItem *parent = nullptr);
39  ~PartTerminal() override;
40  private:
41  PartTerminal(const PartTerminal &);
42 
43  signals:
44  void orientationChanged();
45 
46  // attributes
47  private:
49  QPointF second_point;
50 
51 
52  // methods
53  public:
54  enum { Type = UserType + 1106 };
59  int type() const override { return Type; }
60  QString name() const override { return(QObject::tr("borne", "element part name")); }
61  QString xmlName() const override { return(QString("terminal")); }
62  void fromXml(const QDomElement &) override;
63  const QDomElement toXml(QDomDocument &) const override;
64  void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) override;
65 
66  QPainterPath shape() const override;
67  QPainterPath shadowShape() const override {return shape();}
68  QRectF boundingRect() const override;
69  bool isUseless() const override;
70  QRectF sceneGeometricRect() const override;
71  void startUserTransformation(const QRectF &) override;
72  void handleUserTransformation(const QRectF &, const QRectF &) override;
73 
76 
77  private:
78  void updateSecondPoint();
79 
80  private:
81  QPointF saved_position_;
82 };
83 #endif
void fromXml(const QDomElement &) override
Qet::Orientation orientation() const
Definition: partterminal.h:74
PartTerminal(QETElementEditor *editor, QGraphicsItem *parent=nullptr)
QString name() const override
Definition: partterminal.h:60
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) override
Qet::Orientation m_orientation
Definition: partterminal.h:48
The CustomElementGraphicPart class This class is the base for all home-made primitive like line...
QRectF boundingRect() const override
PartTerminal::boundingRect.
int type() const override
Definition: partterminal.h:59
QString xmlName() const override
Definition: partterminal.h:61
void startUserTransformation(const QRectF &) override
void setOrientation(Qet::Orientation ori)
~PartTerminal() override
Destructeur.
void handleUserTransformation(const QRectF &, const QRectF &) override
void updateSecondPoint()
QIcon tr
Definition: qeticons.cpp:204
bool isUseless() const override
QPointF second_point
Definition: partterminal.h:49
QRectF sceneGeometricRect() const override
QPainterPath shape() const override
PartTerminal::shape.
QPainterPath shadowShape() const override
Definition: partterminal.h:67
QPointF saved_position_
Definition: partterminal.h:81
const QDomElement toXml(QDomDocument &) const override
void orientationChanged()
Orientation
Orientation (used for electrical elements and their terminals)
Definition: qet.h:204