QElectroTech  0.8-dev
shapegraphicsitempropertieswidget.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 SHAPEGRAPHICSITEMPROPERTIESWIDGET_H
19 #define SHAPEGRAPHICSITEMPROPERTIESWIDGET_H
20 
22 
23 namespace Ui {
25 }
26 
27 class QetShapeItem;
28 
34 {
35  Q_OBJECT
36 
37  public:
38  explicit ShapeGraphicsItemPropertiesWidget(QetShapeItem *item, QWidget *parent = nullptr);
39  ShapeGraphicsItemPropertiesWidget(QList<QetShapeItem *> items_list, QWidget *parent =nullptr);
41 
42  void setItem(QetShapeItem *shape);
43  void setItems(QList<QetShapeItem *> shapes_list);
44 
45  public slots:
46  void apply() override;
47  void reset() override;
48  public:
49  QUndoCommand* associatedUndo() const override;
50  QString title() const override { return tr("Éditer les propriétés d'une primitive "); }
51  void updateUi() override;
52  bool setLiveEdit(bool live_edit) override;
53 
54  private:
55  void setUpEditConnection();
56 
57  private slots:
59  void on_m_color_kpb_changed(const QColor &newColor);
60  void on_m_brush_color_kpb_changed(const QColor &newColor);
61 
62  private:
63  Ui::ShapeGraphicsItemPropertiesWidget *ui;
65  QList <QPointer<QetShapeItem>> m_shapes_list;
66  QList <QMetaObject::Connection> m_connect_list,
68 };
69 
70 #endif // SHAPEGRAPHICSITEMPROPERTIESWIDGET_H
ShapeGraphicsItemPropertiesWidget::setLiveEdit
bool setLiveEdit(bool live_edit) override
ShapeGraphicsItemPropertiesWidget::setLiveEdit.
Definition: shapegraphicsitempropertieswidget.cpp:462
ShapeGraphicsItemPropertiesWidget::on_m_color_kpb_changed
void on_m_color_kpb_changed(const QColor &newColor)
Definition: shapegraphicsitempropertieswidget.cpp:516
ShapeGraphicsItemPropertiesWidget::on_m_brush_color_kpb_changed
void on_m_brush_color_kpb_changed(const QColor &newColor)
Definition: shapegraphicsitempropertieswidget.cpp:523
ShapeGraphicsItemPropertiesWidget::setItem
void setItem(QetShapeItem *shape)
ShapeGraphicsItemPropertiesWidget::setItem Set shape as the current edited item.
Definition: shapegraphicsitempropertieswidget.cpp:61
ShapeGraphicsItemPropertiesWidget::~ShapeGraphicsItemPropertiesWidget
~ShapeGraphicsItemPropertiesWidget() override
ShapeGraphicsItemPropertiesWidget::~ShapeGraphicsItemPropertiesWidget Destructor.
Definition: shapegraphicsitempropertieswidget.cpp:51
QetShapeItem::shapeType
ShapeType shapeType() const
Definition: qetshapeitem.h:77
ShapeGraphicsItemPropertiesWidget::associatedUndo
QUndoCommand * associatedUndo() const override
ShapeGraphicsItemPropertiesWidget::associatedUndo.
Definition: shapegraphicsitempropertieswidget.cpp:167
PropertiesEditorWidget
The PropertiesEditorWidget class This class extend QWidget method for have common way to edit propert...
Definition: propertieseditorwidget.h:31
QetShapeItem::penChanged
void penChanged()
PropertiesEditorWidget::m_live_edit
bool m_live_edit
Definition: propertieseditorwidget.h:50
ShapeGraphicsItemPropertiesWidget::setItems
void setItems(QList< QetShapeItem * > shapes_list)
ShapeGraphicsItemPropertiesWidget::setItems Set a list of shapes to be edited.
Definition: shapegraphicsitempropertieswidget.cpp:95
QetGraphicsItem::diagram
Diagram * diagram() const
Definition: qetgraphicsitem.cpp:40
ShapeGraphicsItemPropertiesWidget::title
QString title() const override
PropertiesEditorWidget::title.
Definition: shapegraphicsitempropertieswidget.h:50
QetGraphicsItem::setMovable
virtual void setMovable(bool movable)
Definition: qetgraphicsitem.h:41
QetShapeItem::isClosed
bool isClosed() const
Definition: qetshapeitem.h:93
shapegraphicsitempropertieswidget.h
QetShapeItem::brushChanged
void brushChanged()
ShapeGraphicsItemPropertiesWidget::setUpEditConnection
void setUpEditConnection()
ShapeGraphicsItemPropertiesWidget::setUpEditConnection Disconnect the previous connection,...
Definition: shapegraphicsitempropertieswidget.cpp:486
ShapeGraphicsItemPropertiesWidget
The ShapeGraphicsItemPropertiesWidget class Provide a widget to edit the properties of a QetShapeItem...
Definition: shapegraphicsitempropertieswidget.h:34
QetShapeItem::brush
QBrush brush
Definition: qetshapeitem.h:40
Diagram
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition: diagram.h:56
propertieseditorwidget.h
ShapeGraphicsItemPropertiesWidget::m_edit_connection
QList< QMetaObject::Connection > m_edit_connection
Definition: shapegraphicsitempropertieswidget.h:67
ShapeGraphicsItemPropertiesWidget::m_shapes_list
QList< QPointer< QetShapeItem > > m_shapes_list
Definition: shapegraphicsitempropertieswidget.h:65
QetShapeItem::Polygon
@ Polygon
Definition: qetshapeitem.h:60
qpropertyundocommand.h
Diagram::undoStack
QUndoStack & undoStack()
Diagram::undoStack.
Definition: diagram.h:397
ShapeGraphicsItemPropertiesWidget::ShapeGraphicsItemPropertiesWidget
ShapeGraphicsItemPropertiesWidget(QetShapeItem *item, QWidget *parent=nullptr)
ShapeGraphicsItemPropertiesWidget::ShapeGraphicsItemPropertiesWidget Constructor.
Definition: shapegraphicsitempropertieswidget.cpp:30
ShapeGraphicsItemPropertiesWidget::apply
void apply() override
ShapeGraphicsItemPropertiesWidget::apply Apply the current change, by pushing an undo command to the ...
Definition: shapegraphicsitempropertieswidget.cpp:126
Ui
Definition: autonumberingdockwidget.h:25
ShapeGraphicsItemPropertiesWidget::updateUi
void updateUi() override
ShapeGraphicsItemPropertiesWidget::updateUi.
Definition: shapegraphicsitempropertieswidget.cpp:362
ShapeGraphicsItemPropertiesWidget::on_m_lock_pos_cb_clicked
void on_m_lock_pos_cb_clicked()
Definition: shapegraphicsitempropertieswidget.cpp:504
ShapeGraphicsItemPropertiesWidget::reset
void reset() override
ShapeGraphicsItemPropertiesWidget::reset Reset the change.
Definition: shapegraphicsitempropertieswidget.cpp:157
ShapeGraphicsItemPropertiesWidget::m_shape
QetShapeItem * m_shape
Definition: shapegraphicsitempropertieswidget.h:64
QetShapeItem::Line
@ Line
Definition: qetshapeitem.h:57
QetShapeItem::closeChanged
void closeChanged()
QetShapeItem
The QetShapeItem class this class is used to draw a basic shape (line, rectangle, ellipse) into a dia...
Definition: qetshapeitem.h:36
qetshapeitem.h
ShapeGraphicsItemPropertiesWidget::m_connect_list
QList< QMetaObject::Connection > m_connect_list
Definition: shapegraphicsitempropertieswidget.h:66
QPropertyUndoCommand
The QPropertyUndoCommand class This undo command manage QProperty of a QObject. This undo command can...
Definition: qpropertyundocommand.h:34
QetShapeItem::pen
QPen pen
Definition: qetshapeitem.h:39
QetGraphicsItem::isMovable
virtual bool isMovable() const
Definition: qetgraphicsitem.h:40
QET::Icons::tr
QIcon tr
Definition: qeticons.cpp:206
diagram.h
ShapeGraphicsItemPropertiesWidget::ui
Ui::ShapeGraphicsItemPropertiesWidget * ui
Definition: shapegraphicsitempropertieswidget.h:63