QElectroTech  0.70
lineeditor.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 LINE_EDITOR_H
19 #define LINE_EDITOR_H
20 
21 #include "elementitemeditor.h"
22 
23 class PartLine;
24 class StyleEditor;
25 class QComboBox;
26 class QDoubleSpinBox;
27 
32 {
33  Q_OBJECT
34  // constructors, destructor
35  public:
36  LineEditor(QETElementEditor *, PartLine * = nullptr, QWidget * = nullptr);
37  ~LineEditor() override;
38  private:
39  LineEditor(const LineEditor &);
40 
41  // attributes
42  private:
45  QDoubleSpinBox *x1, *y1, *x2, *y2;
46  QComboBox *end1_type, *end2_type;
47  QDoubleSpinBox*end1_length, *end2_length;
48  bool m_locked;
49 
50  // methods
51  public:
52  bool setPart(CustomElementPart *) override;
53  CustomElementPart *currentPart() const override;
54  QPointF editedP1() const;
55  QPointF editedP2() const;
56 
57  public slots:
58  void updateLineEndType1();
59  void updateLineEndLength1();
60  void updateLineEndType2();
61  void updateLineEndLength2();
62  void lineEditingFinished();
63  void updateForm() override;
64 
65  private:
66  void activeConnections(bool);
67 };
68 #endif
~LineEditor() override
Destructeur.
Definition: lineeditor.cpp:92
void updateForm() override
LineEditor::updateForm Update the value of the widgets.
Definition: lineeditor.cpp:251
void activeConnections(bool)
LineEditor::activeConnections Enable/disable connection between editor widget and slot editingFinishe...
Definition: lineeditor.cpp:274
CustomElementPart * currentPart() const override
Definition: lineeditor.cpp:145
void updateLineEndType2()
Met a jour le type de la seconde extremite.
Definition: lineeditor.cpp:199
QDoubleSpinBox * y2
Definition: lineeditor.h:45
QDoubleSpinBox * x2
Definition: lineeditor.h:45
void lineEditingFinished()
Definition: lineeditor.cpp:231
QDoubleSpinBox * x1
Definition: lineeditor.h:45
LineEditor(QETElementEditor *, PartLine *=nullptr, QWidget *=nullptr)
Definition: lineeditor.cpp:32
QDoubleSpinBox * end1_length
Definition: lineeditor.h:47
QComboBox * end2_type
Definition: lineeditor.h:46
QPointF editedP1() const
LineEditor::editedP1.
Definition: lineeditor.cpp:153
QComboBox * end1_type
Definition: lineeditor.h:46
bool setPart(CustomElementPart *) override
LineEditor::setPart Specifie to this editor the part to edit. Note that an editor can accept or refus...
Definition: lineeditor.cpp:102
QDoubleSpinBox * y1
Definition: lineeditor.h:45
QPointF editedP2() const
LineEditor::editedP2.
Definition: lineeditor.cpp:161
QDoubleSpinBox * end2_length
Definition: lineeditor.h:47
void updateLineEndLength1()
Met a jour la longueur de la premiere extremite.
Definition: lineeditor.cpp:182
void updateLineEndLength2()
Met a jour la longueur de la seconde extremite.
Definition: lineeditor.cpp:215
PartLine * part
Definition: lineeditor.h:43
bool m_locked
Definition: lineeditor.h:48
void updateLineEndType1()
Met a jour le type de la premiere extremite.
Definition: lineeditor.cpp:166
StyleEditor * style_
Definition: lineeditor.h:44