<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Thanks Jerome,<br>
<br>
it looks like simply declaring "object" as the signal type makes it
work.<br>
Not sure if this is one of those things that PySide just makes
easier, which might be the reason why I haven't found any info or
examples on how to "register on meta type" with it.<br>
I'm curious about this but need to press on with a delivery.<br>
<br>
Thanks for your answer, I will try and get into the docs for
QMetaObject some more later to see if there is a better way to
handle my case.<br>
<br>
Cheers,<br>
frank<br>
<br>
<div class="moz-cite-prefix">On 28/08/18 1:06 AM, Jérôme Godbout
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAAV3L-9R+TcoRrf0L3b++ab7Jg6U2cs9-KsHT_gS3+v5iJESAA@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<div dir="ltr">You will probably need to have the object declared
to the meta type (sorry I don't known the call, but there must
be one into PySide 2, you might want to dig into the doc near
this <a
href="https://doc.qt.io/qtforpython/PySide2/QtCore/QMetaObject.html"
moz-do-not-send="true">https://doc.qt.io/qtforpython/PySide2/QtCore/QMetaObject.html</a>
) and ideally be copiable since you will send the signal from
another thread (from your QRunnable). So the signal will
probably be queued adn therefore will need to copy the arguments
to the signals.</div>
<br>
<div class="gmail_quote">
<div dir="ltr">On Mon, 27 Aug 2018 at 05:14, Frank Rueter |
OHUfx <<a href="mailto:frank@ohufx.com"
moz-do-not-send="true">frank@ohufx.com</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<div class="m_-5304556359810942936markdown-here-wrapper">
<p style="margin:0px 0px 1.2em!important">Hi all,</p>
<p style="margin:0px 0px 1.2em!important">I am trying to
emit a custom object via QObject.Signal from inside a
QRunnable.<br>
The object I am trying to emit throws this error:</p>
<blockquote style="margin:1.2em 0px;border-left:4px solid
rgb(221,221,221);padding:0px
1em;color:rgb(119,119,119);quotes:none">
<p style="margin:0px 0px 1.2em!important">TypeError:
Value types used on meta functions (including signals)
need to be registered on meta type: <i>NameSpace::</i><i>NameSpace</i>::Clip</p>
</blockquote>
<p style="margin:0px 0px 1.2em!important">I tried to trick
it by creating a wrapper class like so</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code class="m_-5304556359810942936hljs m_-5304556359810942936language-python" style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline;white-space:pre-wrap;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important;display:block;overflow-x:auto;padding:0.5em;background:rgb(63,63,63) none repeat scroll 0% 0%;color:rgb(220,220,220)"><span class="m_-5304556359810942936hljs-class"><span class="m_-5304556359810942936hljs-keyword" style="color:rgb(227,206,171)">class</span> <span class="m_-5304556359810942936hljs-title" style="color:rgb(239,239,143)">NodeItem</span><span class="m_-5304556359810942936hljs-params">(QtCore.QObject)</span>:</span>
<span class="m_-5304556359810942936hljs-function"><span class="m_-5304556359810942936hljs-keyword" style="color:rgb(227,206,171)">def</span> <span class="m_-5304556359810942936hljs-title" style="color:rgb(239,239,143)">__init__</span><span class="m_-5304556359810942936hljs-params">(self, node, clip)</span>:</span>
QtCore.QObject.__init__(self)
self.node = node
self.clip = clip
</code></pre>
<p style="margin:0px 0px 1.2em!important">But that crashes
the app when I try to emit it from a QRunnable, even
though it works i the main thread.<br>
</p>
<p style="margin:0px 0px 1.2em!important">I have tried to
find information on how to register meta types but cn
only find C++ info about Q_DECLARE_METATYPE.<br>
This does not seem to exist in Python land though?!</p>
<p style="margin:0px 0px 1.2em!important">Does anybody
have any ideas? I’m kinda stuck with this one.</p>
<p style="margin:0px 0px 1.2em!important">Cheers,<br>
frank</p>
<div
title="MDH:SGkgYWxsLDxic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vdyB0byByZWdpc3RlciBtZXRh
IHR5cGVzIGJ1dCBjbiBvbmx5IGZpbmQgQysrIGluZm8gYWJvdXQgUV9ERUNMQVJFX01FVEFUWVBF
Ljxicj5UaGlzIGRvZXMgbm90IHNlZW0gdG8gZXhpc3QgaW4gUHl0aG9uIGxhbmQgdGhvdWdoPyE8
YnI+PGJyPkRvZXMgYW55Ym9keSBoYXZlIGFueSBpZGVhcz8gSSdtIGtpbmRhIHN0dWNrIHdpdGgg
dGhpcyBvbmUuPGJyPjxicj5DaGVlcnMsPGJyPmZyYW5rPGJyPjxicj48YnI+PC9kaXY+"
style="height:0;width:0;max-height:0;max-width:0;overflow:hidden;font-size:0em;padding:0;margin:0"></div>
</div>
<div class="m_-5304556359810942936moz-signature
m_-5304556359810942936markdown-here-signature">-- <br>
<p> </p>
<table style="width:524px;height:58px" border="0">
<tbody>
<tr>
<td style="text-align:right"><a
href="http://www.ohufx.com" target="_blank"
moz-do-not-send="true"><img
src="http://ohufx.com/images/ohufxLogo_50x50.png"
alt="ohufxLogo 50x50" moz-do-not-send="true"></a>
</td>
<td style="text-align:center"> <br>
</td>
<td style="text-align:left"><strong><span
style="font-size:8pt"><a
href="http://ohufx.com/compositing.html"
target="_blank" moz-do-not-send="true">vfx
compositing</a></span> | <span
style="font-size:8pt"><strong><a
href="http://ohufx.com/customising.html"
target="_blank" moz-do-not-send="true">workflow
customisation and consulting</a></strong>
</span> </strong> </td>
</tr>
<tr>
<td style="text-align:right"> </td>
<td style="text-align:center"> </td>
<td style="text-align:left"><strong><span
style="font-size:8pt"><a
href="http://ohufx.com/compositing.html"
target="_blank" moz-do-not-send="true"> </a></span></strong>
<br>
</td>
</tr>
<tr>
<td style="text-align:right"><a
href="http://www.nukepedia.com/nubridge"
target="_blank" moz-do-not-send="true"><img
src="http://nukepedia.com/images/nuBridge/logo/nuBridge_logo.png"
alt="" moz-do-not-send="true"> </a> </td>
<td style="text-align:center"> <br>
</td>
<td style="text-align:center">
<p style="text-align:left"><a
style="color:#999;font-size:10px;font-family:Arial,Helvetica,sans-serif"
href="http://www.nukepedia.com/nubridge"
target="_blank" moz-do-not-send="true">Your
gateway to over 1,000 free tools... right
inside of Nuke</a> </p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
_______________________________________________<br>
Interest mailing list<br>
<a href="mailto:Interest@qt-project.org" target="_blank"
moz-do-not-send="true">Interest@qt-project.org</a><br>
<a
href="http://lists.qt-project.org/mailman/listinfo/interest"
rel="noreferrer" target="_blank" moz-do-not-send="true">http://lists.qt-project.org/mailman/listinfo/interest</a><br>
</blockquote>
</div>
</blockquote>
<br>
</body>
</html>