Drop Qt Quick Controls and Qt Widgets

The binary now links Core, Gui, Quick and QuickShapes, nothing else.

Qt Widgets was there for one reason, QSystemTrayIcon, so the tray icon is gone
and QApplication is back to QGuiApplication. The cat itself is the whole
interface: right-click or long-press opens the settings window, which carries
the tricks and a quit button. Ctrl+C in the terminal works as well.

The settings window is rebuilt from Qt Quick primitives. AppButton, AppSlider,
AppToggle and SettingsGroup replace the Controls types, keyboard handling and
accessible roles included, and a Flickable with plain positioners replaces
QtQuick.Layouts.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
JulianandClaude Opus 5 committed 2026-09-11 08:58:51 +02:00
1 parent f6ecf0ddbf
commit 1581a760be
10 files changed
+540 -294

No files matched your search

+16 -9
View File
@@ -22,10 +22,10 @@ plain Qt 6 / QML project.
|---|---|
| `CMakeLists.txt` | `qt_add_executable` + `qt_add_qml_module` (URI `TNCat`), macOS bundle, `.desktop` file on Linux |
| `src/main.cpp` | Wires `AppSettings` and `CatController` into the QML engine, warns on Wayland |
| `qml/AppButton.qml`, `qml/AppSlider.qml`, `qml/AppToggle.qml`, `qml/SettingsGroup.qml` | The controls, built from primitives |
| `src/catcontroller.*` | Mood machine (walk, run, sit, groom, stretch, sleep, love, alert, chase, bat, drink), movement tick, chip chase, coffee break, cursor tracking |
| `src/appsettings.*` | `QSettings`-backed coat, size, pace, ground line, eye tracking, pet counter |
| `src/platforminfo.*` | QML singleton `Platform`: platform name plus the X11 escape hatches |
| `src/traycontroller.*` | Tray icon and menu, silently skipped when the desktop has no tray |
| `qml/Main.qml` | Non-visual root that picks the window layout for the platform |
| `qml/CatWindow.qml`, `qml/ChipWindow.qml`, `qml/CupWindow.qml` | One small window each, positioned by the app. X11, macOS, Windows |
| `qml/OverlayWindow.qml` | One screen-filling click-through window holding both. Wayland |
@@ -56,9 +56,16 @@ cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build
```
Needs Qt 6.5 or newer. Required modules: Core, Gui, Quick, QuickControls2,
Widgets. Widgets is only there because `QSystemTrayIcon` needs it for its
context menu.
Needs Qt 6.5 or newer. Required modules: Core, Gui, Quick, QuickShapes. There is
no dependency on Qt Quick Controls and none on Qt Widgets: every control in the
settings window is built from Qt Quick primitives, and there is no tray icon,
which is the only thing that pulled Widgets in.
Check what actually got linked with:
```bash
otool -L build/tncat.app/Contents/MacOS/tncat | grep -o 'Qt[A-Za-z]*\.framework' | sort -u
```
## Environment switches
@@ -93,9 +100,9 @@ Untested on real hardware so far. What the code already does for that target:
- **X11 today, Wayland later.** Both layouts are in the build; the platform picks
one at startup.
- **No tray required.** If the desktop has no status-notifier host, the tray icon
is skipped and the cat itself stays the entry point: long-press or right-click
opens the settings window.
- **No tray, no menu bar item.** The cat itself is the whole interface:
right-click or long-press opens the settings window. Quit from the button
there, with Ctrl+C in the terminal that started it, or by killing the process.
- **Touch works without hover.** Tap pets the cat, drag picks it up. The blush on
hover is a mouse-only extra, not a requirement.
- **Ground line setting.** The cat normally stands on the bottom of the available
@@ -122,5 +129,5 @@ What still needs checking on the actual machine:
| Click or tap | Pet the cat, it closes its eyes and purrs |
| Drag | Pick the cat up and put it somewhere else |
| Hover | Blush and purr wiggle |
| Double-click or right-click | Settings window |
| Tray menu | Tricks, nap toggle, settings, quit |
| Double-click, right-click or long-press | Settings window |
| Settings window | Coat, size, pace, ground line, habits, tricks, quit |