Hi have a QListView created using QtDesigner and converted to python using pyuic4, and I imported the UI module where I am trying to connect it to events
for the QlistView i am trying to implement selection change when user presses up and down key, I am guessing the event should be fired when selection changes but that doesn't seems to do something
self.methodListView.selectionModel.selectionChanged.connect(self.outputHelp)
but this gives error
AttributeError: 'builtin_function_or_method' object has no attribute 'selectionChanged'
Do I need to add some more information to show exactly what I am doing?
self.methodListView.selectionModel
isn't an attribute, it's a function which returns the selection model. Just use
self.methodListView.selectionModel().selectionChanged.connect(self.outputHelp)
and it should work...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With