QElectroTech  0.70
arceditor.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 ARC_EDITOR_H
19 #define ARC_EDITOR_H
20 
21 #include "elementitemeditor.h"
22 
23 class PartArc;
24 class StyleEditor;
25 class QDoubleSpinBox;
26 class QSpinBox;
27 
32 {
33  Q_OBJECT
34 
35  // constructors, destructor
36  public:
37  ArcEditor(QETElementEditor *, PartArc * = nullptr, QWidget * = nullptr);
38  ~ArcEditor() override;
39  private:
40  ArcEditor(const ArcEditor &);
41 
42  // attributes
43  private:
46  QDoubleSpinBox *x, *y, *h, *v;
47  QSpinBox *angle, *start_angle;
48  bool m_locked;
49 
50  // methods
51  public:
52  bool setPart(CustomElementPart *) override;
53  CustomElementPart *currentPart() const override;
54 
55  public slots:
56  void updateArcS();
57  void updateArcA();
58  void updateArcRect();
59  void updateForm() override;
60 
61  private:
62  void activeConnections(bool);
63 };
64 #endif
QSpinBox * angle
Definition: arceditor.h:47
bool setPart(CustomElementPart *) override
ArcEditor::setPart Specifie to this editor the part to edit. Note that an editor can accept or refuse...
Definition: arceditor.cpp:87
StyleEditor * style_
Definition: arceditor.h:45
QDoubleSpinBox * h
Definition: arceditor.h:46
ArcEditor(QETElementEditor *, PartArc *=nullptr, QWidget *=nullptr)
Definition: arceditor.cpp:30
void updateArcA()
ArcEditor::updateArcA Update the span angle of the arc according to the edited value.
Definition: arceditor.cpp:156
QDoubleSpinBox * x
Definition: arceditor.h:46
PartArc * part
Definition: arceditor.h:44
void updateForm() override
ArcEditor::updateForm Update the value of the widgets.
Definition: arceditor.cpp:199
QDoubleSpinBox * v
Definition: arceditor.h:46
QSpinBox * start_angle
Definition: arceditor.h:47
void updateArcS()
ArcEditor::updateArcS Update the start angle of the arc according to the edited value.
Definition: arceditor.cpp:135
void activeConnections(bool)
ArcEditor::activeConnections Enable/disable connection between editor widget and slot editingFinished...
Definition: arceditor.cpp:219
~ArcEditor() override
Destructeur.
Definition: arceditor.cpp:78
bool m_locked
Definition: arceditor.h:48
void updateArcRect()
ArcEditor::updateArcRect Update the geometrie of the rect that define this arc according the the edit...
Definition: arceditor.cpp:177
The PartArc class This class represents an elliptical arc primitive which may be used to compose the ...
Definition: partarc.h:31
QDoubleSpinBox * y
Definition: arceditor.h:46
CustomElementPart * currentPart() const override
ArcEditor::currentPart.
Definition: arceditor.cpp:127