Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to expose QMap to QML
Hachaso last edited by
I have a QMap<QString, QObject*> that I would like to expose to the QML somehow.
How can this be done?
akrynski last edited by
I think you should write your own class that inherits from QMap and than register it with
qmlRegisterType<yourQMapClass_as_class>("yourMap_as_library", 1,0, "YourMap_as_type");
and then simply include library into qml file with "import yourMap_as_library 1.0"
and use it: