QML, Python, Signals, and Slots Part 2

Viranch Mehta viranch.mehta at gmail.com
Sun Jun 24 20:33:28 UTC 2012


On Mon, Jun 25, 2012 at 12:52 AM, Eric Mesa <ericsbinaryworld at gmail.com>wrote:

> OK, I did a bunch of googling and I think I can better word what I want to
> do.  I want to emit a signal in QML and catch it in a python slot.  That
> way it can be the arguments to a function within python.  Can I please get
> some help with this?  The syntax is just indirect enough (like the signal
> and slot have different names and all kinds of weirdness) that it's just
> slightly out of reach for my brain to wrap itself around.
>

say you have mySignal(string foo) in QML. this is roughly what you'd do in
python:

view = QDeclarativeView()
view.setSource(...)
connect(view.rootObject(), SIGNAL(mySignal(QString)), receiver, SLOT(...))

I'm assuming the mySignal is in QML's root object. Hope this helps.

Viranch


>
> Thanks,
> --
> Eric Mesa
> http://about.me/ericmesa
> http://www.ericsbinaryworld.com
>
>
> _______________________________________________
> Plasma-devel mailing list
> Plasma-devel at kde.org
> https://mail.kde.org/mailman/listinfo/plasma-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20120625/bd2ddb94/attachment.html>


More information about the Plasma-devel mailing list