19 #include "ui_rectangleeditor.h" 39 ui->verticalLayout->insertWidget(0,
m_style);
71 if (
PartRectangle *part_rectangle = dynamic_cast<PartRectangle *>(part))
73 if (
m_part == part_rectangle) {
111 return m_part->mapFromScene(
ui->m_x_sb->value(),
ui->m_y_sb->value());
125 QPointF p =
m_part->mapToScene(rect.topLeft());
126 ui->m_x_sb->setValue(p.x());
127 ui->m_y_sb->setValue(p.y());
128 ui->m_width_sb->setValue(rect.width());
129 ui->m_height_sb->setValue(rect.height());
131 ui->m_rx_sb->setMaximum(rect.width()/2);
133 ui->m_ry_sb->setMaximum(rect.height()/2);
150 QUndoCommand *undo =
new QUndoCommand();
151 undo->setText(
tr(
"Modifier un rectangle"));
153 QRectF rect(
editedTopLeft(), QSizeF(
ui->m_width_sb->value(),
ui->m_height_sb->value()));
The QPropertyUndoCommand class This undo command manage QProperty of a QObject. This undo command can...
~RectangleEditor()
RectangleEditor::~RectangleEditor.
bool setPart(CustomElementPart *) override
StyleEditor::setPart Set the part to edit by this editor. Note : editor can accept or refuse to edit ...
The RectangleEditor class This class provides a widget to edit rectangles within the element editor...
CustomElementPart * currentPart() const override
RectangleEditor::currentPart.
void enableAnimation(bool animate=true)
QPropertyUndoCommand::enableAnimation True to enable animation.
RectangleEditor(QETElementEditor *editor, PartRectangle *rect=nullptr, QWidget *parent=nullptr)
RectangleEditor::RectangleEditor.
QPointF editedTopLeft() const
RectangleEditor::topLeft.
void editingFinished()
RectangleEditor::editingFinished Slot called when a editor widget is finish to be edited Update the g...
QVariant property(const char *name) const override
virtual ElementScene * elementScene() const
void updateForm() override
RectangleEditor::updateForm.
void setAnimated(bool animate=true, bool first_time=true)
QPropertyUndoCommand::setAnimated.
bool setPart(CustomElementPart *part) override
RectangleEditor::setPart.
void activeConnections(bool active)
RectangleEditor::activeConnections Enable/disable connection between editor widget and slot editingFi...
QRectF rect
PartRectangle::rect.