forked from qt-creator/qt-creator
AutoTest: Avoid crash
Do not emit sizeHintChanged() on a QModelIndex that is no more part of the model. Fixes: QTCREATORBUG-28269 Change-Id: I1fa1733961eff8b427a9510243d304565cefe380 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -181,8 +181,12 @@ void TestResultDelegate::clearCache()
|
||||
m_lastProcessedIndex = QModelIndex();
|
||||
m_lastProcessedFont = QFont();
|
||||
m_lastWidth = -1;
|
||||
if (current.isValid())
|
||||
emit sizeHintChanged(current);
|
||||
if (current.isValid()) {
|
||||
if (auto model = current.model()) {
|
||||
if (model->index(current.row(), current.column(), current.parent()) == current)
|
||||
emit sizeHintChanged(current);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TestResultDelegate::limitTextOutput(QString &output) const
|
||||
|
Reference in New Issue
Block a user