QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
arceditor.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2024 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
23class PartArc;
24class StyleEditor;
25class QDoubleSpinBox;
26class QSpinBox;
27
32{
33 Q_OBJECT
34
35 // constructors, destructor
36 public:
37 ArcEditor(QETElementEditor *, PartArc * = nullptr, QWidget * = nullptr);
38 ~ArcEditor() override;
39 private:
41
42 // attributes
43 private:
46 QDoubleSpinBox *x, *y, *h, *v;
47 QSpinBox *angle, *start_angle;
49
50 QList <QMetaObject::Connection> m_change_connections;
51
52 // methods
53 public:
54 bool setPart(CustomElementPart *) override;
55 bool setParts(QList <CustomElementPart *> parts) override;
56 CustomElementPart *currentPart() const override;
57 QList<CustomElementPart*> currentParts() const override;
58
59 public slots:
60 void updateArcS();
61 void updateArcA();
62 void updateForm() override;
63 void updateRect();
64
65 private:
66 void activeConnections(bool);
74};
75#endif
Definition arceditor.h:32
void activeConnections(bool)
ArcEditor::activeConnections Enable/disable connection between editor widget and slot editingFinished...
Definition arceditor.cpp:256
CustomElementPart * currentPart() const override
ArcEditor::currentPart.
Definition arceditor.cpp:148
void updateForm() override
ArcEditor::updateForm Update the value of the widgets.
Definition arceditor.cpp:213
ArcEditor(const ArcEditor &)
QDoubleSpinBox * v
Definition arceditor.h:46
QDoubleSpinBox * x
Definition arceditor.h:46
void updateArcA()
ArcEditor::updateArcA Update the span angle of the arc according to the edited value.
Definition arceditor.cpp:188
void updateRect()
Definition arceditor.cpp:227
QDoubleSpinBox * h
Definition arceditor.h:46
QList< QMetaObject::Connection > m_change_connections
Definition arceditor.h:50
QSpinBox * angle
Definition arceditor.h:47
bool m_locked
Definition arceditor.h:48
bool setParts(QList< CustomElementPart * > parts) override
Definition arceditor.cpp:134
PartArc * m_part
Definition arceditor.h:44
QDoubleSpinBox * y
Definition arceditor.h:46
void updateArcS()
ArcEditor::updateArcS Update the start angle of the arc according to the edited value.
Definition arceditor.cpp:162
QList< CustomElementPart * > currentParts() const override
Definition arceditor.cpp:153
void setUpChangeConnections()
setUpChangeConnections Setup the connection from the arc(s) to the widget, to update it when the arc(...
Definition arceditor.cpp:82
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:109
QSpinBox * start_angle
Definition arceditor.h:47
void disconnectChangeConnections()
Definition arceditor.cpp:94
~ArcEditor() override
Destructeur.
Definition arceditor.cpp:79
StyleEditor * m_style
Definition arceditor.h:45
The CustomElementPart class This abstract class represents a primitive of the visual representation o...
Definition customelementpart.h:40
Definition elementitemeditor.h:34
The PartArc class This class represents an elliptical arc primitive which may be used to compose the ...
Definition partarc.h:32
Definition qetelementeditor.h:39
Definition styleeditor.h:35