[PyQt] Proposal for New-style Signals

Phil Thompson phil at riverbankcomputing.com
Wed Jan 30 08:38:51 GMT 2008


On Wednesday 30 January 2008, nytmyn wrote:
> The stage 2 simplified qt signals looks just great :)
> What about signals declared in Python? I'd really like to have
> the possibility to declare and use them as the qt ones.

You can do that now using __pyqtSignals__.

> All QObjects derrived classes are passed as pointers and
> the values based classes are (really) often passed as const references
> so signatures of python declared signals and slots could be formed from
> python types and use
> c++ string based declarations only for more complicated cases.
> I admit I really love C++ but I hate seeing it in Python :)
>
> class Example(QObject):
>   signalFoo = Signal(int)
>
>   @pyqtSignature("newSlotName", int, QImage)
>   def slotBar(self, number, image):
>     pass

Strings are going to stay for the reasons I've already given.

Phil


More information about the PyQt mailing list