QElectroTech  0.70
imagepropertieswidget.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 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
The ImagePropertiesWidget class This class provide a widget to edit the propertie of a DiagramImageIt...
void updateUi() override
ImagePropertiesWidget::updateUi Udpdate the ui, notably when the image to edit change.
void setImageItem(DiagramImageItem *image)
ImagePropertiesWidget::setImageItem Set the image to edit properties.
The PropertiesEditorWidget class This class extend QWidget method for have common way to edit propert...
void on_m_lock_pos_cb_clicked()
ImagePropertiesWidget::on_m_lock_pos_cb_clicked Set movable or not the image according to correspondi...
DiagramImageItem * m_image
void reset() override
ImagePropertiesWidget::reset Reset the change.
~ImagePropertiesWidget() override
ImagePropertiesWidget::~ImagePropertiesWidget Destructor.
bool setLiveEdit(bool live_edit) override
ImagePropertiesWidget::setLiveEdit.
Ui::ImagePropertiesWidget * ui
ImagePropertiesWidget(DiagramImageItem *image=nullptr, QWidget *parent=nullptr)
ImagePropertiesWidget::ImagePropertiesWidget Constructor.
void apply() override
ImagePropertiesWidget::apply Apply the change.
QUndoCommand * associatedUndo() const override
ImagePropertiesWidget::associatedUndo.
void on_m_scale_slider_valueChanged(int value)
ImagePropertiesWidget::on_m_scale_slider_valueChanged Update the size of image when move slider...