@ -67,27 +67,6 @@ changeQMLState( QMLAction action, QQuickItem* item )
}
}
static void
registerCalamaresModels ( )
{
static bool done = false ;
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 > (
" 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 ( ) ;
} ) ;
}
}
namespace Calamares
{
@ -97,7 +76,7 @@ QmlViewStep::QmlViewStep( QObject* parent )
, m_spinner ( new WaitingWidget ( tr ( " Loading ... " ) ) )
, m_qmlWidget ( new QQuickWidget )
{
registerCalamaresModels( ) ;
CalamaresUtils: : registerCalamaresModels( ) ;
QVBoxLayout * layout = new QVBoxLayout ( m_widget ) ;
layout - > addWidget ( m_spinner ) ;