QElectroTech  0.8-dev
terminaleditor.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2020 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 TERMINAL_EDITOR_H
19 #define TERMINAL_EDITOR_H
20 
21 #include "elementitemeditor.h"
22 
23 class PartTerminal;
24 class QDoubleSpinBox;
25 class QComboBox;
26 
34  Q_OBJECT
35 
36  // Constructors, destructor
37  public:
39  QList<PartTerminal *>& terms,
40  QWidget * = nullptr);
41  TerminalEditor(QETElementEditor *, QWidget * = nullptr);
42  ~TerminalEditor() override;
43  private:
45  void init();
46 
47  // attributes
48  private:
49  QList<PartTerminal *> m_terminals;
50  PartTerminal *m_part{nullptr};
51  QDoubleSpinBox *qle_x, *qle_y;
52  QComboBox *orientation;
53  bool m_locked{false};
54 
55  // methods
56  public:
57  bool setPart(CustomElementPart *) override;
58  bool setParts(QList<CustomElementPart *> parts) override;
59  CustomElementPart *currentPart() const override;
60  QList<CustomElementPart*> currentParts() const override;
61 
62  public slots:
63  void updateTerminalO();
64  void updateXPos();
65  void updateYPos();
66  void updateForm() override;
67 
68  private:
69  void activeConnections(bool);
70 };
71 #endif
elementitemeditor.h
QPropertyUndoCommand::enableAnimation
void enableAnimation(bool animate=true)
QPropertyUndoCommand::enableAnimation True to enable animation.
Definition: qpropertyundocommand.cpp:92
TerminalEditor::qle_x
QDoubleSpinBox * qle_x
Definition: terminaleditor.h:51
PartTerminal::orientationChanged
void orientationChanged()
Qet::West
@ West
Definition: qet.h:209
TerminalEditor::qle_y
QDoubleSpinBox * qle_y
Definition: terminaleditor.h:51
TerminalEditor::activeConnections
void activeConnections(bool)
Definition: terminaleditor.cpp:253
QET::Icons::West
QIcon West
Definition: qeticons.cpp:174
TerminalEditor::TerminalEditor
TerminalEditor(QETElementEditor *, QList< PartTerminal * > &terms, QWidget *=nullptr)
TerminalEditor::TerminalEditor Constructeur.
Definition: terminaleditor.cpp:50
TerminalEditor::currentPart
CustomElementPart * currentPart() const override
Definition: terminaleditor.cpp:164
TerminalEditor::m_locked
bool m_locked
Definition: terminaleditor.h:53
TerminalEditor::m_part
PartTerminal * m_part
Definition: terminaleditor.h:50
TerminalEditor::setParts
bool setParts(QList< CustomElementPart * > parts) override
Definition: terminaleditor.cpp:134
ElementItemEditor
Definition: elementitemeditor.h:34
TerminalEditor::currentParts
QList< CustomElementPart * > currentParts() const override
Definition: terminaleditor.cpp:168
qeticons.h
partterminal.h
terminaleditor.h
TerminalEditor::m_terminals
QList< PartTerminal * > m_terminals
Definition: terminaleditor.h:49
PartTerminal
Definition: partterminal.h:30
QET::Icons::North
QIcon North
Definition: qeticons.cpp:122
qpropertyundocommand.h
Qet::North
@ North
Definition: qet.h:206
TerminalEditor::setPart
bool setPart(CustomElementPart *) override
Definition: terminaleditor.cpp:112
CustomElementPart
The CustomElementPart class This abstract class represents a primitive of the visual representation o...
Definition: customelementpart.h:40
Qet::South
@ South
Definition: qet.h:208
TerminalEditor::updateYPos
void updateYPos()
TerminalEditor::updateYPos.
Definition: terminaleditor.cpp:218
TerminalEditor::updateForm
void updateForm() override
update Number and name, create cancel object
Definition: terminaleditor.cpp:240
TerminalEditor::orientation
QComboBox * orientation
Definition: terminaleditor.h:52
TerminalEditor::updateXPos
void updateXPos()
TerminalEditor::updateXPos.
Definition: terminaleditor.cpp:197
Qet::East
@ East
Definition: qet.h:207
TerminalEditor::updateTerminalO
void updateTerminalO()
Met a jour l'orientation de la borne et cree un objet d'annulation.
Definition: terminaleditor.cpp:177
QPropertyUndoCommand
The QPropertyUndoCommand class This undo command manage QProperty of a QObject. This undo command can...
Definition: qpropertyundocommand.h:34
TerminalEditor
The TerminalEditor class This class provides a widget to edit terminals within the element editor....
Definition: terminaleditor.h:33
TerminalEditor::TerminalEditor
TerminalEditor(const TerminalEditor &)
TerminalEditor::init
void init()
TerminalEditor::init.
Definition: terminaleditor.cpp:62
QET::Icons::tr
QIcon tr
Definition: qeticons.cpp:206
TerminalEditor::~TerminalEditor
~TerminalEditor() override
TerminalEditor::~TerminalEditor Destructeur.
Definition: terminaleditor.cpp:101
QETElementEditor
Definition: qetelementeditor.h:33
QET::Icons::South
QIcon South
Definition: qeticons.cpp:161
CustomElementGraphicPart::property
QVariant property(const char *name) const override
Definition: customelementgraphicpart.h:297
ElementItemEditor::undoStack
virtual QUndoStack & undoStack() const
Definition: elementitemeditor.cpp:44
QET::Icons::East
QIcon East
Definition: qeticons.cpp:61