pyQt How do I get a widget from a QListWidgetItem?
I have used setItemWidget() to put a custom widget in a QListWidgetItem, how do I get a reference to it afterwards?
Also, related question- my QListWidget is no longer responding to mouse events etc. But it's easy to get mouse events from the custom widget. Is there a way of adapting the QListWidget to use its standard functions such as currentItem()? Or would teh normal process be to connect signals in the custom QWidget to slots in the GUI?
There is a corresponding function
QWidget * itemWidget(QListWidgetItem *item) constthat you should be able to use.
@m.sue Great thanks! Do you know why the QListWidget no longer detects mouse events over the QListWidgetitem?
That's because you put a widget in it which means it's that widget that will get the events.