accountComboBox->view()->viewport()->installEventFilter(this);
bool dataForm::eventFilter(QObject *obj, QEvent *evnt ){ if (obj == accountComboBox->view()->viewport()) { if (evnt->type() == QEvent::MouseButtonRelease) { QMouseEvent *mouseEvent = static_cast<QMouseEvent*>(evnt); if (mouseEvent->button() != Qt::RightButton) return false; QModelIndex columnIndex(accountComboBox->view()->indexAt(mouseEvent->pos())); int i = columnIndex.row(); accountComboBox->removeItem(i); return true; } return false; } return QMainWindow::eventFilter(obj, evnt);}