From 86f47fa5113d523dae92ead578886d4583eb1c99 Mon Sep 17 00:00:00 2001 From: Rafal Stawarski <ext-rafal.stawarski@qt.io> Date: Thu, 7 Nov 2024 13:30:25 +0100 Subject: [PATCH 1/3] Thermo: fixes in project configuration for MCUs Task-number: QDS-9838 --- examples/thermo/CMakeLists.txt | 4 +- examples/thermo/LanguageDialog.qml | 2 +- examples/thermo/ScheduleView.ui.qml | 4 +- examples/thermo/i18n/qml_de_DE.qm | Bin 0 -> 2158 bytes .../{thermo.de_DE.ts => i18n/qml_de_DE.ts} | 6 +- examples/thermo/i18n/qml_ja_JP.qm | Bin 0 -> 1863 bytes .../{thermo.ja_JP.ts => i18n/qml_ja_JP.ts} | 6 +- .../thermo/imports/Thermo/Thermo.qmlproject | 16 +++ .../ThermoConfiguration.qmlproject | 12 ++ examples/thermo/thermo.qmlproject | 132 ++++++++++++++---- 10 files changed, 145 insertions(+), 37 deletions(-) create mode 100644 examples/thermo/i18n/qml_de_DE.qm rename examples/thermo/{thermo.de_DE.ts => i18n/qml_de_DE.ts} (97%) create mode 100644 examples/thermo/i18n/qml_ja_JP.qm rename examples/thermo/{thermo.ja_JP.ts => i18n/qml_ja_JP.ts} (97%) create mode 100644 examples/thermo/imports/Thermo/Thermo.qmlproject create mode 100644 examples/thermo/imports/ThermoConfiguration/ThermoConfiguration.qmlproject diff --git a/examples/thermo/CMakeLists.txt b/examples/thermo/CMakeLists.txt index 38551171..04649953 100644 --- a/examples/thermo/CMakeLists.txt +++ b/examples/thermo/CMakeLists.txt @@ -23,8 +23,8 @@ set(MODULE_QML_FILES imports/Thermo/Room.qml) set(TRANSLATION_FILES - thermo.de_DE.ts - thermo.ja_JP.ts) + i18n/qml_de_DE.ts + i18n/qml_ja_JP.ts) set(DEFAULT_FONT_FAMILY "Roboto") set(FONT_FILES NotoSansArabic-Regular.ttf diff --git a/examples/thermo/LanguageDialog.qml b/examples/thermo/LanguageDialog.qml index 8e357342..99a42913 100644 --- a/examples/thermo/LanguageDialog.qml +++ b/examples/thermo/LanguageDialog.qml @@ -126,7 +126,7 @@ Rectangle { id: english text: "English" flag: "assets/UK.png" - checked: Qt.uiLanguage == "" + checked: Qt.uiLanguage == "" || Qt.uiLanguage == "en-150" enabled: !checked Connections { diff --git a/examples/thermo/ScheduleView.ui.qml b/examples/thermo/ScheduleView.ui.qml index cda0e7dc..6c64debd 100644 --- a/examples/thermo/ScheduleView.ui.qml +++ b/examples/thermo/ScheduleView.ui.qml @@ -95,8 +95,8 @@ ThermoView { Rectangle { id: scrollBar - y: -(roomList.height - scrollBar.height) * roomList.contentItem.y - / (roomList.contentItem.height - roomList.height) + y: Math.min(Math.max(0, -(roomList.height - scrollBar.height) * roomList.contentItem.y + / (roomList.contentItem.height - roomList.height)), roomList.height - scrollBar.height) anchors.horizontalCenter: separator.horizontalCenter implicitWidth: 4 implicitHeight: 30 diff --git a/examples/thermo/i18n/qml_de_DE.qm b/examples/thermo/i18n/qml_de_DE.qm new file mode 100644 index 0000000000000000000000000000000000000000..a7154649a3de20d2ce49bf85a10e22f9332b96de GIT binary patch literal 2158 zcma)6ONbO#6g|^_JMB0lDnk&d4CqQG^Ko1$*z;+InQ8pA;}0ZxJ@vY$u)1ofsvbWJ z7lNRWjV3NaBp`^+Qlf&JL{L!>1Xr#UH?9<tkX1sm$a!y=>h7_+m8Sc2y}IYzbML$F z?RjAKJ^$nSwHIG)efaH-U*FsYkTm5t6O&^=R}V1dap4g#`wQ_;;J|qxwGBA<8*vsW zT_Bz#UM4ORZvio`%{`^kKS=(||LGKZ=hg!WVB|ucc%C>$yhj`-z9&vl-ylvBj}QyQ z?{HXBGxZ85mhV!p9LxUvI}pDf|NDo2^7bY2!&muyEb-*Wlf-9<*H?(K<)nA^G2@Zy z-}{KqZ`0Q{f6schrQhASNIbLd!^8W0y)#=GOcQ@v!B~Ixul#ntf4Tl<elPXD?0#@Z zy??%fu|pP%8HsZxgZ=OjKxX)Wl=>d9#k}-Y__{GS2;AD3@VZoN4^BYBV)P<x2sj}p zQ<`6pX5E$%tSu;!A^5f6>)%sUX>gOJKm<|ga+tw?SYWE=@btLr+LlvQnbPCJGY9IH zc9+AHc6Y8dd`gNSDm;Ze>hQx7;`=L=k2H7C`y%@zFi#_@c1PDBY04(uLA51Y@2qgD zby1Z@Nd_vduB&@>b;1(1Th(rNguPUn>_4+CF^>&{86;O)>*%GRVL5^HmV|8tR!z4$ zcgS^XtG(B{{Wwf^jjolV>Uy0Rt+_#I2C}v&JrUHsHj1C#hKzD?#FD2!b01pc)ke&r z)U*+Wg4&4IsEwFpUwn4OVs$lDUC8)i!gAPa!=nwwOe#OVHnW8^52oHGUvHwTWE#|h z<@te8v0c|&L+#`Esl73EC!_M_W-QY;%F>KTytN&hdodiQ?`~EwhSxaA>I0xBFJz== ztbk|DSrfVmN8xfro#+P5T1#yj)W-=|8Ps{MM3TFU!spnvsk4vwM_G4BorI_s=Sp(k zb<D^f=P<<200uFNfw0Ep;ON&wL#o0aeK(A|oO>tm8z+4T!_h3=!uG6@Xx2#QT)U!K zyE?O2QB+-{omso1S-ab_)cN5Z6?QM4U(}-<-Gvki+^2FQx**G)w5K^2jk`KNE%fBI z)1Fp$Vnchn-Z8p}cg?<wqNDF3omdU+qBz^$cNRq+2S?q1AtPDj7%eDHPEVD(uvRB3 X16AijlbghGxnid^_!8-{uCD(9k5Zg4 literal 0 HcmV?d00001 diff --git a/examples/thermo/thermo.de_DE.ts b/examples/thermo/i18n/qml_de_DE.ts similarity index 97% rename from examples/thermo/thermo.de_DE.ts rename to examples/thermo/i18n/qml_de_DE.ts index 4ab85755..a14aedee 100644 --- a/examples/thermo/thermo.de_DE.ts +++ b/examples/thermo/i18n/qml_de_DE.ts @@ -17,7 +17,7 @@ </message> </context> <context> - <name>Card</name> + <name>Card.ui</name> <message> <source>Heating</source> <translation>Heizen</translation> @@ -100,7 +100,7 @@ </message> </context> <context> - <name>StatsContents</name> + <name>StatsContents.ui</name> <message> <source>Jan</source> <translation>Jan</translation> @@ -151,7 +151,7 @@ </message> </context> <context> - <name>StatsView</name> + <name>StatsView.ui</name> <message> <source>Month</source> <translation>Monat</translation> diff --git a/examples/thermo/i18n/qml_ja_JP.qm b/examples/thermo/i18n/qml_ja_JP.qm new file mode 100644 index 0000000000000000000000000000000000000000..0784a359cf5eeb8668f61c2298d09445eed0805f GIT binary patch literal 1863 zcma)+OK1~O6oyZl$)hoiEh4z+A{Lao(B8bdu|<>AQ2I<8Eo!uO(oE7RNv2LFl`bk$ z6f_G_`=CB37D_FGP<&uF+G<6?$4cB;aM49+LBS#jy70_|OfoS^y9j^oo$vqenKNgm zZXvkm{f~R&pY~QR_DsK6c>n;Ke)?RK*9D*|2WaF0s0DzQ$Ed3S-irv}e#cAHIso4Y zY9Hz~)G^dq^sND$c#BEzK=Vhuz77>9$^g{WU>k9wUP8ru^;1+g>KbYT=2xN~L-nG1 zP%p!AW)A&JaC+_u=5>}BroID|d{qA)t3qEF<+R?y^(6J?_F2?l)YqG$8a4dTGV-9U zs(+1Zr*3@rC@$A^tJ7DozWt>ei_dUfZ3qz^>QG8mlZKzpeR#d6Y{prSzJAlfym<Y7 zN>xiNM($GM4t3HVII71#pcQ}K2;IxXMYPn#2?7^&(Y#9H+O7^$GN<?T_A$Xkgvmz^ zpHJ##QsWb7A#Y&E^S}`q)44e=!p6d4p3Y74!9xi)b#7=P8*5}}AumQAk}q<ax;+&7 zFG-(-<W%yY|Bj4Rw9v6|f(|ogA0vpdQk|ysZUak4xUf`(KI9r7ReI54W@7@w57H5{ zz(%E37&|#Gn(j@?89UHDt8nfVodOdbV0c<c@CAHS!S?9IGrCyj!WR9>;c^<}@rVsl zGUa56%#aUclgyJ1@|S#*JGG;MjbVSxJRU9jG-3_$Q~_X_xSjz$EFTxlp$NzEIiTL} zZNGbC?M$-_8=Ki++#Fznd18%e8q8po9j0uD*_wL-c|?}UE3zr`x@K0uNsZ-zCbCXG z=ex}ocCf&0YTFL`SNt<_vZ<Ah<HIjdJq6aRrWk!pFBc2u?TP^iIG_eBV3D&m#8G3h zh&7i>Z;zY9Ig1JL^gEI9WI7{xq=szeu_@27ZRZ@j(qrF_$D#B%w&ST)dTI-MD6oe! zUm3M?KpMCF_l{2^oAoe(V!4)VwuzQzr%-OKf=v`<ZP{!qU9?_@k{v2iZ&=@{&2+65 bN2O1sjnd?ZpNaI;P~AcnNu6R+B`Cpv=kI>_ literal 0 HcmV?d00001 diff --git a/examples/thermo/thermo.ja_JP.ts b/examples/thermo/i18n/qml_ja_JP.ts similarity index 97% rename from examples/thermo/thermo.ja_JP.ts rename to examples/thermo/i18n/qml_ja_JP.ts index 9662c6d5..dca4de05 100644 --- a/examples/thermo/thermo.ja_JP.ts +++ b/examples/thermo/i18n/qml_ja_JP.ts @@ -17,7 +17,7 @@ </message> </context> <context> - <name>Card</name> + <name>Card.ui</name> <message> <source>Heating</source> <translation>暖房</translation> @@ -100,7 +100,7 @@ </message> </context> <context> - <name>StatsContents</name> + <name>StatsContents.ui</name> <message> <source>Jan</source> <translation>1月</translation> @@ -151,7 +151,7 @@ </message> </context> <context> - <name>StatsView</name> + <name>StatsView.ui</name> <message> <source>Month</source> <translation>月分</translation> diff --git a/examples/thermo/imports/Thermo/Thermo.qmlproject b/examples/thermo/imports/Thermo/Thermo.qmlproject new file mode 100644 index 00000000..9f480f64 --- /dev/null +++ b/examples/thermo/imports/Thermo/Thermo.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.3 + +Project { + MCU.Module { + uri: "Thermo" + } + QmlFiles { + files: [ + "ColorStyle.qml", + "Room.qml", + "Rooms.qml", + "Theme.qml", + "Units.qml" + ] + } +} diff --git a/examples/thermo/imports/ThermoConfiguration/ThermoConfiguration.qmlproject b/examples/thermo/imports/ThermoConfiguration/ThermoConfiguration.qmlproject new file mode 100644 index 00000000..4fc73755 --- /dev/null +++ b/examples/thermo/imports/ThermoConfiguration/ThermoConfiguration.qmlproject @@ -0,0 +1,12 @@ +import QmlProject 1.3 + +Project { + MCU.Module { + uri: "ThermoConfiguration" + } + QmlFiles { + files: [ + "Configuration.qml" + ] + } +} diff --git a/examples/thermo/thermo.qmlproject b/examples/thermo/thermo.qmlproject index 7250b7b1..c37c5d05 100644 --- a/examples/thermo/thermo.qmlproject +++ b/examples/thermo/thermo.qmlproject @@ -1,62 +1,142 @@ /* File generated by Qt Creator */ -import QmlProject 1.1 +import QmlProject 1.3 Project { mainFile: "thermo.ui.qml" - /* Include .qml, .js, and image files from current directory and subdirectories */ QmlFiles { directory: "." } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - - Files { - filter: "*.conf" - files: ["qtquickcontrols2.conf"] - } - - Files { - filter: "qmldir" - directory: "." + files: [ + "assets/qt-logo.png", + "assets/JAPAN.png", + "assets/temp-down-pressed.png", + "assets/switch-handle.png", + "assets/popup-bg.png", + "assets/scrollbar-temperature-track.png", + "assets/radiobutton-checked-pressed.png", + "assets/digitMaskBottom.png", + "assets/switch-i.png", + "assets/btn-bg-big-on.png", + "assets/radiobutton-pressed.png", + "assets/pressed-bg-up.png", + "assets/selected.png", + "assets/eco-on.png", + "assets/streamer-on-small.png", + "assets/page-indicator.png", + "assets/jog-off.png", + "assets/status-small.png", + "assets/dryer-on-small.png", + "assets/dryer-on.png", + "assets/close.png", + "assets/auto-card.png", + "assets/toggle-year.png", + "assets/eco-on-small.png", + "assets/separator-line.png", + "assets/radiobutton-checked.png", + "assets/streamer-on.png", + "assets/btn-bg-down.png", + "assets/slider-handle.png", + "assets/thermo-handle.png", + "assets/switch-bg.png", + "assets/pressed-bg-down.png", + "assets/auto-on.png", + "assets/place-back.png", + "assets/UK.png", + "assets/radiobutton.png", + "assets/baseline-arrow-back.png", + "assets/digitMaskTop.png", + "assets/switch-o.png", + "assets/power-on.png", + "assets/temp-up-pressed.png", + "assets/btn-bg-big-off.png", + "assets/toggle-month.png", + "assets/jog.png", + "assets/GERMANY.png", + "assets/change-language.png", + "assets/scrollbar-off-track.png", + "assets/weather/w_06.png", + "assets/weather/w_01.png", + "assets/weather/w_02.png", + "assets/weather/w_07.png", + "assets/weather/w_05.png", + "assets/weather/w_04.png", + "assets/weather/w_03.png", + "assets/stats-month.png", + "assets/stats-year.png", + "assets/main-bg.png", + "assets/fan-off.png", + "assets/fan-off-small.png", + "assets/fan-1-on.png", + "assets/fan-1-on-small.png", + "assets/fan-2-on.png", + "assets/fan-2-on-small.png", + "assets/fan-3-on.png", + "assets/fan-3-on-small.png", + "assets/fan-4-on.png", + "assets/fan-4-on-small.png" + ] } - Files { - filter: "*.qm" - directory: "i18n" + ImageFiles { + files: [ + "images/inner-circle.png", + "images/card-back-topleft.png", + "images/card-back-bottomleft.png", + "images/card-back-topright.png", + "images/card-back-bottomright.png" + ] } - Files { - filter: "*.ts" + FontFiles { + files: [ + "fonts/NotoSansArabic-Regular.ttf", + "fonts/NotoSansJP-Regular.otf", + "fonts/NotoSansThai-Regular.ttf", + "fonts/Roboto-Regular.ttf" + ] } - Files { - filter: "*.ttf;*.otf" + TranslationFiles { + files: [ + "i18n/qml_de_DE.ts", + "i18n/qml_ja_JP.ts" + ] } Environment { QT_QUICK_CONTROLS_CONF: "qtquickcontrols2.conf" QT_AUTO_SCREEN_SCALE_FACTOR: "1" QT_LOGGING_RULES: "qt.qml.connections=false" + QML_COMPAT_RESOLVE_URLS_ON_ASSIGNMENT: "1" } /* List of plugin directories passed to QML runtime */ - importPaths: [ "imports", "asset_imports", "i18n" ] + importPaths: [ "imports" ] + + ModuleFiles { + files: [ + "imports/Thermo/Thermo.qmlproject", + "imports/ThermoConfiguration/ThermoConfiguration.qmlproject" + ] + } /* Required for deployment */ targetDirectory: "/opt/thermo" //selectors: "metric" or "imperial", "big", "static" - fileSelectors: [ "metric" ] + MCU.Config { + fileSelector: [ "metric" ] + defaultFontFamily: "Roboto" + } qtForMCUs: true qt6Project: true + + multilanguageSupport: true + supportedLanguages: [ "de_DE", "ja_JP" ] } -- GitLab From 2630f4820e9dc46e03ecec9d7672223014de940e Mon Sep 17 00:00:00 2001 From: Rafal Stawarski <ext-rafal.stawarski@qt.io> Date: Mon, 18 Nov 2024 15:55:41 +0100 Subject: [PATCH 2/3] Thermo: new CMake configuration Task-number: QDS-9838 --- examples/thermo/CMakeLists.txt | 296 ++---------------------------- examples/thermo/thermo.qmlproject | 9 +- 2 files changed, 23 insertions(+), 282 deletions(-) diff --git a/examples/thermo/CMakeLists.txt b/examples/thermo/CMakeLists.txt index 04649953..f5ec3d6a 100644 --- a/examples/thermo/CMakeLists.txt +++ b/examples/thermo/CMakeLists.txt @@ -1,289 +1,25 @@ -cmake_minimum_required (VERSION 3.15) +cmake_minimum_required (VERSION 3.21.1) project(thermo VERSION 0.0.1 LANGUAGES C CXX ASM) + if (NOT TARGET Qul::Core) find_package(Qul) endif() -qul_add_target(thermo_small) - -set(UNIT_SYSTEM "metric" CACHE STRING "Thermostat Demo Unit System") -set(FONT_ENGINE "Static" CACHE STRING "Thermostat Demo Font Engine") - -set(COMMON_QML_FILES - thermo.ui.qml TopBar.qml BottomBarButton.ui.qml BottomBar.qml PlacesDotIndicator.ui.qml - PlacesView.ui.qml Card.ui.qml CardRow.ui.qml PowerSwitch.qml - ScheduleView.ui.qml RoomSchedule.qml StatsView.ui.qml RoomView.qml RoomControlButton.qml - AnimatedDigit.qml WeatherStatus.qml ThermoView.qml StatsContents.ui.qml - TimeIntervalSlider.qml TimeIntervalSliderHandle.ui.qml FanControlButton.qml LanguageDialog.qml - LanguageButton.qml) -set(MODULE_QML_FILES - imports/Thermo/ColorStyle.qml - imports/Thermo/Rooms.qml - imports/Thermo/Room.qml) - -set(TRANSLATION_FILES - i18n/qml_de_DE.ts - i18n/qml_ja_JP.ts) -set(DEFAULT_FONT_FAMILY "Roboto") -set(FONT_FILES - NotoSansArabic-Regular.ttf - NotoSansJP-Regular.otf - NotoSansThai-Regular.ttf - Roboto-Regular.ttf -) -list(TRANSFORM FONT_FILES PREPEND ${CMAKE_CURRENT_SOURCE_DIR}/fonts/) - -qul_add_resource(thermo_small - PREFIX assets - BASE assets - FILES - assets/qt-logo.png - assets/JAPAN.png - assets/temp-down-pressed.png - assets/switch-handle.png - assets/popup-bg.png - assets/scrollbar-temperature-track.png - assets/radiobutton-checked-pressed.png - assets/digitMaskBottom.png - assets/switch-i.png - assets/btn-bg-big-on.png - assets/radiobutton-pressed.png - assets/pressed-bg-up.png - assets/selected.png - assets/eco-on.png - assets/streamer-on-small.png - assets/page-indicator.png - assets/jog-off.png - assets/status-small.png - assets/dryer-on-small.png - assets/dryer-on.png - assets/close.png - assets/auto-card.png - assets/toggle-year.png - assets/eco-on-small.png - assets/separator-line.png - assets/radiobutton-checked.png - assets/streamer-on.png - assets/btn-bg-down.png - assets/slider-handle.png - assets/thermo-handle.png - assets/switch-bg.png - assets/pressed-bg-down.png - assets/auto-on.png - assets/place-back.png - assets/UK.png - assets/radiobutton.png - assets/baseline-arrow-back.png - assets/digitMaskTop.png - assets/switch-o.png - assets/power-on.png - assets/temp-up-pressed.png - assets/btn-bg-big-off.png - assets/toggle-month.png - assets/jog.png - assets/GERMANY.png - assets/change-language.png - assets/scrollbar-off-track.png - assets/weather/w_06.png - assets/weather/w_01.png - assets/weather/w_02.png - assets/weather/w_07.png - assets/weather/w_05.png - assets/weather/w_04.png - assets/weather/w_03.png - assets/stats-month.png - assets/stats-year.png -) - -qul_add_resource(thermo_small - FILES - images/inner-circle.png - images/card-back-topleft.png - images/card-back-bottomleft.png - images/card-back-topright.png - images/card-back-bottomright.png -) - -qul_add_resource(thermo_small - PREFIX assets - BASE assets - FILES - assets/main-bg.png -) -list(APPEND COMMON_QML_FILES "BackgroundImage.ui.qml") - -qul_target_qml_sources(thermo_small ${COMMON_QML_FILES}) - -qul_add_qml_module(thermo_small_module - URI Thermo - QML_FILES - ${MODULE_QML_FILES} - imports/Thermo/Theme.qml - imports/Thermo/+${UNIT_SYSTEM}/Units.qml - OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/thermo_small_module -) -qul_add_resource(thermo_small_module - PREFIX assets - BASE assets - FILES - assets/fan-off.png - assets/fan-off-small.png - assets/fan-1-on.png - assets/fan-1-on-small.png - assets/fan-2-on.png - assets/fan-2-on-small.png - assets/fan-3-on.png - assets/fan-3-on-small.png - assets/fan-4-on.png - assets/fan-4-on-small.png -) - -set_target_properties(thermo_small - PROPERTIES - QUL_DEFAULT_FONT_FAMILY "${DEFAULT_FONT_FAMILY}" - QUL_FONT_ENGINE "${FONT_ENGINE}" - QUL_FONT_FILES "${FONT_FILES}" -) - -qul_add_qml_module(thermo_configuration_small_module - URI - ThermoConfiguration - QML_FILES - imports/ThermoConfiguration/Configuration.qml - OUTPUT_DIRECTORY - ${CMAKE_CURRENT_BINARY_DIR}/thermo_configuration_small_module -) - -qul_target_embed_translations(thermo_configuration_small_module ${TRANSLATION_FILES}) -qul_target_embed_translations(thermo_small_module ${TRANSLATION_FILES}) -qul_target_embed_translations(thermo_small ${TRANSLATION_FILES}) - -target_link_libraries(thermo_small PRIVATE thermo_configuration_small_module thermo_small_module Qul::ControlsTemplates) -app_target_setup_os(thermo_small) -app_target_default_entrypoint(thermo_small thermo) - -if(QUL_PLATFORM STREQUAL "qt") - qul_add_target(thermo_big) - - qul_add_resource(thermo_big - PREFIX assets - BASE assets/+big - FILES - assets/+big/qt-logo.png - assets/+big/JAPAN.png - assets/+big/temp-down-pressed.png - assets/+big/switch-handle.png - assets/+big/popup-bg.png - assets/+big/scrollbar-temperature-track.png - assets/+big/radiobutton-checked-pressed.png - assets/+big/digitMaskBottom.png - assets/+big/switch-i.png - assets/+big/btn-bg-big-on.png - assets/+big/radiobutton-pressed.png - assets/+big/pressed-bg-up.png - assets/+big/selected.png - assets/+big/eco-on.png - assets/+big/streamer-on-small.png - assets/+big/page-indicator.png - assets/+big/jog-off.png - assets/+big/status-small.png - assets/+big/dryer-on-small.png - assets/+big/dryer-on.png - assets/+big/close.png - assets/+big/auto-card.png - assets/+big/toggle-year.png - assets/+big/eco-on-small.png - assets/+big/separator-line.png - assets/+big/radiobutton-checked.png - assets/+big/streamer-on.png - assets/+big/radiobutton-disabled.png - assets/+big/btn-bg-down.png - assets/+big/slider-handle.png - assets/+big/thermo-handle.png - assets/+big/switch-bg.png - assets/+big/pressed-bg-down.png - assets/+big/main-bg.png - assets/+big/auto-on.png - assets/+big/place-back.png - assets/+big/UK.png - assets/+big/radiobutton.png - assets/+big/baseline-arrow-back.png - assets/+big/digitMaskTop.png - assets/+big/switch-o.png - assets/+big/power-on.png - assets/+big/temp-up-pressed.png - assets/+big/btn-bg-big-off.png - assets/+big/toggle-month.png - assets/+big/jog.png - assets/+big/GERMANY.png - assets/+big/change-language.png - assets/+big/scrollbar-off-track.png - assets/+big/weather/w_06.png - assets/+big/weather/w_01.png - assets/+big/weather/w_02.png - assets/+big/weather/w_07.png - assets/+big/weather/w_05.png - assets/+big/weather/w_04.png - assets/+big/weather/w_03.png - assets/+big/stats-month.png - assets/+big/stats-year.png - ) - - qul_add_resource(thermo_big - FILES - images/inner-circle.png - images/card-back-topleft.png - images/card-back-bottomleft.png - images/card-back-topright.png - images/card-back-bottomright.png - ) - - qul_target_qml_sources(thermo_big ${COMMON_QML_FILES} ${ADDITIONAL_QML_FILES_BIG}) - - qul_add_qml_module(thermo_big_module - URI Thermo - QML_FILES - ${MODULE_QML_FILES} - imports/Thermo/+big/Theme.qml - imports/Thermo/+${UNIT_SYSTEM}/Units.qml - OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/thermo_big_module - ) - qul_add_resource(thermo_big_module - PREFIX assets - BASE assets/+big - FILES - assets/+big/fan-off.png - assets/+big/fan-off-small.png - assets/+big/fan-1-on.png - assets/+big/fan-1-on-small.png - assets/+big/fan-2-on.png - assets/+big/fan-2-on-small.png - assets/+big/fan-3-on.png - assets/+big/fan-3-on-small.png - assets/+big/fan-4-on.png - assets/+big/fan-4-on-small.png - ) - - set_target_properties(thermo_big - PROPERTIES - QUL_DEFAULT_FONT_FAMILY "${DEFAULT_FONT_FAMILY}" - QUL_FONT_ENGINE "${FONT_ENGINE}" - QUL_FONT_FILES "${FONT_FILES}" - ) +if (Qul_VERSION LESS "2.4") + message(WARNING "The current Qt for MCUs version is '${Qul_VERSION}'." + "This CMake project was made for Qt for MCUs 2.4 and newer, " + "and might not work as expected.") +endif() - qul_add_qml_module(thermo_configuration_big_module - URI ThermoConfiguration - QML_FILES - imports/ThermoConfiguration/Configuration.qml - OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/thermo_configuration_big_module - ) +qul_add_target(thermo_small + QML_PROJECT thermo.qmlproject + GENERATE_ENTRYPOINT + SELECTORS metric) - qul_target_embed_translations(thermo_configuration_big_module ${TRANSLATION_FILES}) - qul_target_embed_translations(thermo_big_module ${TRANSLATION_FILES}) - qul_target_embed_translations(thermo_big ${TRANSLATION_FILES}) +qul_add_target(thermo_big + QML_PROJECT thermo.qmlproject + GENERATE_ENTRYPOINT + SELECTORS metric big) - target_link_libraries(thermo_big PRIVATE thermo_configuration_big_module thermo_big_module Qul::ControlsTemplates) - app_target_setup_os(thermo_big) - app_target_default_entrypoint(thermo_big thermo) -endif() +app_target_setup_os(thermo) diff --git a/examples/thermo/thermo.qmlproject b/examples/thermo/thermo.qmlproject index c37c5d05..021116a7 100644 --- a/examples/thermo/thermo.qmlproject +++ b/examples/thermo/thermo.qmlproject @@ -122,14 +122,20 @@ Project { "imports/Thermo/Thermo.qmlproject", "imports/ThermoConfiguration/ThermoConfiguration.qmlproject" ] + + MCU.qulModules: [ + "Controls", + "ControlsTemplates", + "Timeline" + ] } /* Required for deployment */ targetDirectory: "/opt/thermo" //selectors: "metric" or "imperial", "big", "static" + QDS.fileSelectors: [ "metric", "big" ] MCU.Config { - fileSelector: [ "metric" ] defaultFontFamily: "Roboto" } @@ -137,6 +143,5 @@ Project { qt6Project: true - multilanguageSupport: true supportedLanguages: [ "de_DE", "ja_JP" ] } -- GitLab From 7d6e2e47eb1964b42875e6fe80877f1cc3431401 Mon Sep 17 00:00:00 2001 From: Rafal Stawarski <ext-rafal.stawarski@qt.io> Date: Mon, 18 Nov 2024 17:35:13 +0100 Subject: [PATCH 3/3] Thermo: mainItem x-positioning fix Task-number: QDS-9838 --- examples/thermo/thermo.ui.qml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/examples/thermo/thermo.ui.qml b/examples/thermo/thermo.ui.qml index deb4bc16..f5405b02 100644 --- a/examples/thermo/thermo.ui.qml +++ b/examples/thermo/thermo.ui.qml @@ -55,7 +55,8 @@ Item { Item { id: mainItem - width: parent.width + anchors.left: parent.left + anchors.right: parent.right anchors.top: topBar.bottom height: parent.height - topBar.height - bottomBar.height @@ -65,8 +66,7 @@ Item { id: places enabled: appWindow.selectedView === 0 && showMain visible: opacity > 0.01 - width: parent.width - height: parent.height + anchors.fill: parent showMain: true Connections { target: places @@ -81,14 +81,11 @@ Item { RoomView { id: roomView - anchors.top: parent.top - anchors.bottom: parent.bottom + anchors.fill: parent anchors.bottomMargin: -Theme.bottomBarHeight // No BottomBar in the RoomView visible: opacity > 0.01 currentRoom: places.currentRoom - width: parent.width - selectedView: appWindow.selectedView index: 5 } @@ -119,11 +116,17 @@ Item { width: parent.width height: Theme.bottomBarHeight selected: appWindow.selectedView - onViewSwitched: appWindow.selectedView = index anchors.bottom: parent.bottom anchors.bottomMargin: shift showMainOption: places.showMain + + Connections { + target: bottomBar + function onViewSwitched(index: int) { + appWindow.selectedView = index + } + } } LanguageDialog { -- GitLab