QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
imagepropertieswidget.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2026 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
24
25namespace Ui {
26 class ImagePropertiesWidget;
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_width_sb_valueChanged(double value);
52 void on_m_height_sb_valueChanged(double value);
53 void on_m_angle_sb_valueChanged(double value);
54 void on_m_skew_x_sb_valueChanged(double value);
55 void on_m_skew_y_sb_valueChanged(double value);
56 void on_m_lock_ratio_tb_toggled(bool checked);
59
60 private:
61 Ui::ImagePropertiesWidget *ui;
64 // All tracked independently -- the image may already be
65 // non-uniformly scaled, rotated, and/or skewed via the resize/
66 // rotate/skew handles before this dialog is even opened, and
67 // undo/reset have to restore each to whatever it actually was.
68 qreal m_scaleX;
69 qreal m_scaleY;
71 qreal m_skewX;
72 qreal m_skewY;
73 // Guards the width/height spinboxes' mutual updates when
74 // "Conserver les proportions" is checked, so setting one
75 // programmatically in response to the other doesn't re-trigger
76 // its own valueChanged and recurse.
77 bool m_updating_ratio = false;
78};
79
80#endif // IMAGEPROPERTIESWIDGET_H
Definition diagramimageitem.h:40
void apply() override
ImagePropertiesWidget::apply Apply the change.
Definition imagepropertieswidget.cpp:84
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:370
ImagePropertiesWidget(DiagramImageItem *image=nullptr, QWidget *parent=nullptr)
ImagePropertiesWidget::ImagePropertiesWidget Constructor.
Definition imagepropertieswidget.cpp:32
~ImagePropertiesWidget() override
ImagePropertiesWidget::~ImagePropertiesWidget Destructor.
Definition imagepropertieswidget.cpp:51
void on_m_width_sb_valueChanged(double value)
ImagePropertiesWidget::on_m_width_sb_valueChanged Applies the new width live, and – if "Conserver les...
Definition imagepropertieswidget.cpp:277
void reset() override
ImagePropertiesWidget::reset Reset the change.
Definition imagepropertieswidget.cpp:110
qreal m_rotation
Definition imagepropertieswidget.h:70
void on_m_restore_ratio_pb_clicked()
ImagePropertiesWidget::on_m_restore_ratio_pb_clicked The same action as the item's own "Restaurer les...
Definition imagepropertieswidget.cpp:256
void on_m_angle_sb_valueChanged(double value)
ImagePropertiesWidget::on_m_angle_sb_valueChanged.
Definition imagepropertieswidget.cpp:340
qreal m_scaleY
Definition imagepropertieswidget.h:69
bool setLiveEdit(bool live_edit) override
ImagePropertiesWidget::setLiveEdit.
Definition imagepropertieswidget.cpp:129
qreal m_skewX
Definition imagepropertieswidget.h:71
void on_m_skew_y_sb_valueChanged(double value)
ImagePropertiesWidget::on_m_skew_y_sb_valueChanged.
Definition imagepropertieswidget.cpp:360
void on_m_lock_ratio_tb_toggled(bool checked)
ImagePropertiesWidget::on_m_lock_ratio_tb_toggled Keeps the button's own icon and tooltip in sync wit...
Definition imagepropertieswidget.cpp:234
qreal m_scaleX
Definition imagepropertieswidget.h:68
DiagramImageItem * m_image
Definition imagepropertieswidget.h:62
bool m_movable
Definition imagepropertieswidget.h:63
void on_m_height_sb_valueChanged(double value)
ImagePropertiesWidget::on_m_height_sb_valueChanged Mirror of on_m_width_sb_valueChanged() – see its c...
Definition imagepropertieswidget.cpp:314
void setImageItem(DiagramImageItem *image)
ImagePropertiesWidget::setImageItem Set the image to edit properties.
Definition imagepropertieswidget.cpp:61
QUndoCommand * associatedUndo() const override
ImagePropertiesWidget::associatedUndo.
Definition imagepropertieswidget.cpp:165
Ui::ImagePropertiesWidget * ui
Definition imagepropertieswidget.h:61
qreal m_skewY
Definition imagepropertieswidget.h:72
void on_m_skew_x_sb_valueChanged(double value)
ImagePropertiesWidget::on_m_skew_x_sb_valueChanged.
Definition imagepropertieswidget.cpp:350
bool m_updating_ratio
Definition imagepropertieswidget.h:77
void updateUi() override
ImagePropertiesWidget::updateUi Udpdate the ui, notably when the image to edit change.
Definition imagepropertieswidget.cpp:201
PropertiesEditorWidget(QWidget *parent=nullptr)
PropertiesEditorWidget::PropertiesEditorWidget Constructor.
Definition propertieseditorwidget.cpp:26
Definition autonumberingdockwidget.h:30