LVRS Document Viewer
overview.svx
Path: overview.svx
Overview
LVRS is a Qt 6.5+ QML framework centered on deterministic UI behavior, explicit runtime observability, and strict integration boundaries between view, navigation, and model ownership.
Design Goals
- Stable component contracts across control, layout, navigation, and surfaces.
- Backend-first runtime observability exposed as QML-friendly APIs.
- Deterministic rendering bootstrap by explicit platform/backend policy.
- Safe MVVM write ownership to prevent accidental shared-state races.
Runtime Architecture
LVRS runtime is split into two cooperating layers.
- Event capture daemon (
RuntimeEvents)
Captures keyboard, pointer, context, touch/tablet/gesture, UI lifecycle, and process telemetry. - Backend cache/bridge (
Backend)
Mirrors runtime event stream into a bounded cache and provides stable snapshots for QML consumers.
This architecture exists so UI-layer logic can consume coherent snapshots under event bursts instead of racing mutable real-time streams.
UI Architecture
QML modules are grouped by concern.
control: inputs, display controls, selection controls, and behavior guards.layout: stack primitives and app header.navigation: router, global navigator, hierarchy, context menu.surfaces: card/dialog style containers.app: root window shell with adaptive navigation bridge.
Startup Sequence
A production startup path should follow this order.
lvrs::preApplicationBootstrap(options)beforeQGuiApplication.- Construct
QGuiApplication. lvrs::postApplicationBootstrap(app, options).- Load QML root (
LV.ApplicationWindow). - Optionally enable runtime bridges:
RuntimeEvents.start() + attachWindow(window)Backend.hookUserEvents()
Key Runtime Guarantees
- Route transitions update
PageRouter.path, current route state, and optionalViewStateTrackersync. - Global context/click signals can be consumed at app root through
ApplicationWindowevent bridge. - Nested wheel behavior can be isolated by
WheelScrollGuard. - IME composition integrity can be enforced by
InputMethodGuard.
Recommended Entry Documents by Use Case
- Runtime event integration:
docs/backend/RuntimeEvents.md,docs/components/control/EventListener.md. - Navigation and route model binding:
docs/components/navigation/PageRouter.md,docs/mvvm.md. - Platform/backend behavior:
docs/architecture/rendering-backend.md,docs/backend/Platform.md. - Logging and diagnostics:
docs/backend/Debug.md,docs/backend/DebugOutput.md.
End-to-End Integration Scenario
A typical production flow uses all runtime layers in sequence:
- Bootstrap app and rendering policy (
AppBootstrap). - Start and attach runtime daemon (
RuntimeEvents). - Hook backend event mirror (
Backend.hookUserEvents()). - Mount
ApplicationWindowwithPageRouterroutes. - Bind route metadata to
ViewModelsownership. - Handle global context/pressed events via
EventListener.
This chain provides deterministic behavior from startup through UI interaction.
Common Integration Mistakes
- Starting
RuntimeEventswithout attaching a window, then expecting UI hit-test data. - Writing model properties from views that never claimed ownership in
ViewModels. - Using nested
Flickablesurfaces withoutWheelScrollGuard. - Building context-menu close logic only from local click handlers instead of global coordinates.
Verification Checklist
After integrating LVRS in a new app, validate:
RuntimeEvents.running == trueBackend.userEventHooked == truewhen backend-first listeners are used- route transitions update
PageRouter.currentPathandViewStateTracker.snapshot()as expected - debug output includes expected event domains without uncontrolled flood