Hello, I'm trying to "modernize" a large code base that just migrated from Qt5 to Qt6. Our code is using a few singleton objects that used to be exported into the QML runtime via `qmlRegisterSingletonInstance()`. But as it is now recommended to move away from `qmlRegisterType()` (in favour of letting the QML Module creation infrastructure take care of this), I'm expecting `qmlRegisterSingletonInstance()` also to be deprecated.
I did find https://doc.qt.io/qt-6/qtqml-cppintegration-exposecppstate.html and its use of `QMLEngine::singletonInstance<...>(...)` to access a QML singleton from C++, this method requires my singleton code to be aware of the `QMLEngine` object. Is there a way to do the inverse, i.e. register a C++ function (pointer) through which the `QMLEngine` would access the singleton, just as was the case with `qmlRegisterSingletonInstance()` ? Thanks, -- ...ich hab' noch einen Koffer in Berlin...
_______________________________________________ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest