non-Q_OBJECT/Q_GADGET based template class registration in QML
-
Hi all,
I would like to register non-Q_OBJECT/Q_GADGET class in qml. In fact it's template class that wraps int32/64.
I started investigating arround QQmlValueTypeProvider, but seems didn't make all neccessary registrations.Here is code https://git.semlanik.org/semlanik/qtprotobuf/src/dev_semlanik
This line examples/simplechat/main.qml:125 is trying to assign property of type qtprotobuf::fixed32 and as expected throws:
qrc:/main.qml:125 Invalid property assignment: unsupported type "qtprotobuf::fixed32"What are preconditions for MetaType to be accessible out of QQmlValueTypeProvider?
Thank you in advance.
Regards,
Alexey.PS: Yes I know that there are some "public" ways to handle this, but it's on my own to support it in future.
-
@KroMignon, you are partially right, using public API yes, it's only possible to register classes with generated staticMetaObject. But there are hidden ways as always. One of examples QVector3D, I tried to reproduce stuff applied on QVector3D, but it doesn't work for me.