Simon Hausmann schreef op 18-6-2015 om 09:08:
>
>>> * metatype registration is problematic with namespaced types, as the macro
>>> extracts the name of the type through the preprocessor. People can very
>>> easily end up registering the type multiple times with different
>>> (qualified vs non qualified) names.
>> Same counter-arguments as above, but Q_DECLARE_METATYPE with namespaces is
>> actually easily fixed by internally prepending ::, thus making sure the
>> argument is a fully-qualified name.
> I'm not sure I understand that point. If we have
>
> namespace QtFoo {
> struct MyType {
> ...
> }
> Q_DECLARE_METATYPE(MyType)
> }
>
> then how can we register MyType fully qualified in the type system?
>
> Or would the idea be to place the Q_DECLARE_METATYPE outside of the namespace?
That would be consistent with how you are supposed to declare things
like enums inside classes right now, so yes, that makes perfect sense.
André
_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development