00001 #include "qseintparametereditor.h"
00002 #include "qseintparameter.h"
00003
00004 #include <QLineEdit>
00005
00006 QseIntParameterEditor::QseIntParameterEditor
00007 (QseOperatorEditor* ed, QseIntParameter* param, QObject* parent)
00008 : QseParameterEditor(ed, param, parent),
00009 m_IntParameter(param),
00010 m_LineEdit(NULL)
00011 {
00012 }
00013
00014 void QseIntParameterEditor::setEditors
00015 (QLineEdit* value, QPushButton* apply, QPushButton* cancel)
00016 {
00017 QseParameterEditor::setEditors(apply, cancel);
00018 m_LineEdit = value;
00019
00020 connect(m_LineEdit, SIGNAL(textChanged(const QString&)),
00021 this, SLOT(editorChanged()));
00022
00023 editorCancel();
00024 }
00025
00026 bool QseIntParameterEditor::editorValidate()
00027 {
00028 bool ok;
00029 int i = m_LineEdit -> text().toInt(&ok);
00030
00031 return ok;
00032 }
00033
00034 void QseIntParameterEditor::editorApply()
00035 {
00036 bool ok;
00037 int i = m_LineEdit -> text().toInt(&ok);
00038
00039 m_Parameter->setValue(i);
00040
00041
00042
00043
00044 }
00045
00046 void QseIntParameterEditor::editorCancel()
00047 {
00048 m_LineEdit->setText(m_Parameter->value().toString());
00049 }