Howdy!
I'm new to PySide (and just a hobbyist programmer), so please excuse
any stupidity on my end.
I'm trying to display different information about items in a ListView
as the selection changes. I've found myself having to subclass the
ListView like so in order to get it working (which it is, at the
moment):
class SimpleListView(QListView):
selectionChangedSig.nal = Signal(object, object)
def __init__(self, parent=None):
super(SimpleListView, self).__init__(parent)
def selectionChanged(self, selected, deselected):
self.selectionChangedSignal.emit(selected, deselected)
In doing this and reading through various docs, a couple of questions arose:
1. What are the valid types that QtCore.Signal() accepts? The
documentation page has examples for "str" and "int", but here I've got
a QItemSelection. Throwing "object" ("selectionChangedSignal =
Signal(object, object)") makes it work, but I don't know why exactly.
2. "selectionChanged" is defined as a slot inherited by QListView from
QAbstractItemView. The problem is, I want it to be a signal. I can do
what I've done here, but I'd rather just catch whatever signal that
the "selectionChanged" slot is connected to. Is that possible?
_______________________________________________
PySide mailing list
[email protected]
http://lists.openbossa.org/listinfo/pyside