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,9 +181,13 @@ void TestResultDelegate::clearCache()
|
|||||||
m_lastProcessedIndex = QModelIndex();
|
m_lastProcessedIndex = QModelIndex();
|
||||||
m_lastProcessedFont = QFont();
|
m_lastProcessedFont = QFont();
|
||||||
m_lastWidth = -1;
|
m_lastWidth = -1;
|
||||||
if (current.isValid())
|
if (current.isValid()) {
|
||||||
|
if (auto model = current.model()) {
|
||||||
|
if (model->index(current.row(), current.column(), current.parent()) == current)
|
||||||
emit sizeHintChanged(current);
|
emit sizeHintChanged(current);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void TestResultDelegate::limitTextOutput(QString &output) const
|
void TestResultDelegate::limitTextOutput(QString &output) const
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user