[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] =?utf-8?q?how_to_get_all_the_signal_from_a_QObject/QWidget?=
From: Phil Thompson <phil () riverbankcomputing ! com>
Date: 2012-02-17 8:51:44
Message-ID: e488672df31b411617a0b2f539da1731 () localhost
[Download RAW message or body]
On Thu, 16 Feb 2012 15:19:18 -0800, Emmanuel Mayssat <emayssat@gmail.com>
wrote:
> I have a widget inside another widget.
>
> 1/
> I would like to have a ~for loop that propagate all the signals of the
> inner widget as if they were emitted by the container widget.
> That is for each signals
> self.connect(myChild, SIGNAL("mySignal()"), self.mySignal.emit())
The above line won't work, use...
self.connect(myChild, SIGNAL("mySignal()"), self.mySignal)
> how can I list the signals that an object has?
Use the standard Qt introspection classes starting with QMetaObject or do
a dir() on the class and look for instances of pyqtSignal.
> 2/
> I understand also that the signals needs to be declared at both levels.
> Is there a way to do that progammatically?
No.
> 3/
> A propos, I noticed that inheritance doesn't seem to pass signal
> definition.
What makes you think that?
> That is
>
> class Lwidget(QWidget):
> mysignal = pyqtSignal()
>
> class LSuperWidget(Lwidget):
> <here the signal needs to be redefined> <-- is there a way to
> avoid this?
Signals are inherited just like any other class attribute.
Phil
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic