I want to add signals to a subclass I made of QTreeView. As per this
website (http://developer.qt.nokia.com/wiki/Signals_and_Slots_in_PySide),
I have a Communcate class that I instantiate in my QTreeView subclass.
Later on as the user right clicks in the QTreeView it will emit
signals as per the normal Qt philosophy.

Is there any way to get rid of the Communicate class? Can I somehow
just add the signal straight to the QTreeView subclass, or is this the
way to do it?

class Communicate(QObject):
    foo = Signal(int)

class MySubClass(QTreeView):
    def __init__(self, parent = None):
        QTreeView.__init__(self, parent)
        self.c = Communicate()
    def contextMenuEvent(self, event):
        ...
        self.c.foo.emit(42)
        ...
_______________________________________________
PySide mailing list
PySide@lists.pyside.org
http://lists.pyside.org/listinfo/pyside

Reply via email to