error: passing 'const ComboDelegate' as 'this' argument of 'void QAbstractItemDelegate::closeEditor(QWidget*, QAbstractItemDelegate::EndEditHint)' discards qualifiers
void ComboDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const{ QVariant data; int ty; switch(typeeditor) { case TBool: QComboBox *cmbox = static_cast<QComboBox *>(editor); data = cmbox->currentText(); int row = index.row(); int col = index.column(); col +=1; ty = cmbox->currentIndex(); if(cmbox->currentText()=="true") { QModelIndex ind = model->index(row,col); //QAbstractItemView::edit(ind); QMessageBox::information(0,"","emit");connect(cmbox,SIGNAL(currentIndexChanged(int)),SLOT(ComboDelegate::ch_index(int)));} else { //cmbox->blockSignals(true); cmbox->setCurrentIndex(cmbox->findText(" } break; } model->setData(index, data, Qt::EditRole);
void ComboDelegate::commitAndCloseEditor( ){ QMessageBox::information(0,"","CommitData"); //QComboBox *editor = qobject_cast<QComboBox *>(sender()); QAbstractItemDelegate::closeEditor(editor,QAbstractItemDelegate::EditNextItem); emit closeEditor(editor);}