Hi Arun, On Sat, Feb 5, 2011 at 3:00 PM, Arun Srinivasan <rulf...@gmail.com> wrote: > 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) This is correct you can use any python type as signal argument, but this will be not converted to C++. if you want pass this signal with any C++ slot pay attention in the signature, use types which can be converted to c++, you can use the "name" of the type istead of the type. something like "Signal('QObject', 'QVariant')".
OBS: I do not know you you cute and paste your code here but check the Signal declaration you make a typo here. wrong: selectionChangedSig.nal = Signal(object, object) correct: selectionChangedSignal = Signal(object, object) > > def __init__(self, parent=None): > super(SimpleListView, self).__init__(parent) > > def selectionChanged(self, selected, deselected): > self.selectionChangedSignal.emit(selected, deselected) Yes this is correct, if you have problems whith that please fill a bug. > > > 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? BR _______________________________________________ > PySide mailing list > PySide@lists.openbossa.org > http://lists.openbossa.org/listinfo/pyside > -- Renato Araujo Oliveira Filho Instituto Nokia de Tecnologia - INdT Mobile: +55 (81) 8704-2144 _______________________________________________ PySide mailing list PySide@lists.openbossa.org http://lists.openbossa.org/listinfo/pyside