36 x =
new QDoubleSpinBox();
37 y =
new QDoubleSpinBox();
38 h =
new QDoubleSpinBox();
39 v =
new QDoubleSpinBox();
41 angle =
new QSpinBox();
43 angle -> setRange(-360, 360);
45 x->setRange(-5000, 5000);
46 y->setRange(-5000, 5000);
47 h->setRange(-5000, 5000);
48 v->setRange(-5000, 5000);
50 QVBoxLayout *v_layout =
new QVBoxLayout(
this);
52 QGridLayout *grid =
new QGridLayout();
53 grid -> addWidget(
new QLabel(
tr(
"Centre : ")), 0, 0);
54 grid -> addWidget(
new QLabel(
"x"), 1, 0, Qt::AlignRight);
55 grid -> addWidget(
x, 1, 1);
56 grid -> addWidget(
new QLabel(
"y"), 1, 2);
57 grid -> addWidget(
y, 1, 3);
58 grid -> addWidget(
new QLabel(
tr(
"Diamètres : ")), 2, 0);
59 grid -> addWidget(
new QLabel(
tr(
"horizontal :")), 3, 0);
60 grid -> addWidget(
h, 3, 1);
61 grid -> addWidget(
new QLabel(
tr(
"vertical :")), 4, 0);
62 grid -> addWidget(
v, 4, 1);
63 grid -> addWidget(
new QLabel(
tr(
"Angle de départ :")), 5, 0);
65 grid -> addWidget(
new QLabel(
tr(
"Angle :")), 6, 0);
66 grid -> addWidget(
angle, 6, 1);
68 v_layout -> addWidget(
style_);
69 v_layout -> addLayout(grid);
70 v_layout->addStretch();
102 if (
PartArc *part_arc = dynamic_cast<PartArc *>(new_part))
104 if (
part == part_arc)
return true;
144 undo->setText(
"Modifier l'angle de depart d'un arc");
160 double value =
angle->value() * 16;
165 undo->setText(
"Modifier l'angle d'un arc");
181 QPointF point =
part->mapFromScene(
x->value() -
h->value()/2,
y->value() -
v->value()/2);
182 QRectF rect(point, QSizeF(
h->value(),
v->value()));
187 undo->setText(
"Modifier un arc");
204 x->setValue(
part->mapToScene(rect.topLeft()).
x() + (rect.width()/2));
205 y->setValue(
part->mapToScene(rect.topLeft()).
y() + (rect.height()/2));
206 h->setValue(rect.width());
207 v->setValue(rect.height());
223 connect(
x, SIGNAL(editingFinished()),
this, SLOT(
updateArcRect()));
224 connect(
y, SIGNAL(editingFinished()),
this, SLOT(
updateArcRect()));
225 connect(
h, SIGNAL(editingFinished()),
this, SLOT(
updateArcRect()));
226 connect(
v, SIGNAL(editingFinished()),
this, SLOT(
updateArcRect()));
232 disconnect(
x, SIGNAL(editingFinished()),
this, SLOT(
updateArcRect()));
233 disconnect(
y, SIGNAL(editingFinished()),
this, SLOT(
updateArcRect()));
234 disconnect(
h, SIGNAL(editingFinished()),
this, SLOT(
updateArcRect()));
235 disconnect(
v, SIGNAL(editingFinished()),
this, SLOT(
updateArcRect()));
237 disconnect(
angle, SIGNAL(editingFinished()),
this, SLOT(
updateArcA()));
The QPropertyUndoCommand class This undo command manage QProperty of a QObject. This undo command can...
bool setPart(CustomElementPart *) override
ArcEditor::setPart Specifie to this editor the part to edit. Note that an editor can accept or refuse...
ArcEditor(QETElementEditor *, PartArc *=nullptr, QWidget *=nullptr)
void updateArcA()
ArcEditor::updateArcA Update the span angle of the arc according to the edited value.
void enableAnimation(bool animate=true)
QPropertyUndoCommand::enableAnimation True to enable animation.
void updateForm() override
ArcEditor::updateForm Update the value of the widgets.
void updateArcS()
ArcEditor::updateArcS Update the start angle of the arc according to the edited value.
void activeConnections(bool)
ArcEditor::activeConnections Enable/disable connection between editor widget and slot editingFinished...
QVariant property(const char *name) const override
~ArcEditor() override
Destructeur.
virtual ElementScene * elementScene() const
void updateArcRect()
ArcEditor::updateArcRect Update the geometrie of the rect that define this arc according the the edit...
The PartArc class This class represents an elliptical arc primitive which may be used to compose the ...
CustomElementPart * currentPart() const override
ArcEditor::currentPart.