mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 05:00:33 +01:00
Ajout de validateurs dans les widgets d'edition des parties dans l'editeur d'element
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@238 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -37,6 +37,11 @@ ArcEditor::ArcEditor(QETElementEditor *editor, PartArc *arc, QWidget *parent) :
|
||||
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));
|
||||
|
||||
QGridLayout *grid = new QGridLayout(this);
|
||||
grid -> addWidget(new QLabel(tr("Centre : ")), 0, 0);
|
||||
grid -> addWidget(new QLabel("x"), 1, 0);
|
||||
|
||||
@@ -32,11 +32,9 @@ CircleEditor::CircleEditor(QETElementEditor *editor, PartCircle *circle, QWidget
|
||||
y = new QLineEdit();
|
||||
r = new QLineEdit();
|
||||
|
||||
// QDoubleValidator *format = new QDoubleValidator(-1000.0, -1000.0, 4, this);
|
||||
// x -> setValidator(new QDoubleValidator(-1000.0, 1000.0, 4, this));
|
||||
// y -> setValidator(new QDoubleValidator(-1000.0, 1000.0, 4, this));
|
||||
// h -> setValidator(new QDoubleValidator(0.0, 1000.0, 4, this));
|
||||
|
||||
x -> setValidator(new QDoubleValidator(x));
|
||||
y -> setValidator(new QDoubleValidator(y));
|
||||
r -> setValidator(new QDoubleValidator(r));
|
||||
|
||||
QGridLayout *grid = new QGridLayout(this);
|
||||
grid -> addWidget(new QLabel(tr("Centre : ")), 0, 0);
|
||||
|
||||
@@ -33,12 +33,10 @@ EllipseEditor::EllipseEditor(QETElementEditor *editor, PartEllipse *ellipse, QWi
|
||||
h = new QLineEdit();
|
||||
v = new QLineEdit();
|
||||
|
||||
// QDoubleValidator *format = new QDoubleValidator(-1000.0, -1000.0, 4, this);
|
||||
// x -> setValidator(new QDoubleValidator(-1000.0, 1000.0, 4, this));
|
||||
// y -> setValidator(new QDoubleValidator(-1000.0, 1000.0, 4, this));
|
||||
// h -> setValidator(new QDoubleValidator(0.0, 1000.0, 4, this));
|
||||
// v -> setValidator(new QDoubleValidator(0.0, 1000.0, 4, this));
|
||||
|
||||
x -> setValidator(new QDoubleValidator(x));
|
||||
y -> setValidator(new QDoubleValidator(y));
|
||||
h -> setValidator(new QDoubleValidator(h));
|
||||
v -> setValidator(new QDoubleValidator(v));
|
||||
|
||||
QGridLayout *grid = new QGridLayout(this);
|
||||
grid -> addWidget(new QLabel(tr("Centre : ")), 0, 0);
|
||||
|
||||
@@ -33,6 +33,11 @@ LineEditor::LineEditor(QETElementEditor *editor, PartLine *line, QWidget *parent
|
||||
x2 = new QLineEdit();
|
||||
y2 = new QLineEdit();
|
||||
|
||||
x1 -> setValidator(new QDoubleValidator(x1));
|
||||
y1 -> setValidator(new QDoubleValidator(y1));
|
||||
x2 -> setValidator(new QDoubleValidator(x2));
|
||||
y2 -> setValidator(new QDoubleValidator(y2));
|
||||
|
||||
QGridLayout *grid = new QGridLayout(this);
|
||||
grid -> addWidget(new QLabel("x1"), 0, 0);
|
||||
grid -> addWidget(x1, 0, 1);
|
||||
|
||||
@@ -30,6 +30,9 @@ TerminalEditor::TerminalEditor(QETElementEditor *editor, PartTerminal *term, QWi
|
||||
qle_x = new QLineEdit();
|
||||
qle_y = new QLineEdit();
|
||||
|
||||
qle_x -> setValidator(new QDoubleValidator(qle_x));
|
||||
qle_y -> setValidator(new QDoubleValidator(qle_y));
|
||||
|
||||
orientation = new QComboBox();
|
||||
orientation -> addItem(QIcon(":/ico/north.png"), tr("Nord"), QET::North);
|
||||
orientation -> addItem(QIcon(":/ico/east.png"), tr("Est"), QET::East);
|
||||
|
||||
@@ -33,6 +33,9 @@ TextEditor::TextEditor(QETElementEditor *editor, PartText *text, QWidget *parent
|
||||
font_size = new QSpinBox();
|
||||
font_size -> setRange(0, 144);
|
||||
|
||||
qle_x -> setValidator(new QDoubleValidator(qle_x));
|
||||
qle_y -> setValidator(new QDoubleValidator(qle_y));
|
||||
|
||||
QVBoxLayout *main_layout = new QVBoxLayout();
|
||||
main_layout -> addWidget(new QLabel(tr("Position : ")));
|
||||
|
||||
@@ -55,8 +58,6 @@ TextEditor::TextEditor(QETElementEditor *editor, PartText *text, QWidget *parent
|
||||
main_layout -> addStretch();
|
||||
setLayout(main_layout);
|
||||
|
||||
|
||||
|
||||
updateForm();
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,9 @@ TextFieldEditor::TextFieldEditor(QETElementEditor *editor, PartTextField *textfi
|
||||
rotate = new QCheckBox(tr("Maintenir horizontal malgr\351\n les rotations de l'\351l\351ment"));
|
||||
rotate -> setChecked(true);
|
||||
|
||||
qle_x -> setValidator(new QDoubleValidator(qle_x));
|
||||
qle_y -> setValidator(new QDoubleValidator(qle_y));
|
||||
|
||||
QVBoxLayout *main_layout = new QVBoxLayout();
|
||||
main_layout -> addWidget(new QLabel(tr("Position : ")));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user