Installing eventFilter on QListView for indexWidgets

928 Views Asked by At

I have a customWidgets with some components (combobox, lineEdit, labels..etc), This customWidget is added to a QListView using setIndexWidget(QModelIndex,QWidget) , My requirement is that when i click any component on the customWidget the QListView item should get selected/focused.

How can I installEventFilter from cutomWidget to QListView, i have installed event filter for the customWidget.

Thanks

1

There are 1 best solutions below

0
On

That is well described in documentation of QObject.

You can try:

customWidget::installMyFilters()
{
    listView->installEventFilter(this);
}