Home | Trees | Indices | Help |
---|
|
object --+ | sip.wrapper --+ | PyQt4.QtCore.QObject --+ | QNamespaceContainer
Base class to assemble methods and logic in its own class.
Slot methods (on_method_event()) are automatically connected to widgets of the parent. If the methods takes an argument you *must* apply a @pyqtSignature() decorator!
connect(), disconnect(), emit() and attribute access are forwarded to the parent class (like Zope2 implicit acquisition wrapper) but you *must* use self.context instead self as argument.>>> class MyStuff(QNamespaceContainer): ... def initialize(self): ... self.connect(self.context, SIGNAL("foo()"), bar) ... ... @pyqtSignature("int") ... def on_button_clicked(self, boolean):Now add the container to your class >>> class MainWindow(QtCore.QObject): ... def __init__(self, parent=None): ... QtCore.QObject.__init__(self, parent=None) ... self.qcMystuff = MyStuff(parent)
Warning: If you are creating new QObject based instances you should bind them to self.context and *not* to self. This is especially true for QWidget based objects.
|
|||
|
__init__(self,
parent) Constructor |
||
|
connect(self,
*args) Shortcut for self.parent().connect(*args) |
||
|
disconnect(self,
*args) Shortcut for self.parent().disconnect(*args) |
||
|
emit(self,
*args) Shortcut for self.parent().emit(*args) |
||
|
__getattr__(self,
name,
default=_marker) Get attributes form parent. |
||
|
initialize(self) Initialize method |
||
Inherited from Inherited from Inherited from |
|
|||
Inherited from |
|
|||
|
context Shortcut for self.parent() |
||
Inherited from |
|
Constructor Calls initialize() and auto connects slot methods with parent's widgets.
|
|
|
|
Get attributes form parent. Works similar to Zope 2's Implicit Acquisition wrapper. |
Initialize method Must be implement in the subclass |
|
contextShortcut for self.parent()
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0alpha3 on Sun Feb 4 17:00:23 2007 | http://epydoc.sourceforge.net |