Need to set NMEA position source in application configuration, Qt 6.6.
-
Hi. I have QWidgets application made in Qt Creator. It has multiple tabs of Ui, one of them is QQuickWidget, whith QML-map in it. GPS reciver connected to COM-port and NMEA data is getting by QML side. Everything is working, but I want to be able to set COM-port number without rebuilding the application. In Qt5 I passed COM-port number to QML side from QWidgetsSide using "setProperty()". But after migrating to Qt6 the "NMEA source" plugin paramemter became "write-once property". So I am confused with this situation.
https://doc.qt.io/qt-6/qml-qtpositioning-pluginparameter.html
Somehow, I need to pass COM-port number to the QML-object during its creation, but how to do it in Qt Creator?
-
This theme works for me:
https://doc.qt.io/qt-6/qtqml-cppintegration-exposecppattributes.html
But I have to edit function setupUi() in generated file ui_mainwindow.h.