Il 10/07/2015 11:05, Curtis Mitch ha scritto:
So QQuickItem, for example, should have Q_DECLARE_TYPEINFO?
No, because you can't put a QQuickItem in a container, since you can't copy it. You can create a container of pointers to QQuickItems, but pointers are automatically OK:
http://code.woboq.org/qt5/qtbase/src/corelib/global/qtypeinfo.h.html#79
And please, whenever you add a new type (not just class, *any* type, incl. enums, but excluding QFlags (which are automatically primitive)),
^ and pointers.
What happens if you don't use the macro for a type? Do containers assume the worst about that type (that it's complex, etc.)?
Yes, complex is the default. For QList, that means that every single object it contains will be allocated on the heap with new.
HTH, -- Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Software Engineer KDAB (UK) Ltd., a KDAB Group company | Tel: UK +44-1625-809908 KDAB - The Qt Experts
smime.p7s
Description: Firma crittografica S/MIME
_______________________________________________ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development