How to find out the original Component name during runtime?
-
Hello,
I want to write some sort of editor that is able to create simple QML files. Is it somehow possible to retrieve the component's original name (as it was named in the original QML file) after it has been loaded? Through QMetaObject's className it is only possible to get internal names like
@AVHGradient_QMLTYPE_36
QDeclarativeRectangle_QML_35@
Any ideas?By the way, what's the difference between the QMLTYPE and QML namings above?
Greets,
Bernhard -
"qmlInfo()":http://doc.qt.nokia.com/4.7/qdeclarativeengine.html#qmlInfo is able to extract this information. It uses QDeclarativeMetaType, which unfortunately is private (implementation is "here":http://qt.gitorious.org/qt/qtdeclarative/blobs/master/src/declarative/qml/qdeclarativeinfo.cpp ).
Regards,
Michael -
Thank you Michael,
I already stumbled over this while searching for solutions. Is there any reason why this is not pulic API or rather, are there any plans to make this public API (since something like e.g. QDeclarativeProperty is also publicly available)? I think this would be quite beneficial to the use and management of Qt Quick Components on the C++ side.
Regards,
Bernhard -
Hi,
I don't know of any plans; I'd recommend adding a suggestion at http://bugreports.qt.nokia.com with the what APIs you'd like to see public as well as reasons why.
Regards,
Michael -
Thanks for your reply. I followed your suggestion and opened a report "QTBUG-22029":https://bugreports.qt.nokia.com/browse/QTBUG-22029
Maybe you can have a look at it and comment if I did this correctly, since it's my first feature request to the Trolls. :)Regards,
Bernhard[EDIT: change link to bug id for better recognition, Volker]