QML, Python, Signals, and Slots Part 2

Eric Mesa ericsbinaryworld at gmail.com
Mon Jun 25 02:57:46 UTC 2012


On Sun, Jun 24, 2012 at 10:21 PM, Viranch Mehta <viranch.mehta at gmail.com>wrote:

> On Mon, Jun 25, 2012 at 5:32 AM, Eric Mesa <ericsbinaryworld at gmail.com>wrote:
>
>>
>> print connect(view.rootObject(),SIGNAL(mySignal(QString)), receiver,
>> SLOT(QUrl('message.qml')))
>>
>
> You don't need this line because you've already connected QML's
> messageRequired
> signal to Now's appropriate slot. So just remove this line and everything
> else looks fine.
>
> In future if you're supposed to use this kind of a thing, the above line
> would be correct
> as follows wrt current example:
>
> QObject.connect(rootObject, SIGNAL('messageRequired()'), now,
> SLOT('emit_now()'))
>
> (where rootObject = view.rootObject() of course)
>
> Also, the following two lines are equivalent:
>
> 1. sender.signal.connect(receiver.slot)
>
> 2. QObject.connect(sender, SIGNAL('signal()'), receiver, SLOT('slot()'))
>
> In the 2nd line, the parameter types should be specified in signal(...)
> and slot(...) as in
> C++ (if any)
>
> Cheers,
> Viranch
>
>
You have been an invaluable help.  I think I will now be able to finish
implementing this!
--
Eric Mesa
http://about.me/ericmesa
http://www.ericsbinaryworld.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20120624/3ec06002/attachment.html>


More information about the Plasma-devel mailing list