QElectroTech  0.70
shapegraphicsitempropertieswidget.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 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
QList< QMetaObject::Connection > m_connect_list
ShapeGraphicsItemPropertiesWidget(QetShapeItem *item, QWidget *parent=nullptr)
ShapeGraphicsItemPropertiesWidget::ShapeGraphicsItemPropertiesWidget Constructor. ...
void setItems(QList< QetShapeItem *> shapes_list)
ShapeGraphicsItemPropertiesWidget::setItems Set a list of shapes to be edited.
bool setLiveEdit(bool live_edit) override
ShapeGraphicsItemPropertiesWidget::setLiveEdit.
QUndoCommand * associatedUndo() const override
ShapeGraphicsItemPropertiesWidget::associatedUndo.
QList< QMetaObject::Connection > m_edit_connection
The PropertiesEditorWidget class This class extend QWidget method for have common way to edit propert...
The ShapeGraphicsItemPropertiesWidget class Provide a widget to edit the properties of a QetShapeItem...
~ShapeGraphicsItemPropertiesWidget() override
ShapeGraphicsItemPropertiesWidget::~ShapeGraphicsItemPropertiesWidget Destructor. ...
QString title() const override
PropertiesEditorWidget::title.
Ui::ShapeGraphicsItemPropertiesWidget * ui
QIcon tr
Definition: qeticons.cpp:204
void updateUi() override
ShapeGraphicsItemPropertiesWidget::updateUi.
void reset() override
ShapeGraphicsItemPropertiesWidget::reset Reset the change.
void setUpEditConnection()
ShapeGraphicsItemPropertiesWidget::setUpEditConnection Disconnect the previous connection, and reconnect the connection between the editors widgets and void ShapeGraphicsItemPropertiesWidget::apply function.
QList< QPointer< QetShapeItem > > m_shapes_list
The QetShapeItem class this class is used to draw a basic shape (line, rectangle, ellipse) into a dia...
Definition: qetshapeitem.h:35
void setItem(QetShapeItem *shape)
ShapeGraphicsItemPropertiesWidget::setItem Set as the current edited item.
void apply() override
ShapeGraphicsItemPropertiesWidget::apply Apply the current change, by pushing an undo command to the ...