Skip to content
Snippets Groups Projects

Thermo: fixes in project configuration for MCUs

Merged Rafal Stawarski requested to merge QDS-9838-thermo-project into master
3 unresolved threads

Task-number: QDS-9838

Changes:

  • fixed qmlproject configuration
  • added MCU modules for Thermo and ThermoConfiguration
  • fixed UI glitches (scrollbar painted on the TopBar and english translation non-checked by default)
  • fixed translations - I added .qm files so we can use it as read-only example. We can consider adding a full translations support in DS, along with:
    https://doc.qt.io/qtdesignstudio/multilanguage-tutorial.html

Tested with DS and QtCreator (CMake), looks and works fine. To avoid the '0error' as temperature issue (appropriate file selector support), the following patch is required: https://codereview.qt-project.org/c/qt-creator/qt-creator/+/602773

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
50 117 /* List of plugin directories passed to QML runtime */
51 importPaths: [ "imports", "asset_imports", "i18n" ]
118 importPaths: [ "imports" ]
119
120 ModuleFiles {
121 files: [
122 "imports/Thermo/Thermo.qmlproject",
123 "imports/ThermoConfiguration/ThermoConfiguration.qmlproject"
124 ]
125 }
52 126
53 127 /* Required for deployment */
54 128 targetDirectory: "/opt/thermo"
55 129
56 130 //selectors: "metric" or "imperial", "big", "static"
57 fileSelectors: [ "metric" ]
  • Instead of removing it, replace it with QDS.fileSelectors: ["metric"]

    QDS prefix tells MCUs configurator to skip it. MCU prefix in turn should be skipped by QDS. Nodes and properties without prefixes are common and shared between configurations unless they are unknown/ignored by environment.

    Also notice that it's fileselector_S_ in qtquick. FileSelector without S was a mistake on MCUs side and should be replaced eventually, they are aware of it.

    Also add "big" selector to look similar to MCUs build.

  • Please register or sign in to reply
  • 52 126
    53 127 /* Required for deployment */
    54 128 targetDirectory: "/opt/thermo"
    55 129
    56 130 //selectors: "metric" or "imperial", "big", "static"
    57 fileSelectors: [ "metric" ]
    131 MCU.Config {
    132 fileSelector: [ "metric" ]
    133 defaultFontFamily: "Roboto"
    134 }
    58 135
    59 136 qtForMCUs: true
    60 137
    61 138 qt6Project: true
    139
    140 multilanguageSupport: true
      1. If you build this project with real Qt for MCUs, you can notice that it's a build of "big" config. But QtQuick in QDS runs a "small" config because it's a default one without fileselectors.

      You can verify it by adding "big" in fileselectors of the main qmlproject.

      I think it might be caused by us still using old CMakeLists here that is used by MCUs and it uses big config if it's a desktop build (line 165 in CMakeLists).

      If we don't want to change CMakeLists right now, you can just add "big" to fileselectors and leave it for now, it will look kind of the same. Or we have to ditch the current CMakeLists and replace it with the new template and verify that qmlproject is good enough.

      1. While we are on the fileselectors - qmlproject nodes and properties with "MCU." prefix are considered MCU-specific and should be ignored or deprioritized by QDS. You can use "QDS." prefix if the property exists only for QDS/QtQuick compatibility, it will make the property or node invisible for Qt for MCUs qmlproject build. So you can use QDS.fileSelectors and MCU.Config { fileSelector } at the same time in the same file. The patch that is linked in the MR description should consider that as well, however I think that the patch breaks the intended prefix logic.

      2. After running and building the demo in QDS and in MCUs, translations in QDS stopped working. I noticed that .qm files changed on the disk. They are binary, but de_DE clearly changed from 3KB to 33Bytes. I think it might be linked to multilanguageSupport overriding the translation binaries you provided. I think maybe it's worth deactivating it.

      3. Also I encountered a visual issue in QtQuick related to "Places View" or something adjusted to it. To reproduce it: run the example in QDS, select any room, go back to places. Now you have an almost 100px gap on the most-left side of the rooms view and if you scroll to the end of the list you'll notice that the last card can't be fully displayed - it ends behind the screen.

      • I updated the CMakeLists.txt according to the current MCU template, saving the 'big' and 'small' run targets
      • I removed the MCU.Config.fileSelector because there must be a bug here. The property interferes with CMake selectors (according to the docs it shouldn't, so to me it's a buggy behavior) and makes the mess in the UI. This is what it looks like when we have MCU.Config.fileSelector: ["metric", "big"] + thermo_small target (just 'metric' selector). The same thing happens if we define the CMake target without any selectors: Screenshot_2024-11-18_140751 Screenshot_2024-11-18_140758
      • Added QDS.fileSelectors: [ "metric", "big" ], so 'big' is now the default in QDS
      • The 'big' variant is the default in QtCreator because it seems to sort the available targets alphabetically
      • I removed the multilanguageSupport property, didn't see any translation problems afterwards
      • I wasn't aware of the fileSelector[s] bug + separation of QDS and MCU properties. With that in mind + checking that QDS.fileSelectors works fine without any changes to QDS, I'm rolling back my patch: https://codereview.qt-project.org/c/qt-creator/qt-creator/+/604996
      • I fixed the positioning bug in the places view
      Edited by Rafal Stawarski
    • Looks good now, thanks!

    • Please register or sign in to reply
  • Aleksei German requested changes

    requested changes

  • Rafal Stawarski added 2 commits

    added 2 commits

    • 2630f482 - Thermo: new CMake configuration
    • 7d6e2e47 - Thermo: mainItem x-positioning fix

    Compare with previous version

  • Aleksei German approved this merge request

    approved this merge request

  • mentioned in commit 414082fd

  • Please register or sign in to reply
    Loading