[Qt-interest] Register metatype in multiple namespaces

Arnold Krille arnold at arnoldarts.de
Thu Jun 11 20:37:29 CEST 2009


On Thursday 11 June 2009 20:06:29 Jean-Olivier Racine wrote:
>  I tried and unfortunetly, it did not fix the problem. In order for the MOC
> to recognize the SIGNAL/SLOT, it seems that I have to put the declarations
> exacly as they are declared in the class (not relative to the current
> scope, but to the scope of the SIGNAL/SLOT declaration).
>  But when I do this, the MOC then tells me that the two types do not match
> and that therefore a connection cannot be made between this signal and this
> slot.

moc and the meta-object system don't know nothing about namespaces.

When your objects are defined in a namespace, you always have to give the full 
namespace path when defining the signals/slots. Because the meta-object will be 
defined outside the namespace. And when connecting signals/slots you also have 
to use the full namespace path because the signature computed by moc has the 
full path.

Arnold
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090611/20cd1f67/attachment.bin 


More information about the Qt-interest-old mailing list