<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Signal and slots qRegisterMetaType]]></title><description><![CDATA[<p dir="auto">Hi guys,</p>
<p dir="auto">I'm having a strange problem with some custom typedefs i have defined for smart pointers e.g:<br />
@<br />
namspace example<br />
{<br />
typedef<br />
smartPointer;<br />
}@</p>
<p dir="auto">Then a qthead that emits a signal of this type back to a class that runs on the main gui thread:</p>
<p dir="auto">@namspace example<br />
{<br />
class thread : public QThread<br />
{<br />
Q_Object</p>
<pre><code>   public signals:
  void  send(smartPointer);
</code></pre>
<p dir="auto">}<br />
}@</p>
<p dir="auto">Hopefully this short example makes sense.</p>
<p dir="auto">I have registered this typedef with the @qRegisterMetaType<a target="_blank" rel="noopener noreferrer nofollow ugc">example::smartPointer</a>(smartPointer);@</p>
<p dir="auto">class, and also the QDECLARE_METATYPE(example::smartPointer) macro.</p>
<p dir="auto">However in runtime I get a "cannot queue arguments of type example (Make sure 'example' is a registered using qRegisterMetaType().)" error.</p>
<p dir="auto">any sugestions would be great</p>
]]></description><link>https://forum.qt.io/topic/21196/signal-and-slots-qregistermetatype</link><generator>RSS for Node</generator><lastBuildDate>Fri, 14 Aug 2026 15:04:20 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/21196.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 07 Nov 2012 14:22:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Signal and slots qRegisterMetaType on Mon, 12 Nov 2012 23:42:47 GMT]]></title><description><![CDATA[<p dir="auto">You seem to be missing something in your typedef. I'll assume this is something like<br />
@typedef SomeGiantTypeThatIDontWantToRetypeOrWhatever SmartPointer;@</p>
<p dir="auto">qRegisterMetaType takes a <em>string name</em> of your class e.g. @qRegisterMetaType<a target="_blank" rel="noopener noreferrer nofollow ugc">example::SmartPointer</a>("SmartPointer")@</p>
<p dir="auto">You can call it wherever just as long as your typedef is visible there and before you use it for connecting or access its metadata.<br />
Also, make sure you use Q_DECLARE_METATYPE outside of your example namespace.</p>
]]></description><link>https://forum.qt.io/post/156834</link><guid isPermaLink="true">https://forum.qt.io/post/156834</guid><dc:creator><![CDATA[Chris Kawa]]></dc:creator><pubDate>Mon, 12 Nov 2012 23:42:47 GMT</pubDate></item><item><title><![CDATA[Reply to Signal and slots qRegisterMetaType on Wed, 07 Nov 2012 21:22:52 GMT]]></title><description><![CDATA[<p dir="auto">[quote author="Suths" date="1352298159"]<br />
I have registered this typedef with the @qRegisterMetaType<a target="_blank" rel="noopener noreferrer nofollow ugc">example::smartPointer</a>(smartPointer);@<br />
class[/quote]</p>
<p dir="auto">Where exactly do you call that <em>function</em>?</p>
]]></description><link>https://forum.qt.io/post/156337</link><guid isPermaLink="true">https://forum.qt.io/post/156337</guid><dc:creator><![CDATA[DerManu]]></dc:creator><pubDate>Wed, 07 Nov 2012 21:22:52 GMT</pubDate></item></channel></rss>