Hi Friends, I have QTableWidget... it has "QComboBox" as a cellWidget in one of it column...
I wanted to disable the ScrollEvent of QComboBox... so when cursor is on top of the QComboBox ,if user try to do the Mouse Scroll,then it should not change the index.... To achieve this, I just implemented the "eventFilter" in TableWidget class.... but still ScrollEvent is working... can anyone please help me to fix this problem...? Thanks & Regards, Muthu code snippet: TableWidget::TableWidget(QWidget *parent, MainWindow *mainwindow) : QTableWidget(parent) { versioncombo->setFocusPolicy( Qt::StrongFocus); versioncombo->installEventFilter( this ); } bool TableWidget::eventFilter(QObject *obj, QEvent *event) { if(event->type() == QEvent::Wheel && qobject_cast<CustomComboBox*>(obj)) { if(qobject_cast<CustomComboBox*>(obj)->focusPolicy() == Qt::WheelFocus) { event->accept(); return false; } else { event->ignore(); return true; } } return QWidget::eventFilter(obj, event); } CustomComboBox::CustomComboBox(QWidget *parent) : QComboBox(parent) { setEditable (false); setFocusPolicy(Qt::StrongFocus); } void CustomComboBox::focusInEvent(QFocusEvent*) { setFocusPolicy(Qt::WheelFocus); } void CustomComboBox::focusOutEvent(QFocusEvent*) { setFocusPolicy(Qt::StrongFocus); }
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest