引用第1楼cavendish于2013-05-14 23:56发表的 :
http://doc-snapshot.qt-project.org/4.8/qml-extending.html
QML relies heavily on Qt's meta object system and can only instantiate classes that derive from QObject. For visual element types, this will usually mean a subclass of QDeclarativeItem; for models used with the view elements, a subclass of QAbstractItemModel; and for arbitrary objects with properties, a direct subclass of QObject.