QElectroTech  0.8-dev
imagepropertieswidget.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 IMAGEPROPERTIESWIDGET_H
19 #define IMAGEPROPERTIESWIDGET_H
20 
22 
23 class DiagramImageItem;
24 
25 namespace Ui {
27 }
28 
34 {
35  Q_OBJECT
36 
37  public:
38  explicit ImagePropertiesWidget(DiagramImageItem *image = nullptr, QWidget *parent = nullptr);
39  ~ImagePropertiesWidget() override;
40  void setImageItem (DiagramImageItem *image);
41 
42  void apply() override;
43  void reset() override;
44  bool setLiveEdit(bool live_edit) override;
45  QUndoCommand* associatedUndo() const override;
46 
47  private:
48  void updateUi() override;
49 
50  private slots:
51  void on_m_scale_slider_valueChanged(int value);
53 
54  private:
55  Ui::ImagePropertiesWidget *ui;
57  bool m_movable;
58  qreal m_scale;
59 };
60 
61 #endif // IMAGEPROPERTIESWIDGET_H
QPropertyUndoCommand::enableAnimation
void enableAnimation(bool animate=true)
QPropertyUndoCommand::enableAnimation True to enable animation.
Definition: qpropertyundocommand.cpp:92
ImagePropertiesWidget::on_m_scale_slider_valueChanged
void on_m_scale_slider_valueChanged(int value)
ImagePropertiesWidget::on_m_scale_slider_valueChanged Update the size of image when move slider.
Definition: imagepropertieswidget.cpp:161
PropertiesEditorWidget
The PropertiesEditorWidget class This class extend QWidget method for have common way to edit propert...
Definition: propertieseditorwidget.h:31
PropertiesEditorWidget::m_live_edit
bool m_live_edit
Definition: propertieseditorwidget.h:50
QetGraphicsItem::diagram
Diagram * diagram() const
Definition: qetgraphicsitem.cpp:40
ImagePropertiesWidget::apply
void apply() override
ImagePropertiesWidget::apply Apply the change.
Definition: imagepropertieswidget.cpp:72
ImagePropertiesWidget::setImageItem
void setImageItem(DiagramImageItem *image)
ImagePropertiesWidget::setImageItem Set the image to edit properties.
Definition: imagepropertieswidget.cpp:53
ImagePropertiesWidget::ImagePropertiesWidget
ImagePropertiesWidget(DiagramImageItem *image=nullptr, QWidget *parent=nullptr)
ImagePropertiesWidget::ImagePropertiesWidget Constructor.
Definition: imagepropertieswidget.cpp:30
ImagePropertiesWidget::m_scale
qreal m_scale
Definition: imagepropertieswidget.h:58
QetGraphicsItem::setMovable
virtual void setMovable(bool movable)
Definition: qetgraphicsitem.h:41
ImagePropertiesWidget::ui
Ui::ImagePropertiesWidget * ui
Definition: imagepropertieswidget.h:55
ImagePropertiesWidget::setLiveEdit
bool setLiveEdit(bool live_edit) override
ImagePropertiesWidget::setLiveEdit.
Definition: imagepropertieswidget.cpp:109
DiagramImageItem
Definition: diagramimageitem.h:31
ImagePropertiesWidget
The ImagePropertiesWidget class This class provide a widget to edit the propertie of a DiagramImageIt...
Definition: imagepropertieswidget.h:34
ImagePropertiesWidget::updateUi
void updateUi() override
ImagePropertiesWidget::updateUi Udpdate the ui, notably when the image to edit change.
Definition: imagepropertieswidget.cpp:149
imagepropertieswidget.h
propertieseditorwidget.h
ImagePropertiesWidget::m_movable
bool m_movable
Definition: imagepropertieswidget.h:57
qpropertyundocommand.h
Diagram::undoStack
QUndoStack & undoStack()
Diagram::undoStack.
Definition: diagram.h:397
ImagePropertiesWidget::reset
void reset() override
ImagePropertiesWidget::reset Reset the change.
Definition: imagepropertieswidget.cpp:94
ImagePropertiesWidget::associatedUndo
QUndoCommand * associatedUndo() const override
ImagePropertiesWidget::associatedUndo.
Definition: imagepropertieswidget.cpp:133
Ui
Definition: autonumberingdockwidget.h:25
ImagePropertiesWidget::~ImagePropertiesWidget
~ImagePropertiesWidget() override
ImagePropertiesWidget::~ImagePropertiesWidget Destructor.
Definition: imagepropertieswidget.cpp:44
QPropertyUndoCommand
The QPropertyUndoCommand class This undo command manage QProperty of a QObject. This undo command can...
Definition: qpropertyundocommand.h:34
diagramimageitem.h
QetGraphicsItem::isMovable
virtual bool isMovable() const
Definition: qetgraphicsitem.h:40
QET::Icons::tr
QIcon tr
Definition: qeticons.cpp:206
ImagePropertiesWidget::m_image
DiagramImageItem * m_image
Definition: imagepropertieswidget.h:56
diagram.h
ImagePropertiesWidget::on_m_lock_pos_cb_clicked
void on_m_lock_pos_cb_clicked()
ImagePropertiesWidget::on_m_lock_pos_cb_clicked Set movable or not the image according to correspondi...
Definition: imagepropertieswidget.cpp:171