Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
PhosphorShell::ShellEngine Class Reference

#include <phosphor-shell/include/PhosphorShell/ShellEngine.h>

Inheritance diagram for PhosphorShell::ShellEngine:
[legend]

Classes

struct  Deps
 

Public Types

using EngineHook = std::function< void(QQmlEngine *)>
 Register a callback that fires whenever a fresh QQmlEngine is created — at startup AND on hot-reload (file watcher triggers rebuild).
 

Signals

void loaded ()
 
void reloaded ()
 
void failed (const QString &reason)
 

Public Member Functions

 ShellEngine (Deps deps, QObject *parent=nullptr)
 
 ~ShellEngine () override
 
bool load (const QUrl &shellUrl)
 
QQmlEngine * engine () const
 
void addEngineHook (EngineHook hook)
 

Member Typedef Documentation

◆ EngineHook

using PhosphorShell::ShellEngine::EngineHook = std::function<void(QQmlEngine*)>

Register a callback that fires whenever a fresh QQmlEngine is created — at startup AND on hot-reload (file watcher triggers rebuild).

Use this to install image providers, register engine-scoped singletons, or set additional context properties without forcing ShellEngine to depend on the modules that supply them. The callback is invoked synchronously, in registration order, after the engine's own context properties are set but before any QML is loaded.

Constructor & Destructor Documentation

◆ ShellEngine()

PhosphorShell::ShellEngine::ShellEngine ( Deps  deps,
QObject *  parent = nullptr 
)
explicit

◆ ~ShellEngine()

PhosphorShell::ShellEngine::~ShellEngine ( )
override

Member Function Documentation

◆ addEngineHook()

void PhosphorShell::ShellEngine::addEngineHook ( EngineHook  hook)

◆ engine()

QQmlEngine * PhosphorShell::ShellEngine::engine ( ) const

◆ failed

void PhosphorShell::ShellEngine::failed ( const QString &  reason)
signal

◆ load()

bool PhosphorShell::ShellEngine::load ( const QUrl &  shellUrl)

◆ loaded

void PhosphorShell::ShellEngine::loaded ( )
signal

◆ reloaded

void PhosphorShell::ShellEngine::reloaded ( )
signal

The documentation for this class was generated from the following file: