37 x =
new QDoubleSpinBox();
38 y =
new QDoubleSpinBox();
39 h =
new QDoubleSpinBox();
40 v =
new QDoubleSpinBox();
42 x->setRange(-5000, 5000);
43 y->setRange(-5000, 5000);
44 h->setRange(-5000, 5000);
45 v->setRange(-5000, 5000);
47 QVBoxLayout *v_layout =
new QVBoxLayout(
this);
49 QGridLayout *grid =
new QGridLayout();
50 grid -> addWidget(
new QLabel(
tr(
"Centre : ")), 0, 0);
51 grid -> addWidget(
new QLabel(
"x"), 1, 0, Qt::AlignRight);
52 grid -> addWidget(
x, 1, 1);
53 grid -> addWidget(
new QLabel(
"y"), 1, 2);
54 grid -> addWidget(
y, 1, 3);
55 grid -> addWidget(
new QLabel(
tr(
"Diamètres : ")), 2, 0);
56 grid -> addWidget(
new QLabel(
tr(
"horizontal :")), 3, 0);
57 grid -> addWidget(
h, 3, 1);
58 grid -> addWidget(
new QLabel(
tr(
"vertical :")), 4, 0);
59 grid -> addWidget(
v, 4, 1);
61 v_layout -> addWidget(
style_);
62 v_layout -> addLayout(grid);
63 v_layout->addStretch();
91 if (
PartEllipse *part_ellipse = dynamic_cast<PartEllipse *>(new_part))
93 if (
part == part_ellipse)
return true;
116 QPointF point =
part->mapFromScene(
x->value() -
h->value()/2,
y->value() -
v->value()/2);
117 QRectF rect(point, QSizeF(
h->value(),
v->value()));
122 undo->setText(
"Modifier une ellipse");
123 undo->enableAnimation();
138 x->setValue(
part->mapToScene(rect.topLeft()).
x() + (rect.width()/2));
139 y->setValue(
part->mapToScene(rect.topLeft()).
y() + (rect.height()/2));
140 h->setValue(rect.width());
141 v->setValue(rect.height());
The QPropertyUndoCommand class This undo command manage QProperty of a QObject. This undo command can...
void undo() override
annule le coller
bool setPart(CustomElementPart *) override
~EllipseEditor() override
Destructeur.
EllipseEditor(QETElementEditor *, PartEllipse *=nullptr, QWidget *=nullptr)
void activeConnections(bool)
CustomElementPart * currentPart() const override
QVariant property(const char *name) const override
virtual ElementScene * elementScene() const
The PartEllipse class This class represents an ellipse primitive which may be used to compose the dra...
void updateForm() override