9 _parent = qobject_cast<QTableWidget *>(parent);
16 QLineEdit *edit =
new QLineEdit(parent);
17 QComboBox *comboBox =
new QComboBox(parent);
19 if( index.column() != 2 ){
20 edit->setReadOnly(
true);
25 _parent->item(index.row(),0)->text().toStdString() ,
_p );
27 for( sSet::const_iterator p=colsSet.
begin(); p != colsSet.
end(); p++ ){
28 comboBox->addItem((*p).c_str());
30 comboBox->setEditable(
true);
31 comboBox->setAutoCompletion(
true);
41 if( index.column() != 2 ){
42 QLineEdit *edit = qobject_cast<QLineEdit *>(editor);
43 edit->setText(index.model()->data(index).toString());
46 QComboBox *comboBox = qobject_cast<QComboBox *>(editor);
47 if (!comboBox)
return;
49 int pos = comboBox->findText(index.model()->data(index).toString(), Qt::MatchExactly);
51 comboBox->setCurrentIndex(pos);
54 comboBox->addItem(index.model()->data(index).toString());
55 pos = comboBox->findText(index.model()->data(index).toString(), Qt::MatchExactly);
56 comboBox->setCurrentIndex(pos);
61 _parent->currentItem()->setBackgroundColor(
62 _p->
isErrorCol(
_parent->item(index.row(),1)->text().toStdString(), comboBox->currentText().toStdString() ) ?
63 QColor(184,16,0,180) : QColor(32,140,64,180) );
66 QPalette pal = comboBox->palette();
67 pal.setColor(QPalette::Base,
68 _p->
isErrorCol(
_parent->item(index.row(),1)->text().toStdString(), comboBox->currentText().toStdString() ) ?
69 QColor(164,32,16) : QColor(32,140,64) );
70 pal.setColor(QPalette::Text, QColor(255,255,255) );
71 comboBox->setPalette(pal);
78 if( index.column() == 2 ){
80 QComboBox *comboBox = qobject_cast<QComboBox *>(editor);
81 if (!comboBox)
return;
83 model->setData(index, comboBox->currentText());
86 _p->
getCols(
INPUT,
_parent->item(index.row(),0)->text().toStdString() )[ 0 ]->setValue( comboBox->currentText().toStdString() );
91 _parent->currentItem()->setBackgroundColor(
92 _p->
isErrorCol(
_parent->item(index.row(),1)->text().toStdString(), comboBox->currentText().toStdString() ) ?
93 QColor(184,16,0,180) : QColor(32,140,64,180) );
96 QPalette pal = comboBox->palette();
97 pal.setColor(QPalette::Base,
98 _p->
isErrorCol(
_parent->item(index.row(),1)->text().toStdString(), comboBox->currentText().toStdString() ) ?
99 QColor(164,32,16) : QColor(32,140,64) );
100 pal.setColor(QPalette::Text, QColor(255,255,255) );
101 comboBox->setPalette(pal);
this class is a Marlin Steering File consistency check Tool.
bool isErrorCol(const std::string &type, const std::string &value)
Returns true if the given collection is in the unavailable or duplicate list of this processor...
IColTDelegate(const IColTDelegate &)=default
void setEditorData(QWidget *editor, const QModelIndex &index) const
handles information about marlin processors and their collections needed by MarlinSteerCheck ...
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
sSet & getColsSet(const std::string &type, const std::string &name, CCProcessor *proc)
Returns a list of all available Collections for a given type, name and processor (to use in a ComboBo...
ColVec & getCols(const std::string &iotype, const std::string &type_name="ALL_COLLECTIONS")
Returns collections of a given iotype ( INPUT, OUTPUT, UNAVAILABLE, DUPLICATE ) for a given name or t...
void consistencyCheck()
Performs a check at all active processors to search for unavailable collections.
bool isActive()
Returns true if the processor is active.