38 using namespace YACS::HMI;
43 GenericEditor::GenericEditor()
51 GenericEditor::~GenericEditor()
53 DEBTRACE(
"GenericEditor::~GenericEditor " <<
this);
57 void GenericEditor::setSubject(
Subject* subject)
62 void GenericEditor::setColumn(
int column)
72 QString GenericEditor::GetStrValue()
82 int GenericEditor::getColumnInSubject()
87 void GenericEditor::setData(QVariant val)
91 bool GenericEditor::firstSetData()
100 GeneralEditor::GeneralEditor(
Subject* subject,
106 DEBTRACE(
"GeneralEditor::GeneralEditor");
118 DEBTRACE(
"GeneralEditor::GetStrValue " << text().toStdString());
124 DEBTRACE(
"GeneralEditor::setData " <<
this);
125 DEBTRACE(val.canConvert<QString>());
126 DEBTRACE(val.toString().toStdString());
127 setText(val.toString());
150 DEBTRACE(
"Name::GetStrValue " << text().toStdString());
152 return filtered.c_str();
157 DEBTRACE(
"NameEditor::setData " <<
this);
158 DEBTRACE(val.canConvert<QString>());
159 DEBTRACE(val.toString().toStdString());
161 setText(filtered.c_str());
194 setValue(val.toInt());
205 sb_case->setMinimum(INT_MIN);
206 sb_case->setMaximum(INT_MAX);
219 int val = sb_case->value();
229 DEBTRACE(
"CaseSwitchEditor::setData");
230 if (val ==
"default")
237 DEBTRACE(val.canConvert<
int>() <<
" " << val.toInt());
238 sb_case->setValue(val.toInt());
248 DEBTRACE(
"ValueDelegate::ValueDelegate");
254 DEBTRACE(
"ValueDelegate::~ValueDelegate");
258 const QStyleOptionViewItem &option,
259 const QModelIndex &index)
const
261 DEBTRACE(
"ValueDelegate::createEditor");
265 int column = index.column();
286 editor =
new IntEditor(subject,
this, column, parent);
300 editor =
new NameEditor(subject,
this, column, parent);
303 if (!editor) editor =
new GeneralEditor(subject,
this, column, parent);
314 const QModelIndex &index)
const
316 DEBTRACE(
"ValueDelegate::setEditorData");
327 gedit->
setData(QString(error.c_str()));
329 DEBTRACE(
"--------erase-----------");
332 gedit->
setData(index.model()->data(index, Qt::DisplayRole));
340 const QModelIndex &index)
const
342 DEBTRACE(
"ValueDelegate::setModelData");
351 const QStyleOptionViewItem &option,
352 const QModelIndex &index)
const
354 DEBTRACE(
"ValueDelegate::updateEditorGeometry");
355 editor->setGeometry(option.rect);
365 DEBTRACE(
"ValueDelegate::setResultEditing " << isOk);