Fix APP property typing

This commit is contained in:
2026-04-11 09:51:35 +08:00
parent acea92b0de
commit a8b3eb5797
3 changed files with 20 additions and 4 deletions

View File

@@ -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);

View File

@@ -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);

View File

@@ -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(...)`