From a8b3eb57973d0334c08a1b2ae7cd0d0501f95e23 Mon Sep 17 00:00:00 2001 From: stli Date: Sat, 11 Apr 2026 09:51:35 +0800 Subject: [PATCH] Fix APP property typing --- KeyBorad/KeyBorad/APP/AppKeyboardPage.cpp | 4 ++-- KeyBorad/KeyBorad/APP/AppSettingsPage.cpp | 4 ++-- docs/host_app_rebuild.md | 16 ++++++++++++++++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/KeyBorad/KeyBorad/APP/AppKeyboardPage.cpp b/KeyBorad/KeyBorad/APP/AppKeyboardPage.cpp index fdfc140..38d1089 100644 --- a/KeyBorad/KeyBorad/APP/AppKeyboardPage.cpp +++ b/KeyBorad/KeyBorad/APP/AppKeyboardPage.cpp @@ -95,13 +95,13 @@ void App_KeyboardPage::App_Func_CreateLayout() p_CardLayout->setSpacing(14); QLabel* const p_Title = new QLabel(QStringLiteral("Keyboard"), p_Card); - p_Title->setProperty("role", "title"); + p_Title->setProperty("role", QStringLiteral("title")); p_CardLayout->addWidget(p_Title); QLabel* const p_Body = new QLabel( QStringLiteral("Start from one button, then grow into the whole keypad layout."), p_Card); - p_Body->setProperty("role", "body"); + p_Body->setProperty("role", QStringLiteral("body")); p_Body->setWordWrap(true); p_CardLayout->addWidget(p_Body); diff --git a/KeyBorad/KeyBorad/APP/AppSettingsPage.cpp b/KeyBorad/KeyBorad/APP/AppSettingsPage.cpp index b185441..5fe2f9c 100644 --- a/KeyBorad/KeyBorad/APP/AppSettingsPage.cpp +++ b/KeyBorad/KeyBorad/APP/AppSettingsPage.cpp @@ -26,13 +26,13 @@ App_SettingsPage::App_SettingsPage(QWidget* p_Parent) p_CardLayout->setSpacing(14); QLabel* const p_Title = new QLabel(QStringLiteral("Settings"), p_Card); - p_Title->setProperty("role", "title"); + p_Title->setProperty("role", QStringLiteral("title")); p_CardLayout->addWidget(p_Title); QLabel* const p_Body = new QLabel( QStringLiteral("Use this page to present transport status and the latest function result."), p_Card); - p_Body->setProperty("role", "body"); + p_Body->setProperty("role", QStringLiteral("body")); p_Body->setWordWrap(true); p_CardLayout->addWidget(p_Body); diff --git a/docs/host_app_rebuild.md b/docs/host_app_rebuild.md index 28e20df..90fd997 100644 --- a/docs/host_app_rebuild.md +++ b/docs/host_app_rebuild.md @@ -79,3 +79,19 @@ Implemented behavior: - start handshake on launch - poll the logic layer with a timer - refresh settings page texts from logic state + +### Node 6: Qt property typing fix + +Files updated in this step: + +- `KeyBorad/KeyBorad/APP/AppKeyboardPage.cpp` +- `KeyBorad/KeyBorad/APP/AppSettingsPage.cpp` + +Design notes: + +- keep widget property values explicit under MSVC + Qt +- avoid relying on implicit conversion from string literal to `QVariant` + +Implemented behavior: + +- replace raw `"title"` / `"body"` property values with `QStringLiteral(...)`