Element editor : replace home made property by Q_PROPERTY for all primitive,

Add combo box for input to set the tagg (nothing or label, actually)
Remove terminal text because unused.


git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3088 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2014-05-29 13:46:04 +00:00
parent f639871057
commit 6f51f1eb0d
49 changed files with 777 additions and 1342 deletions

View File

@@ -30,19 +30,19 @@ ArcEditor::ArcEditor(QETElementEditor *editor, PartArc *arc, QWidget *parent) :
part(arc)
{
style_ = new StyleEditor(editor);
x = new QLineEdit();
y = new QLineEdit();
h = new QLineEdit();
v = new QLineEdit();
x = new QDoubleSpinBox();
y = new QDoubleSpinBox();
h = new QDoubleSpinBox();
v = new QDoubleSpinBox();
start_angle = new QSpinBox();
angle = new QSpinBox();
start_angle -> setRange(-360, 360);
angle -> setRange(-360, 360);
x -> setValidator(new QDoubleValidator(x));
y -> setValidator(new QDoubleValidator(y));
h -> setValidator(new QDoubleValidator(h));
v -> setValidator(new QDoubleValidator(v));
x->setRange(-1000, 1000);
y->setRange(-1000, 1000);
h->setRange(-1000, 1000);
v->setRange(-1000, 1000);
QVBoxLayout *v_layout = new QVBoxLayout(this);
@@ -110,22 +110,22 @@ CustomElementPart *ArcEditor::currentPart() const {
*/
void ArcEditor::updateArc() {
if (!part) return;
part -> setProperty("x", x -> text().toDouble());
part -> setProperty("y", y -> text().toDouble());
part -> setProperty("diameter_h", h -> text().toDouble());
part -> setProperty("diameter_v", v -> text().toDouble());
part -> setProperty("x", x -> value());
part -> setProperty("y", y -> value());
part -> setProperty("diameter_h", h -> value());
part -> setProperty("diameter_v", v -> value());
part -> setProperty("start_angle", -start_angle -> value() + 90);
part -> setProperty("angle", -angle -> value());
}
/// Met a jour l'abscisse du centre de l'arc et cree un objet d'annulation
void ArcEditor::updateArcX() { addChangePartCommand(tr("abscisse"), part, "x", x -> text().toDouble()); }
void ArcEditor::updateArcX() { addChangePartCommand(tr("abscisse"), part, "x", x -> value()); }
/// Met a jour l'ordonnee du centre de l'arc et cree un objet d'annulation
void ArcEditor::updateArcY() { addChangePartCommand(tr("ordonn\351e"), part, "y", y -> text().toDouble()); }
void ArcEditor::updateArcY() { addChangePartCommand(tr("ordonn\351e"), part, "y", y -> value()); }
/// Met a jour le diametre horizontal de l'arc et cree un objet d'annulation
void ArcEditor::updateArcH() { addChangePartCommand(tr("diam\350tre horizontal"), part, "diameter_h", h -> text().toDouble()); }
void ArcEditor::updateArcH() { addChangePartCommand(tr("diam\350tre horizontal"), part, "diameter_h", h -> value()); }
/// Met a jour le diametre vertical de l'arc et cree un objet d'annulation
void ArcEditor::updateArcV() { addChangePartCommand(tr("diam\350tre vertical"), part, "diameter_v", v -> text().toDouble()); }
void ArcEditor::updateArcV() { addChangePartCommand(tr("diam\350tre vertical"), part, "diameter_v", v -> value()); }
/// Met a jour l'angle de depart de l'arc et cree un objet d'annulation
void ArcEditor::updateArcS() { addChangePartCommand(tr("angle de d\351part"), part, "start_angle", -start_angle -> value() + 90); }
/// Met a jour l'etendue de l'arc et cree un objet d'annulation
@@ -137,10 +137,10 @@ void ArcEditor::updateArcA() { addChangePartCommand(tr("angle"),
void ArcEditor::updateForm() {
if (!part) return;
activeConnections(false);
x -> setText(part -> property("x").toString());
y -> setText(part -> property("y").toString());
h -> setText(part -> property("diameter_h").toString());
v -> setText(part -> property("diameter_v").toString());
x->setValue(part->property("x").toReal());
y->setValue(part->property("y").toReal());
h->setValue(part->property("diameter_h").toReal());
v->setValue(part->property("diameter_v").toReal());
start_angle -> setValue(-part -> startAngle() + 90);
angle -> setValue(-part -> angle());
activeConnections(true);