/** Met a jour le formulaire d'edition */ void TerminalEditor::updateForm() { if (!part) return; activeConnections(false); qle_x -> setValue(part->property("x").toReal()); qle_y -> setValue(part->property("y").toReal()); orientation -> setCurrentIndex(orientation->findData(part->property("orientation"))); activeConnections(true); }
/** Met a jour le formulaire d'edition */ void RectangleEditor::updateForm() { if (!part) return; activeConnections(false); x -> setText(part -> property("x").toString()); y -> setText(part -> property("y").toString()); w -> setText(part -> property("width").toString()); h -> setText(part -> property("height").toString()); activeConnections(true); }
/** Met a jour le formulaire d'edition */ void TextFieldEditor::updateForm() { if (!part) return; activeConnections(false); qle_x -> setText(part -> property("x").toString()); qle_y -> setText(part -> property("y").toString()); qle_text -> setText(part -> property("text").toString()); font_size -> setValue(part -> property("size").toInt()); rotate -> setChecked(!part -> property("rotate").toBool()); rotation_angle_ -> setValue(part -> property("rotation angle").toDouble()); activeConnections(true); }
/** Constructeur @param editor L'editeur d'element concerne @param term La borne a editer @param parent QWidget parent de ce widget */ TerminalEditor::TerminalEditor(QETElementEditor *editor, PartTerminal *term, QWidget *parent) : ElementItemEditor(editor, parent), part(term) { qle_x = new QDoubleSpinBox(); qle_y = new QDoubleSpinBox(); qle_x -> setRange(-1000, 1000); qle_y -> setRange(-1000, 1000); orientation = new QComboBox(); orientation -> addItem(QET::Icons::North, tr("Nord"), Qet::North); orientation -> addItem(QET::Icons::East, tr("Est"), Qet::East); orientation -> addItem(QET::Icons::South, tr("Sud"), Qet::South); orientation -> addItem(QET::Icons::West, tr("Ouest"), Qet::West); QVBoxLayout *main_layout = new QVBoxLayout(); main_layout -> addWidget(new QLabel(tr("Position : "))); QHBoxLayout *position = new QHBoxLayout(); position -> addWidget(new QLabel(tr("x : "))); position -> addWidget(qle_x ); position -> addWidget(new QLabel(tr("y : "))); position -> addWidget(qle_y ); main_layout -> addLayout(position); QHBoxLayout *ori = new QHBoxLayout(); ori -> addWidget(new QLabel(tr("Orientation : "))); ori -> addWidget(orientation ); main_layout -> addLayout(ori); main_layout -> addStretch(); setLayout(main_layout); activeConnections(true); updateForm(); }
/** Constructeur @param editor L'editeur d'element concerne @param rect Le rectangle a editer @param parent le Widget parent */ RectangleEditor::RectangleEditor(QETElementEditor *editor, PartRectangle *rect, QWidget *parent) : ElementItemEditor(editor, parent), part(rect) { style_ = new StyleEditor(editor); x = new QLineEdit(); y = new QLineEdit(); w = new QLineEdit(); h = new QLineEdit(); x -> setValidator(new QDoubleValidator(x)); y -> setValidator(new QDoubleValidator(y)); w -> setValidator(new QDoubleValidator(w)); h -> setValidator(new QDoubleValidator(h)); QVBoxLayout *v_layout = new QVBoxLayout(this); QGridLayout *grid = new QGridLayout(); grid -> addWidget(new QLabel(tr("Coin sup\351rieur gauche\240: ")), 0, 0, 1, 4); grid -> addWidget(new QLabel("x"), 1, 0, Qt::AlignRight); grid -> addWidget(x, 1, 1); grid -> addWidget(new QLabel("y"), 1, 2); grid -> addWidget(y, 1, 3); grid -> addWidget(new QLabel(tr("Dimensions\240: ")), 2, 0, 1, 4); grid -> addWidget(new QLabel(tr("Largeur\240:")), 3, 0); grid -> addWidget(w, 3, 1); grid -> addWidget(new QLabel(tr("Hauteur\240:")), 4, 0); grid -> addWidget(h, 4, 1); v_layout -> addWidget(style_); v_layout -> addLayout(grid); activeConnections(true); updateForm(); }