[libcalamaresui] Register in io.calamares namespace
- Register both Branding and ViewManager for QML - Note that this changes the name of Branding - Add code-docs about object ownership
This commit is contained in:
parent
7a8eb09cdb
commit
28c2da12ae
@ -74,10 +74,17 @@ registerCalamaresModels()
|
||||
if ( !done )
|
||||
{
|
||||
done = true;
|
||||
// Because branding and viewmanager have a parent (CalamaresApplication
|
||||
// and CalamaresWindow), they will not be deleted by QmlEngine.
|
||||
// https://doc.qt.io/qt-5/qtqml-cppintegration-data.html#data-ownership
|
||||
qmlRegisterSingletonType< Calamares::Branding >(
|
||||
"calamares.ui", 1, 0, "Branding", []( QQmlEngine*, QJSEngine* ) -> QObject* {
|
||||
"io.calamares.ui", 1, 0, "Branding", []( QQmlEngine*, QJSEngine* ) -> QObject* {
|
||||
return Calamares::Branding::instance();
|
||||
} );
|
||||
qmlRegisterSingletonType< Calamares::Branding >(
|
||||
"io.calamares.core", 1, 0, "ViewManager", []( QQmlEngine*, QJSEngine* ) -> QObject* {
|
||||
return Calamares::ViewManager::instance();
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,6 @@ WelcomeQmlViewStep::WelcomeQmlViewStep( QObject* parent )
|
||||
// &WelcomeQmlViewStep::nextStatusChanged );
|
||||
// emit nextStatusChanged(true);
|
||||
qmlRegisterSingletonType< Config >( "io.calamares.module", 1, 0, "Welcome", [&](QQmlEngine*, QJSEngine*) -> QObject* { return m_config; } );
|
||||
qmlRegisterSingletonType< Calamares::Branding >( "io.calamares.ui", 1, 0, "Branding", [](QQmlEngine*, QJSEngine*) -> QObject* { return Calamares::Branding::instance(); } );
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user