QtDesignStudio/FAQ: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
mNo edit summary
(Finished the Beta docs of Design Studio & MCU section)
Line 17: Line 17:


For full overview of the differences please refer to [https://doc.qt.io/QtForMCUs-2.8/qtul-qtquick-differences.html QtForMCUs docs].
For full overview of the differences please refer to [https://doc.qt.io/QtForMCUs-2.8/qtul-qtquick-differences.html QtForMCUs docs].
===How to configure the MCU SDK in Design Studio?===
You can set it by navigating to Edit->Preferences->Device->MCU. After setting it, please restart the Design Studio.


===I'm starting a project for MCU, what should I remember at the very beginning?===
===I'm starting a project for MCU, what should I remember at the very beginning?===
Line 23: Line 26:
The components and their properties available in the Design Studio editor should respect the MCU rules.  However, if you plan to edit the QML code manually, you may end up creating code that is not valid for the MCU and you won't notice it at first glance.  
The components and their properties available in the Design Studio editor should respect the MCU rules.  However, if you plan to edit the QML code manually, you may end up creating code that is not valid for the MCU and you won't notice it at first glance.  


In this case it is worth configuring 'Qt for MCUs SDK' in 'Preferences->Devices->MCU'. The kit can be obtained from the Qt Maintenance Tool (an appropriate license is required). All you need to do is set the appropriate SDK installation path and reopen/create your project. With the MCUs SDK configured, Design Studio will automatically add an additional deployment step to your project that generates MCU-compliant C++ code. If something goes wrong during this process, such as using properties that are not available in Qt for MCU, you will see an error in the console.  
In this case it is worth configuring Qt for MCUs SDK as mentioned in the previous question. The kit can be obtained from the Qt Maintenance Tool (an appropriate license is required). All you need to do is set the appropriate SDK installation path and reopen/create your project. With the MCUs SDK configured, Design Studio will automatically add an additional deployment step to your project that generates MCU-compliant C++ code. If something goes wrong during this process, such as using properties that are not available in Qt for MCU, you will see an error in the console.  


For example, the following code for the Rectangle is perfectly fine, you can paste it into your MCU project in the Design Studio and run it:  
For example, the following code for the Rectangle is perfectly fine, you can paste it into your MCU project in the Design Studio and run it:  
Line 44: Line 47:
border.width: 10  
border.width: 10  


/SomePath/SomeProject//Screen01.ui.qml:23:9: error: Binding on property of unknown type  
/SomePath/SomeProject/Screen01.ui.qml:23:9: error: Binding on property of unknown type  


rotation: 45  
rotation: 45  
}}
}}
===I've created a new project for MCUs, and I see qmlprojectexporter warnings in the console. How do I get rid of them?===
This might happen despite configuring the MCU SDK properly.  Please let us know whenever such an issue arises and report a ticket [http://bugreports.qt.io/ here].
General information about qmlprojectexporter can be found at its dedicated [https://doc.qt.io/archives/QtForMCUs-2.7/qtul-qmlproject-reference.html page].
===I want to compile and/or deploy my application to MCU target in Qt Design Studio, how do I do that?===
You need to use Qt Creator for that, Design Studio does not support this workflow.
In Design Studio MCU project containing .qmlimport file needs to be created. It will contain CMakeLists.txt file that you can use to open Qt Creator project.
If instead you are in a regular Qt (non-MCU) project, you can enable CMakeLists file generation with ''File > Export Project > Enable CMake Generator''.
===I wanted to use <REPLACE_WITH_FEATURE> and Qt Ultralite complains that it is not available/supported, why?===
One has to be mindful that MCU kit is tailored for embedded devices, hence, some of its functionality has been limited to favor efficiency. This includes QML/JS functionalities that are described [https://doc.qt.io/QtForMCUs-2.8/qtul-javascript-environment.html here] and [https://doc.qt.io/QtForMCUs-2.8/qtul-qtquick-non-api-differences.html#script-expressions here]. In general, MCU JavaScript environment does not support:
* proprety var,
* property variant,
* functions,
* raw arrays (var arr = []) and JS container types like Array, Map, Set etc.,
* inline components,
* object literals.
Moreover, some types and their availability or how they work is different. This also differs between hardware targets. Please refer to the following sources:
* https://doc.qt.io/QtForMCUs-2.8/
* https://doc.qt.io/QtForMCUs-2.8/qtul-supported-platforms.html
* https://doc.qt.io/QtForMCUs-2.8/qtul-qtquick-differences.html
* https://doc.qt.io/QtForMCUs-2.8/qtul-overview.html
===I want to profile my application, how to do it?===
The documentation is available [https://doc.qt.io/QtForMCUs-2.8/qtul-performance-logging.html here], and [https://doc.qt.io/QtForMCUs-2.8/quickultralite-watch-example.html here] you can find a benchmark demo. Please note that benchmarking is meant for target devices and most of the metrics might not be implemented for desktop environments.
===Where are the project build files located?===
You can set the path to the build directory in the Qt for MCUs Deploy step. First you need to ensure that you have MCU SDK installed and set correctly in Design Studio.
Having the correct SDK, go to the ''Set runtime configuration for the project'' (cog icon in the bottom left corner) and under Deployment you will see Qt for MCUs Deploy Step, expand it and you will see the default build directory that you can change anytime.
===I added a new control over File->New file but it doesn't work. What did I do wrong?===
Unfortunately, the distinction between regular Qt MPU and MCU is not yet well defined in Qt Design Studio.    The same set of files is available for MPU and MCU, however, it is not correct and will be adjusted in the future. To get the list of available types in Qt Quick Ultralite please refer to the [https://doc.qt.io/QtForMCUs-2.8/qtul-qmltypes.html docs].


==Qt Bridge for Figma export==
==Qt Bridge for Figma export==

Revision as of 12:40, 25 September 2024

En Ar Bg De El Es Fa Fi Fr Hi Hu It Ja Kn Ko Ms Nl Pl Pt Ru Sq Th Tr Uk Zh

This page contains technical FAQs for Design Studio, its MCU support as well as Figma integration.

Design Studio & MCU

What are the main differences between Qt Quick and Qt Ultralite?

There are several differences due to optimizations required by the embedded world. These include:

  • Some QML types are unavailable in Qt Ultralite. The available types are listed here.
  • Some of the types have additional constraints what is described here.
  • The QML/JS support is limited for MCU to the features described here.

For full overview of the differences please refer to QtForMCUs docs.

How to configure the MCU SDK in Design Studio?

You can set it by navigating to Edit->Preferences->Device->MCU. After setting it, please restart the Design Studio.

I'm starting a project for MCU, what should I remember at the very beginning?

You can start immediately and create a new project using the Qt for MCUs presets.

The components and their properties available in the Design Studio editor should respect the MCU rules. However, if you plan to edit the QML code manually, you may end up creating code that is not valid for the MCU and you won't notice it at first glance.

In this case it is worth configuring Qt for MCUs SDK as mentioned in the previous question. The kit can be obtained from the Qt Maintenance Tool (an appropriate license is required). All you need to do is set the appropriate SDK installation path and reopen/create your project. With the MCUs SDK configured, Design Studio will automatically add an additional deployment step to your project that generates MCU-compliant C++ code. If something goes wrong during this process, such as using properties that are not available in Qt for MCU, you will see an error in the console.

For example, the following code for the Rectangle is perfectly fine, you can paste it into your MCU project in the Design Studio and run it:

Rectangle { 
    width: 200 
    height: 200 
    visible: true 
    anchors.centerIn: parent 
    color: "red" 
    rotation: 45 
    border.width: 10 
    border.color: "green"  
}

However, a Rectangle type for MCU does not have border and rotation properties. If you configure the MCU SDK kit, you will see errors in the console and Design Studio won't be able to run the project/generate a preview:

/SomePath/SomeProject/Screen01.ui.qml:24:9: error: Group property of unknown type

border.width: 10

/SomePath/SomeProject/Screen01.ui.qml:23:9: error: Binding on property of unknown type

rotation: 45

I've created a new project for MCUs, and I see qmlprojectexporter warnings in the console. How do I get rid of them?

This might happen despite configuring the MCU SDK properly. Please let us know whenever such an issue arises and report a ticket here.

General information about qmlprojectexporter can be found at its dedicated page.

I want to compile and/or deploy my application to MCU target in Qt Design Studio, how do I do that?

You need to use Qt Creator for that, Design Studio does not support this workflow.

In Design Studio MCU project containing .qmlimport file needs to be created. It will contain CMakeLists.txt file that you can use to open Qt Creator project.

If instead you are in a regular Qt (non-MCU) project, you can enable CMakeLists file generation with File > Export Project > Enable CMake Generator.

I wanted to use <REPLACE_WITH_FEATURE> and Qt Ultralite complains that it is not available/supported, why?

One has to be mindful that MCU kit is tailored for embedded devices, hence, some of its functionality has been limited to favor efficiency. This includes QML/JS functionalities that are described here and here. In general, MCU JavaScript environment does not support:

  • proprety var,
  • property variant,
  • functions,
  • raw arrays (var arr = []) and JS container types like Array, Map, Set etc.,
  • inline components,
  • object literals.

Moreover, some types and their availability or how they work is different. This also differs between hardware targets. Please refer to the following sources:

I want to profile my application, how to do it?

The documentation is available here, and here you can find a benchmark demo. Please note that benchmarking is meant for target devices and most of the metrics might not be implemented for desktop environments.

Where are the project build files located?

You can set the path to the build directory in the Qt for MCUs Deploy step. First you need to ensure that you have MCU SDK installed and set correctly in Design Studio.

Having the correct SDK, go to the Set runtime configuration for the project (cog icon in the bottom left corner) and under Deployment you will see Qt for MCUs Deploy Step, expand it and you will see the default build directory that you can change anytime.

I added a new control over File->New file but it doesn't work. What did I do wrong?

Unfortunately, the distinction between regular Qt MPU and MCU is not yet well defined in Qt Design Studio. The same set of files is available for MPU and MCU, however, it is not correct and will be adjusted in the future. To get the list of available types in Qt Quick Ultralite please refer to the docs.

Qt Bridge for Figma export

Design Studio import of data from Qt Bridge for Figma

Lorem Ipsum1?

Lorem Ipsum

Lorem Ipsum2?

Lorem Ipsum

Lorem Ipsum3?

Lorem Ipsum