简体   繁体   中英

Installing eventFilter on QListView for indexWidgets

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

That is well described in documentation of QObject.

You can try:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM