Solved Design studio and Creator for Device creation (rPi/imx6 etc...) c++ backend issue
-
Hello,
I'm building my ui with design studio 1.4, and then using creator 4.12 to create my backend.
I am deploying app via boot2qt.
It works fine, I followed the various webinars and documents like :https://doc.qt.io/qt-5/qtqml-cppintegration-overview.html
and
https://doc.qt.io/qtdesignstudio/quick-converting-ui-projects.htmlMy problem comes after I attached the backend in creator. If i want to modify the UI again in design studio, the import in the qml file that is linked to the qmlRegisterType<> in my main.cpp is not found of course, it is only found in creator.
And thus, design studio doesn't render the qml file because of the error, so I cannot edit graphically.So what would be the best workflow?
- completely finish the ui, then go in creator and doesn't look back or make only minor adjustements via the text editor?
- find a way to tell design studio that the backend component exists and it can use it? (I would prefer this)
Basically I have in main.cpp:
qmlRegisterType<BackEnd>("dt.backend", 1, 0, "BackEnd");
and in the qml loaded by the engine
... import dt.backend 1.0 // QML module not found Item { id: mainPage width: 1024 height: 600 BackEnd { id: backend } ...
If anyone has an idea that would be awesome.
Thank you.Edit:
Could this be what I am looking for?
https://doc.qt.io/qt-5/qtqml-modules-qmldir.html -
The simplest solution is to create a simple QML mockup for your C++ backend.
A simple example for this approach is the welcome page for Qt Design Studio: https://github.com/qt-creator/qt-creator/tree/master/src/plugins/studiowelcome/qml/welcomepage.In your case mockdata would contain a simple QML stub for dt.backend.
-
Hello Thomas,
Thank you for your reply. I'll try this approach.
Best Regards.