QElectroTech  0.8-dev
arceditor.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 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  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 updateArcRectX();
63  void updateArcRectY();
64  void updateArcRectH();
65  void updateArcRectV();
66  void updateForm() override;
67 
68  private:
69  void activeConnections(bool);
77 };
78 #endif
ArcEditor::m_change_connections
QList< QMetaObject::Connection > m_change_connections
Definition: arceditor.h:50
elementitemeditor.h
QPropertyUndoCommand::enableAnimation
void enableAnimation(bool animate=true)
QPropertyUndoCommand::enableAnimation True to enable animation.
Definition: qpropertyundocommand.cpp:92
ArcEditor::updateArcA
void updateArcA()
ArcEditor::updateArcA Update the span angle of the arc according to the edited value.
Definition: arceditor.cpp:181
styleeditor.h
ArcEditor::style_
StyleEditor * style_
Definition: arceditor.h:45
ArcEditor::ArcEditor
ArcEditor(QETElementEditor *, PartArc *=nullptr, QWidget *=nullptr)
Definition: arceditor.cpp:30
StyleEditor::currentParts
QList< CustomElementPart * > currentParts() const override
Definition: styleeditor.cpp:543
ElementScene::undoStack
QUndoStack & undoStack()
ElementScene::undoStack.
Definition: elementscene.cpp:603
ArcEditor::~ArcEditor
~ArcEditor() override
Destructeur.
Definition: arceditor.cpp:78
ArcEditor::y
QDoubleSpinBox * y
Definition: arceditor.h:46
ArcEditor::currentParts
QList< CustomElementPart * > currentParts() const override
Definition: arceditor.cpp:147
ArcEditor::updateArcS
void updateArcS()
ArcEditor::updateArcS Update the start angle of the arc according to the edited value.
Definition: arceditor.cpp:155
ArcEditor::x
QDoubleSpinBox * x
Definition: arceditor.h:46
ArcEditor
Definition: arceditor.h:32
arceditor.h
ArcEditor::h
QDoubleSpinBox * h
Definition: arceditor.h:46
PartArc
The PartArc class This class represents an elliptical arc primitive which may be used to compose the ...
Definition: partarc.h:32
ArcEditor::setUpChangeConnections
void setUpChangeConnections()
setUpChangeConnections Setup the connection from the arc(s) to the widget, to update it when the arc(...
Definition: arceditor.cpp:80
ArcEditor::updateForm
void updateForm() override
ArcEditor::updateForm Update the value of the widgets.
Definition: arceditor.cpp:306
ArcEditor::setPart
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:104
StyleEditor
Definition: styleeditor.h:35
ArcEditor::part
PartArc * part
Definition: arceditor.h:44
ElementItemEditor
Definition: elementitemeditor.h:34
ArcEditor::angle
QSpinBox * angle
Definition: arceditor.h:47
partarc.h
AbstractPartEllipse::startAngleChanged
void startAngleChanged()
ElementItemEditor::elementScene
virtual ElementScene * elementScene() const
Definition: elementitemeditor.cpp:39
ArcEditor::v
QDoubleSpinBox * v
Definition: arceditor.h:46
ArcEditor::currentPart
CustomElementPart * currentPart() const override
ArcEditor::currentPart.
Definition: arceditor.cpp:143
ArcEditor::updateArcRectH
void updateArcRectH()
Definition: arceditor.cpp:256
ArcEditor::updateArcRectV
void updateArcRectV()
Definition: arceditor.cpp:279
elementscene.h
qpropertyundocommand.h
ArcEditor::ArcEditor
ArcEditor(const ArcEditor &)
StyleEditor::setParts
bool setParts(QList< CustomElementPart * >) override
StyleEditor::setParts Set several parts to edit by this editor. Note : editor can accept or refuse to...
Definition: styleeditor.cpp:510
AbstractPartEllipse::rectChanged
void rectChanged()
ArcEditor::start_angle
QSpinBox * start_angle
Definition: arceditor.h:47
CustomElementPart
The CustomElementPart class This abstract class represents a primitive of the visual representation o...
Definition: customelementpart.h:40
ArcEditor::disconnectChangeConnections
void disconnectChangeConnections()
Definition: arceditor.cpp:89
AbstractPartEllipse::spanAngleChanged
void spanAngleChanged()
QPropertyUndoCommand
The QPropertyUndoCommand class This undo command manage QProperty of a QObject. This undo command can...
Definition: qpropertyundocommand.h:34
ArcEditor::m_locked
bool m_locked
Definition: arceditor.h:48
ArcEditor::activeConnections
void activeConnections(bool)
ArcEditor::activeConnections Enable/disable connection between editor widget and slot editingFinished...
Definition: arceditor.cpp:326
QET::Icons::tr
QIcon tr
Definition: qeticons.cpp:206
ArcEditor::setParts
bool setParts(QList< CustomElementPart * > parts) override
Definition: arceditor.cpp:129
QETElementEditor
Definition: qetelementeditor.h:33
ArcEditor::updateArcRectX
void updateArcRectX()
ArcEditor::updateArcRect Update the geometrie of the rect that define this arc according the the edit...
Definition: arceditor.cpp:206
CustomElementGraphicPart::property
QVariant property(const char *name) const override
Definition: customelementgraphicpart.h:297
ArcEditor::updateArcRectY
void updateArcRectY()
Definition: arceditor.cpp:230