[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    Re: QML, Python, Signals, and Slots Part 2
From:       Eric Mesa <ericsbinaryworld () gmail ! com>
Date:       2012-06-25 2:57:46
Message-ID: CAKYHq8JYp3fjG3YDw2D4hROpvhVeW53jgWsfhZZ=88CObpyD8w () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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

> On Mon, Jun 25, 2012 at 5:32 AM, Eric Mesa <ericsbinaryworld@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

[Attachment #5 (text/html)]

<div class="gmail_quote">On Sun, Jun 24, 2012 at 10:21 PM, Viranch Mehta <span \
dir="ltr">&lt;<a href="mailto:viranch.mehta@gmail.com" \
target="_blank">viranch.mehta@gmail.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"> <div class="im">On Mon, Jun 25, 2012 at 5:32 AM, Eric Mesa \
<span dir="ltr">&lt;<a href="mailto:ericsbinaryworld@gmail.com" \
target="_blank">ericsbinaryworld@gmail.com</a>&gt;</span> wrote:<br></div><div \
class="gmail_quote"> <div class="im"><blockquote class="gmail_quote" style="margin:0 \
0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <div><div \
class="gmail_quote"><br></div></div>print \
connect(view.rootObject(),SIGNAL(mySignal(QString)), receiver, \
SLOT(QUrl(&#39;message.qml&#39;)))<br></blockquote><div><br></div></div><div>You \
don&#39;t need this line because you&#39;ve already connected QML&#39;s \
messageRequired</div>

<div>signal to Now&#39;s appropriate slot. So just remove this line and everything \
else looks fine.</div><div><br></div><div>In future if you&#39;re supposed to use \
this kind of a thing, the above line would be correct</div>

<div>as follows wrt current \
example:</div><div><br></div><div>QObject.connect(rootObject, \
SIGNAL(&#39;messageRequired()&#39;), now, \
SLOT(&#39;emit_now()&#39;))</div><div><br></div><div>(where rootObject = \
view.rootObject() of course)</div>

<div><br></div><div>Also, the following two lines are \
equivalent:</div><div><br></div><div>1. \
sender.signal.connect(receiver.slot)</div><div><br></div><div>2. \
QObject.connect(sender, SIGNAL(&#39;signal()&#39;), receiver, \
SLOT(&#39;slot()&#39;))</div>

<div><br></div><div>In the 2nd line, the parameter types should be specified in \
signal(...) and slot(...) as in</div><div>C++ (if \
any)</div><div><br></div><div>Cheers,</div><div>Viranch</div></div> <br \
clear="all"></blockquote></div><br>You have been an invaluable help.  I think I will \
now be able to finish implementing this!<br>--<br>Eric Mesa<div><a \
href="http://about.me/ericmesa" target="_blank">http://about.me/ericmesa</a><br> <a \
href="http://www.ericsbinaryworld.com" \
target="_blank">http://www.ericsbinaryworld.com</a></div>



_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic