[calamares] Use a "real" slot for UniqueConnection

Multiple reports of the following fatal error:
    WARNING (Qt): QObject::connect(QItemSelectionModel, PartitionPage):
    unique connections require a pointer to member function of a QObject subclass
suggest to replace the unique lambda by a "real" slot.
This commit is contained in:
Adriaan de Groot 2024-02-22 20:26:56 +01:00
parent 7d63227014
commit c69e229be0
2 changed files with 14 additions and 6 deletions

View File

@ -47,10 +47,15 @@ ProgressTreeView::setModel( QAbstractItemModel* model )
QListView::setModel( model ); QListView::setModel( model );
connect( connect( Calamares::ViewManager::instance(),
Calamares::ViewManager::instance(), &Calamares::ViewManager::currentStepChanged,
&Calamares::ViewManager::currentStepChanged, this,
this, &ProgressTreeView::update,
[ this ]() { viewport()->update(); }, Qt::UniqueConnection );
Qt::UniqueConnection ); }
void
ProgressTreeView::update()
{
viewport()->update();
} }

View File

@ -31,6 +31,9 @@ public:
* @brief setModel assigns a model to this view. * @brief setModel assigns a model to this view.
*/ */
void setModel( QAbstractItemModel* model ) override; void setModel( QAbstractItemModel* model ) override;
public Q_SLOTS:
void update();
}; };
#endif // PROGRESSTREEVIEW_H #endif // PROGRESSTREEVIEW_H