39 x1 =
new QDoubleSpinBox();
40 y1 =
new QDoubleSpinBox();
41 x2 =
new QDoubleSpinBox();
42 y2 =
new QDoubleSpinBox();
44 x1 -> setRange(-5000, 5000);
45 y1 -> setRange(-5000, 5000);
46 x2 -> setRange(-5000, 5000);
47 y2 -> setRange(-5000, 5000);
65 QGridLayout *grid =
new QGridLayout();
66 grid -> addWidget(
new QLabel(
"x1"), 0, 0);
67 grid -> addWidget(
x1, 0, 1);
68 grid -> addWidget(
new QLabel(
"y1"), 0, 2);
69 grid -> addWidget(
y1, 0, 3);
70 grid -> addWidget(
new QLabel(
"x2"), 1, 0);
71 grid -> addWidget(
x2, 1, 1);
72 grid -> addWidget(
new QLabel(
"y2"), 1, 2);
73 grid -> addWidget(
y2, 1, 3);
75 QGridLayout *grid2 =
new QGridLayout();
76 grid2 -> addWidget(
new QLabel(
tr(
"Fin 1")), 0, 0);
79 grid2 -> addWidget(
new QLabel(
tr(
"Fin 2")), 1, 0);
83 QVBoxLayout *v_layout =
new QVBoxLayout(
this);
84 v_layout -> addWidget(
style_);
85 v_layout -> addLayout(grid);
86 v_layout -> addLayout(grid2);
87 v_layout->addStretch();
118 if (
PartLine *part_line = dynamic_cast<PartLine *>(new_part))
120 if (
part == part_line)
return true;
154 return part -> mapFromScene(
x1->value(),
y1->value());
162 return part -> mapFromScene(
x2->value(),
y2->value());
175 undo->setText(
tr(
"Modifier une ligne"));
191 undo->setText(
tr(
"Modifier une ligne"));
208 undo->setText(
tr(
"Modifier une ligne"));
224 undo->setText(
tr(
"Modifier une ligne"));
240 undo->setText(
tr(
"Modifier une ligne"));
255 QPointF p1(
part -> sceneP1());
256 QPointF p2(
part -> sceneP2());
257 x1 -> setValue(p1.x());
258 y1 -> setValue(p1.y());
259 x2 -> setValue(p2.x());
260 y2 -> setValue(p2.y());
~LineEditor() override
Destructeur.
The QPropertyUndoCommand class This undo command manage QProperty of a QObject. This undo command can...
void updateForm() override
LineEditor::updateForm Update the value of the widgets.
void activeConnections(bool)
LineEditor::activeConnections Enable/disable connection between editor widget and slot editingFinishe...
CustomElementPart * currentPart() const override
void updateLineEndType2()
Met a jour le type de la seconde extremite.
void enableAnimation(bool animate=true)
QPropertyUndoCommand::enableAnimation True to enable animation.
void firstEndLengthChanged()
void lineEditingFinished()
void secondEndTypeChanged()
LineEditor(QETElementEditor *, PartLine *=nullptr, QWidget *=nullptr)
QDoubleSpinBox * end1_length
QPointF editedP1() const
LineEditor::editedP1.
void firstEndTypeChanged()
QVariant property(const char *name) const override
bool setPart(CustomElementPart *) override
LineEditor::setPart Specifie to this editor the part to edit. Note that an editor can accept or refus...
QPointF editedP2() const
LineEditor::editedP2.
QDoubleSpinBox * end2_length
void secondEndLengthChanged()
void updateLineEndLength1()
Met a jour la longueur de la premiere extremite.
void updateLineEndLength2()
Met a jour la longueur de la seconde extremite.
virtual ElementScene * elementScene() const
void updateLineEndType1()
Met a jour le type de la premiere extremite.