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
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Interest mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/interest
