[Qt-qml] QML C++ Plugin template in Qt Creator

Jamil Naja jamil.m.naja at gmail.com
Tue Jan 25 15:29:17 CET 2011


Hi

I have a question regarding generating a QML extension plugin using Qt
Creator:

Isn't there a contradiction between the disabling the copy constructor and
declaring  the class as a MetaType (done by QML_DECLARE_TYPE)  ?

The documentation
<http://doc.trolltech.com/latest/qmetatype.html#Q_DECLARE_METATYPE>says that
types that are know to QMetaType should have a public copy constructor.

class MyItem : public QDeclarativeItem

{

.....

Q_DISABLE_COPY(MyItem)
.....
};
QML_DECLARE_TYPE(MyItem)


It would be great if you explain why these two lines are added to the
generated code as well and what are the implications of not having them,
especially since the tutorial
<http://doc.qt.nokia.com/latest/declarative-tutorials-extending-chapter6-plugins.html>on
how to create an extension plugin uses neither of those macros


Thanks
Jamil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20110125/f5d3583a/attachment.html 


More information about the Qt-qml mailing list