QElectroTech  0.8-dev
rectangleeditor.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 RECTANGLEEDITOR_H
19 #define RECTANGLEEDITOR_H
20 
21 #include "elementitemeditor.h"
22 #include <QWidget>
23 
24 class StyleEditor;
25 class PartRectangle;
26 
27 namespace Ui {
28  class RectangleEditor;
29 }
30 
36 {
37  Q_OBJECT
38 
39  public:
40  explicit RectangleEditor(QETElementEditor *editor, PartRectangle *rect = nullptr, QWidget *parent = nullptr);
41  ~RectangleEditor() override;
42 
43  bool setPart(CustomElementPart *part) override;
44  bool setParts(QList <CustomElementPart *> parts) override;
45  CustomElementPart *currentPart() const override;
46  QList<CustomElementPart*> currentParts() const override;
47  QPointF editedTopLeft () const;
48 
49  public slots:
50  void updateForm() override;
51  private:
52  void editingFinished();
53  void activeConnections(bool active);
54  void xPosChanged();
55  void yPosChanged();
56  void widthChanged();
57  void heightChanged();
58  void xRadiusChanged();
59  void yRadiusChanged();
66 
67  private:
68  bool m_locked = false;
71  Ui::RectangleEditor *ui;
72  QList <QMetaObject::Connection> m_change_connections;
73 };
74 
75 #endif // RECTANGLEEDITOR_H
elementitemeditor.h
RectangleEditor::widthChanged
void widthChanged()
Definition: rectangleeditor.cpp:243
QPropertyUndoCommand::enableAnimation
void enableAnimation(bool animate=true)
QPropertyUndoCommand::enableAnimation True to enable animation.
Definition: qpropertyundocommand.cpp:92
styleeditor.h
RectangleEditor::editedTopLeft
QPointF editedTopLeft() const
RectangleEditor::topLeft.
Definition: rectangleeditor.cpp:127
StyleEditor::currentParts
QList< CustomElementPart * > currentParts() const override
Definition: styleeditor.cpp:543
ElementScene::undoStack
QUndoStack & undoStack()
ElementScene::undoStack.
Definition: elementscene.cpp:603
RectangleEditor::m_part
PartRectangle * m_part
Definition: rectangleeditor.h:70
PartRectangle::YRadiusChanged
void YRadiusChanged()
PartRectangle::XRadiusChanged
void XRadiusChanged()
RectangleEditor::setParts
bool setParts(QList< CustomElementPart * > parts) override
Definition: rectangleeditor.cpp:101
rectangleeditor.h
RectangleEditor::activeConnections
void activeConnections(bool active)
RectangleEditor::activeConnections Enable/disable connection between editor widget and slot editingFi...
Definition: rectangleeditor.cpp:348
RectangleEditor::currentPart
CustomElementPart * currentPart() const override
RectangleEditor::currentPart.
Definition: rectangleeditor.cpp:115
RectangleEditor::~RectangleEditor
~RectangleEditor() override
RectangleEditor::~RectangleEditor.
Definition: rectangleeditor.cpp:45
PartRectangle::YRadius
qreal YRadius() const
Definition: partrectangle.h:70
RectangleEditor::ui
Ui::RectangleEditor * ui
Definition: rectangleeditor.h:71
RectangleEditor::heightChanged
void heightChanged()
Definition: rectangleeditor.cpp:269
RectangleEditor::m_change_connections
QList< QMetaObject::Connection > m_change_connections
Definition: rectangleeditor.h:72
RectangleEditor::currentParts
QList< CustomElementPart * > currentParts() const override
Definition: rectangleeditor.cpp:119
StyleEditor
Definition: styleeditor.h:35
ElementItemEditor
Definition: elementitemeditor.h:34
RectangleEditor::m_locked
bool m_locked
Definition: rectangleeditor.h:68
qeticons.h
RectangleEditor::xRadiusChanged
void xRadiusChanged()
Definition: rectangleeditor.cpp:295
RectangleEditor::yRadiusChanged
void yRadiusChanged()
Definition: rectangleeditor.cpp:318
ElementItemEditor::elementScene
virtual ElementScene * elementScene() const
Definition: elementitemeditor.cpp:39
PartRectangle::rectChanged
void rectChanged()
RectangleEditor
The RectangleEditor class This class provides a widget to edit rectangles within the element editor.
Definition: rectangleeditor.h:36
RectangleEditor::xPosChanged
void xPosChanged()
Definition: rectangleeditor.cpp:191
PartRectangle::XRadius
qreal XRadius() const
Definition: partrectangle.h:68
partrectangle.h
elementscene.h
qpropertyundocommand.h
RectangleEditor::disconnectChangeConnections
void disconnectChangeConnections()
Definition: rectangleeditor.cpp:58
RectangleEditor::RectangleEditor
RectangleEditor(QETElementEditor *editor, PartRectangle *rect=nullptr, QWidget *parent=nullptr)
RectangleEditor::RectangleEditor.
Definition: rectangleeditor.cpp:32
PartRectangle::rect
QRectF rect
Definition: partrectangle.h:34
QPropertyUndoCommand::setAnimated
void setAnimated(bool animate=true, bool first_time=true)
QPropertyUndoCommand::setAnimated.
Definition: qpropertyundocommand.cpp:103
RectangleEditor::setPart
bool setPart(CustomElementPart *part) override
RectangleEditor::setPart.
Definition: rectangleeditor.cpp:71
Ui
Definition: autonumberingdockwidget.h:25
RectangleEditor::editingFinished
void editingFinished()
RectangleEditor::editingFinished Slot called when a editor widget is finish to be edited Update the g...
Definition: rectangleeditor.cpp:160
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
RectangleEditor::setUpChangeConnections
void setUpChangeConnections()
setUpChangeConnections Setup the connection from the rectangles(s) to the widget, to update it when t...
Definition: rectangleeditor.cpp:49
PartRectangle
Definition: partrectangle.h:31
CustomElementPart
The CustomElementPart class This abstract class represents a primitive of the visual representation o...
Definition: customelementpart.h:40
RectangleEditor::m_style
StyleEditor * m_style
Definition: rectangleeditor.h:69
RectangleEditor::updateForm
void updateForm() override
RectangleEditor::updateForm.
Definition: rectangleeditor.cpp:134
RectangleEditor::yPosChanged
void yPosChanged()
Definition: rectangleeditor.cpp:217
QPropertyUndoCommand
The QPropertyUndoCommand class This undo command manage QProperty of a QObject. This undo command can...
Definition: qpropertyundocommand.h:34
QET::Icons::tr
QIcon tr
Definition: qeticons.cpp:206
QETElementEditor
Definition: qetelementeditor.h:33
CustomElementGraphicPart::property
QVariant property(const char *name) const override
Definition: customelementgraphicpart.h:297