Files
KeyBoard_QT/docs/host_app_rebuild.md
2026-04-11 09:51:35 +08:00

1.9 KiB

Host APP Rebuild

Goal

Keep the APP layer suitable for teaching from simple to complex.

Teaching order:

  1. one button
  2. one keyboard page
  3. two pages
  4. one main window
  5. one shared theme

Completed Nodes

Node 1: theme helpers

Files:

  • KeyBorad/KeyBorad/APP/AppTheme.h
  • KeyBorad/KeyBorad/APP/AppTheme.cpp

Design notes:

  • centralize colors and style strings
  • keep styling readable
  • avoid mixing style text inside every widget

Node 2: key button

Files:

  • KeyBorad/KeyBorad/APP/AppKeyButton.h
  • KeyBorad/KeyBorad/APP/AppKeyButton.cpp

Design notes:

  • teach one custom button first
  • keep state changes explicit
  • let one widget own its own text and style refresh

Node 3: keyboard page

Files:

  • KeyBorad/KeyBorad/APP/AppKeyboardPage.h
  • KeyBorad/KeyBorad/APP/AppKeyboardPage.cpp

Design notes:

  • grow from one button to a full keypad
  • keep layout data local and explicit

Node 4: settings page

Files:

  • KeyBorad/KeyBorad/APP/AppSettingsPage.h
  • KeyBorad/KeyBorad/APP/AppSettingsPage.cpp

Design notes:

  • use a second page early
  • give transport status and action feedback one simple home

Node 5: main window integration

Files updated in this step:

  • KeyBorad/KeyBorad/APP/AppMainWindow.h
  • KeyBorad/KeyBorad/APP/AppMainWindow.cpp
  • KeyBorad/KeyBorad/main.cpp

Implemented behavior:

  • create the two-page window
  • own one Lgc_Core
  • 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(...)