Qt C++ Widget Template for Torizon

Hi everyone, I’m new to the embedded world and have little experience with torizon.
I would like to know if there is a way to use a Qt C++ template but using Qt Widget, or simply if it is possible to import a project developed with QtCreator into the new extension for VsCode.

I have a verdin imx8mm and I’m using Torizon Os 6.5 and my Qt application is written in Qt 6

Thank you in advance for your help

Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello,

For your requirement of using a Qt C++ template with Qt Widgets on Torizon, the VSCode Torizon IDE Extension primarily focuses on QML for UI development. However, it is still possible to develop applications using Qt Widgets. You can manually adjust the provided Qt6 C++ QML template to suit your needs for Qt Widgets. This involves modifying the CMakeLists.txt file in your project to include the appropriate Qt Widget libraries and adjusting your application’s source code accordingly.

Regarding importing a project developed with Qt Creator into the VSCode Torizon IDE Extension, while there is no direct import feature, you can manually set up your project in VSCode. You would need to create a new project using the Torizon IDE Extension and then copy your existing Qt Creator project files into this new VSCode project. Ensure to adjust the Dockerfile and CMakeLists.txt to match the requirements of your application, including any necessary Qt Widget libraries.

Remember, the Dockerfile provided by the Torizon IDE Extension sets up the environment for your application, so you might need to customize it to include the development files for Qt Widgets if they are not already included.

Although the process requires some manual adjustments, it allows you to leverage the benefits of the Torizon IDE Extension, such as easy deployment and debugging on your Verdin iMX8MM module running Torizon OS 6.5.

Best regards,
Toradex AI Assistant

Please, also check if these links can help you solve your problem:

Qt on Torizon OS | Toradex Developer Center.

Greetings @ellebi,

At the moment we don’t have a Qt Widgets template available: GitHub - toradex/vscode-torizon-templates: VS Code Torizon Integrated Development Environment Templates

This is something that has been discussed, but nothing concrete has been laid out yet. For templates we do take open source contributions as well, so if you or anyone else was interested in creating a Qt Widgets template our team would gladly take the contribution.

All that said, I can bring up your request here to our team and see if that gets anything moving. Though I can’t guarantee anything in the short term at the moment.

simply if it is possible to import a project developed with QtCreator into the new extension for VsCode.

There is no import functionality for Qt Creator projects at the moment.

Best Regards,
Jeremias

Ok thank you very much, I’ll do some testing.
While I’m at it, I also ask you if it is possible to crosscompile from QtCreator once the project has been created via the VsCode extension ?

As a side-note we do have a Qt 6 C++ QML template. Depending on how your previous project is laid out it may be possible to just adapt this template for use with your Qt Widgets projects. You’ll probably need to add the packages for your project as described here: Add Packages, Libraries and Tools | Toradex Developer Center

While I’m at it, I also ask you if it is possible to crosscompile from QtCreator once the project has been created via the VsCode extension ?

Just to understand, what would be the goal here? Have the project and everything in VSCode but use QtCreator to build the project? What would be the purpose of doing it like this?

You can from VSCode open your project in QtCreator as described here: vscode-torizon-templates/cppQML/.doc at dev · toradex/vscode-torizon-templates · GitHub

But using QtCreator to build is a different story since our extension uses containers to build applications.

Best Regards,
Jeremias

Just for convenience, anyway thanks for the reply

Were you able to adapt your previous Qt Widgets application? If there was some kind of blocker maybe you can describe it, and we can see if something can be done in the interim.

Best Regards,
Jeremias