<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="markdown-here-wrapper" data-md-url="Thunderbird"
style="" markdown-here-wrapper-content-modified="true">
<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="hljs language-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; 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); -moz-text-size-adjust: none;"><span class="hljs-class"><span class="hljs-keyword" style="color: rgb(227, 206, 171);">class</span> <span class="hljs-title" style="color: rgb(239, 239, 143);">NodeItem</span><span class="hljs-params">(QtCore.QObject)</span>:</span>
<span class="hljs-function"><span class="hljs-keyword" style="color: rgb(227, 206, 171);">def</span> <span class="hljs-title" style="color: rgb(239, 239, 143);">__init__</span><span class="hljs-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:SGkgYWxsLDxicj48YnI+SSBhbSB0cnlpbmcgdG8gZW1pdCBhIGN1c3RvbSBvYmplY3QgdmlhIFFPYmplY3QuU2lnbmFsIGZyb20gaW5zaWRlIGEgUVJ1bm5hYmxlLjxicj5UaGUgb2JqZWN0IEkgYW0g
dHJ5aW5nIHRvIGVtaXQgdGhyb3dzIHRoaXMgZXJyb3I6PGJyPiZndDtUeXBlRXJyb3I6IFZhbHVl
IHR5cGVzIHVzZWQgb24gbWV0YSBmdW5jdGlvbnMgKGluY2x1ZGluZyBzaWduYWxzKSBuZWVkIHRv
IGJlIHJlZ2lzdGVyZWQgb24gbWV0YSB0eXBlOiBIaWVybzo6UHl0aG9uOjpDbGlwPGJyPjxicj5J
IHRyaWVkIHRvIHRyaWNrIGl0IGJ5IGNyZWF0aW5nIGEgd3JhcHBlciBjbGFzcyBsaWtlIHNvPGJy
PjxkaXYgY2xhc3M9Im1vei1zaWduYXR1cmUgbWFya2Rvd24taGVyZS1zaWduYXR1cmUiPjxicj5g
YGBweXRob248YnI+Y2xhc3MgTm9kZUl0ZW0oUXRDb3JlLlFPYmplY3QpOjxicj4mbmJzcDsmbmJz
cDsmbmJzcDsgZGVmIF9faW5pdF9fKHNlbGYsIG5vZGUsIGNsaXApOjxicj4mbmJzcDsmbmJzcDsm
bmJzcDsmbmJzcDsmbmJzcDsmbmJzcDsmbmJzcDsgUXRDb3JlLlFPYmplY3QuX19pbml0X18oc2Vs
Zik8YnI+Jm5ic3A7Jm5ic3A7Jm5ic3A7Jm5ic3A7Jm5ic3A7Jm5ic3A7Jm5ic3A7IHNlbGYubm9k
ZSA9IG5vZGU8YnI+Jm5ic3A7Jm5ic3A7Jm5ic3A7Jm5ic3A7Jm5ic3A7Jm5ic3A7Jm5ic3A7IHNl
bGYuY2xpcCA9IGNsaXA8YnI+YGBgPGJyPkJ1dCB0aGF0IGNyYXNoZXMgdGhlIGFwcC48YnI+PGJy
PkkgaGF2ZSB0cmllZCB0byBmaW5kIGluZm9ybWF0aW9uIG9uIGhvdyB0byByZWdpc3RlciBtZXRh
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="moz-signature markdown-here-signature">-- <br>
<p> </p>
<!-- A { text-decoration:none } -->
<table style="width: 524px; height: 58px;" border="0">
<tbody>
<tr>
<td style="text-align: right;"><a
href="http://www.ohufx.com"><img
src="http://ohufx.com/images/ohufxLogo_50x50.png"
alt="ohufxLogo 50x50"></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">vfx
compositing</a></span> | <span style="font-size:
8pt;"><strong><a
href="http://ohufx.com/customising.html">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"> </a></span></strong>
<br>
</td>
</tr>
<tr>
<td style="text-align: right;"><a
href="http://www.nukepedia.com/nubridge"><img
src="http://nukepedia.com/images/nuBridge/logo/nuBridge_logo.png"
alt=""> </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">Your
gateway to over 1,000 free tools... right inside of
Nuke</a>
<style><!--A{text-decoration:none}--></style> </p>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>