[Interest] qRegisterMetaType<QList<QSslError> > and type flags

Thiago Macieira thiago.macieira at intel.com
Sat Jan 5 13:22:06 CET 2013


On sábado, 5 de janeiro de 2013 12.39.16, Jan Kundrát wrote:
> On Saturday, 5 January 2013 03:12:48 CEST, Thiago Macieira wrote:
> >> - qRegisterMetatype<NS::Class*>();
> >> - using namespace NS; qRegisterMetaType<Class*>();
> >> - namespace NS { void reg() { qRegisterMetaType<Class*>(); } } NS::reg();
> >> - typedef NS::Class Class; qRegisterMetaType<Class*>();
> > 
> > Why don't they work?
> 
> I need these for a QSignalSpy, the full type name is actually
> Imap::Mailbox::ImapTask*. The error message I get when using any of these
> is the following:
> 
>   Don't know how to handle 'ImapTask*', use qRegisterMetaType to register
> it.

This indicates that your signal has a problem. Please use the full name with 
namespaces there.

> The Imap::Mailbox::ImapTask class in question defines the signal with a
> non-namespaced argument, i.e. like this:
> 
>   signals:
>     void completed(ImapTask *task);

Yup, that's the problem.

> And it also seems that the best approach is to always use the
> fully-namespaced version everywhere, including the signal definition in the
> class' definition, the qRegisterMetaType and the SIGNAL macro.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130105/76f7466e/attachment.sig>


More information about the Interest mailing list