forked from qt-creator/qt-creator
AutoTest: Avoid potential crash
Invalidating the filter model may crash while updating the source model as it emits a layoutChanged(). Just invalidating the filter works as the sorting of items is not touched. Workaround this by explicitly using invalidateFilter() instead of invalidate(). Task-number: QTBUG-103952 Change-Id: I52abda3936e870bb448c420e98a122edecffda7e Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -426,6 +426,10 @@ TestResultFilterModel::TestResultFilterModel(TestResultModel *sourceModel, QObje
|
||||
{
|
||||
setSourceModel(sourceModel);
|
||||
enableAllResultTypes(true);
|
||||
|
||||
// instead of using invalidate() from results pane when adding a new result ( QTBUG-103952 )
|
||||
connect(sourceModel, &QAbstractItemModel::rowsInserted,
|
||||
this, &TestResultFilterModel::invalidateFilter);
|
||||
}
|
||||
|
||||
void TestResultFilterModel::enableAllResultTypes(bool enabled)
|
||||
|
||||
Reference in New Issue
Block a user