LVRS Document Viewer
backend/AppBootstrap.svx
Path: backend/AppBootstrap.svx
AppBootstrap
Location: backend/runtime/appbootstrap.h / backend/runtime/appbootstrap.cpp
AppBootstrap provides pre/post application initialization routines for graphics backend policy, style setup, and font fallback setup.
API
lvrs::preApplicationBootstrap(options) -> AppBootstrapStatelvrs::postApplicationBootstrap(app, options) -> void
AppBootstrapOptions
applicationName: QStringquickStyleName: QStringconfigureRenderQualityDefaults: bool(defaulttrue)bootstrapGraphicsBackend: bool(defaulttrue)logGraphicsBackend: bool(defaulttrue)installBundledFonts: bool(defaulttrue)installPretendardFallbacks: bool(defaulttrue)enforcePretendardFallback: bool(defaulttrue)
AppBootstrapState
ok: boolerrorMessage: QStringgraphicsBackend: GraphicsBackendBootstrapResult
Required Call Order
- Call
preApplicationBootstrapbefore creatingQGuiApplication. - If
state.ok == false, abort startup. - Construct
QGuiApplication. - Call
postApplicationBootstrapimmediately after app creation.
What preApplicationBootstrap Does
- Optional
RenderQuality::configureGlobalDefaults(). - Optional
QQuickStyle::setStyle(quickStyleName). - Optional graphics backend bootstrap and diagnostics logging.
- Initializes default GPU cache hints (
QSG_RHI_PIPELINE_CACHE_LOAD/SAVE) throughRenderQualityglobal defaults path.
What postApplicationBootstrap Does
- Applies application name (if provided).
- Loads bundled fonts from resource set.
- Installs Pretendard fallbacks.
- Optionally enforces Pretendard fallback and warns if enforcement fails.
Typical C++ Usage
lvrs::AppBootstrapOptions options;
options.applicationName = QStringLiteral("MyApp");
options.quickStyleName = QStringLiteral("Basic");
const lvrs::AppBootstrapState state = lvrs::preApplicationBootstrap(options);
if (!state.ok)
return -1;
QGuiApplication app(argc, argv);
lvrs::postApplicationBootstrap(app, options);
Option Tuning Examples
Minimal startup (disable backend bootstrap for constrained test harness):
lvrs::AppBootstrapOptions options;
options.bootstrapGraphicsBackend = false;
options.logGraphicsBackend = false;
Font-focused startup (keep typography policies only):
lvrs::AppBootstrapOptions options;
options.configureRenderQualityDefaults = false;
options.bootstrapGraphicsBackend = false;
options.installBundledFonts = true;
options.installPretendardFallbacks = true;
Troubleshooting
state.ok == false: usestate.errorMessageas primary root-cause string.- Missing style changes: verify
quickStyleNameis set before app construction. - Unexpected font fallback: verify bundled font resources and fallback enforcement results.
FAQ
Q. Can postApplicationBootstrap be skipped?
A. It can be skipped technically, but recommended startup baseline (fonts/fallbacks/app name) will be incomplete.