Modules
QmlBridge
Embed QML views in a Widgets application, sharing theme tokens and your models.
Create a view
Link FluentQt::QmlBridge, activate a QmlSession, and create QmlView widgets. Models you expose to QML stay owned by your application. Deactivating the session unloads the QML scenes and keeps your views and models.
#include <FluentQt/QmlBridge.h>
// The session uses its own PluginManager; window and models stay caller-owned.
auto* session = new fluent::qmlbridge::QmlSession(window, window);
if (session->activate()) {
auto* qmlView = session->createView(parentWidget);
// Load a QML scene into qmlView.
}from fluentqt.qmlbridge import QmlSession
# The session uses its own PluginManager; window and models stay caller-owned.
session = QmlSession(window, window)
if session.activate():
qml_view = session.createView(parent_widget)Graphics API and theme
If Quick shares a window with SpatialView or QOpenGLWidget, call QmlSession::prepareApplication() before the first Quick surface is created; activating a session does not choose a graphics API. QmlTheme gives QML the host's theme tokens as the read-only fluentTheme object.