Hi Renato, thanks! I only need this signal to be on the python side.
Cheers, David On Tue, Sep 6, 2011 at 3:19 PM, Renato Araujo Oliveira Filho <[email protected]> wrote: > Hi David, > > Yes is possible to define sinal with python objects, you could use: > > signal_node_selected = QtCore.Signal(object) > > But this signal will be valid only in pyhon side, sice Qt/C++ does not > know how to handle PyObject. > > BR > > On Tue, Sep 6, 2011 at 10:12 AM, David Angelo > <[email protected]> wrote: >> Hi folks, >> >> I have a question regarding the usage of signals with custom data >> objects and not only "str" or "int". >> Is it possible to define signals with custom data objects? >> E.g.: >> >> class Data(object): >> ... >> >> class WidgetSource(QtGui.QWidget): >> >> #signal_node_selected = QtCore.Signal(str) >> signal_node_selected = QtCore.Signal(<DATA>) >> >> ... >> >> >> class WidgetTarget(QtGui.QWidget): >> >> def __init__(self): >> s = WigdgetSource() >> s. signal_node_selected.connect(self.slot_node_selected) >> >> def slot_node_selected(self, data): >> #process the data object >> >> >> Thanks in advance and best regards! >> >> Cheers, >> David >> _______________________________________________ >> PySide mailing list >> [email protected] >> http://lists.pyside.org/listinfo/pyside >> > > > > -- > Renato Araujo Oliveira Filho > Instituto Nokia de Tecnologia - INdT > _______________________________________________ PySide mailing list [email protected] http://lists.pyside.org/listinfo/pyside
