9 _name=name.toStdString();
10 _type=type.toStdString();
11 _parent = qobject_cast<QTableWidget *>(parent);
18 if( index.column() == 0 ){
19 QComboBox *comboBox =
new QComboBox(parent);
23 for( sSet::const_iterator p=colsSet.
begin(); p != colsSet.
end(); p++ ){
24 comboBox->addItem((*p).c_str());
26 comboBox->setEditable(
true);
27 comboBox->setAutoCompletion(
true);
36 QComboBox *comboBox = qobject_cast<QComboBox *>(editor);
37 if (!comboBox)
return;
39 int pos = comboBox->findText(index.model()->data(index).toString(), Qt::MatchExactly);
41 comboBox->setCurrentIndex(pos);
44 comboBox->addItem(index.model()->data(index).toString());
45 pos = comboBox->findText(index.model()->data(index).toString(), Qt::MatchExactly);
46 comboBox->setCurrentIndex(pos);
51 QColor(184,16,0,180) : QColor(32,140,64,180) );
54 QPalette pal = comboBox->palette();
55 pal.setColor(QPalette::Base,
_p->
isErrorCol(
_type, comboBox->currentText().toStdString() ) ?
56 QColor(164,32,16) : QColor(32,140,64) );
57 pal.setColor(QPalette::Text, QColor(255,255,255) );
58 comboBox->setPalette(pal);
64 QComboBox *comboBox = qobject_cast<QComboBox *>(editor);
65 if (!comboBox)
return;
67 model->setData(index, comboBox->currentText());
70 _p->
getCols(
INPUT,
_name )[ index.row() ]->setValue( comboBox->currentText().toStdString() );
76 QColor(184,16,0,180) : QColor(32,140,64,180) );
79 QPalette pal = comboBox->palette();
80 pal.setColor(QPalette::Base,
_p->
isErrorCol(
_type, comboBox->currentText().toStdString() ) ?
81 QColor(164,32,16) : QColor(32,140,64) );
82 pal.setColor(QPalette::Text, QColor(255,255,255) );
83 comboBox->setPalette(pal);
103 item0->setBackgroundColor(
_p->
isErrorCol(
_type, item0->text().toStdString() ) ?
104 QColor(184,16,0,180) : QColor(32,140,64,180) );
106 _parent->setItem(row, 0, item0);
107 _parent->setCurrentItem(item0);
112 int row =
_parent->currentRow();
113 if( row >= 0 && row < _parent->rowCount() ){
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
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...
void remCol(const std::string &iotype, const std::string &name, unsigned int index)
Removes collection of the given iotype ( INPUT / OUTPUT ) with the given name at the given index...
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
handles information about marlin processors and their collections needed by MarlinSteerCheck ...
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...
IColDelegate(const IColDelegate &)=default
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.
void addCol(const std::string &iotype, const std::string &name, const std::string &type, const std::string &value)
Adds a collection of the given iotype ( INPUT / OUTPUT ) with the given name, type and value...
void setEditorData(QWidget *editor, const QModelIndex &index) const
bool isActive()
Returns true if the processor is active.