c++ - How to create custom basic type in QML? -


I do not mean QObject or high derivative element, but basic type - bool, int, real and so on.

There is no excavation in the sources for this too ...

So any information is appreciated.

After

I think you want to register more complex types, from int, boole, real, because They already exist.

You can not do it in QT 4.x. It is possible in QT5 (QML2) but there is no public API. If you still want to do this, you need to implement a QQmlValueTypeProvider (qqmlglobal_p.h) and make QQmlValueTypeBase & lt in some code How to dig your own, there will be no need to see the documentation as there

. & Gt; For each type of sub-category (qqmlvaluetype_p.h) then register your value type provider with QQml_addValueTypeProvider () () in the registerTypes of your plugin

An example may look at yourself QGeoCoordinate, QGeoRectangle, Etc. are from QtLocation module.

Good luck.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -