AutoTest: Clear cached information before running

We cache the last processed model index as well as the used
font. In some cases the cached information interfered with
new information and ended up in an ugly painting issue
where old information partially got repainted instead of
using the new. Clear cached information when starting a new
run to avoid this.

Change-Id: Ibb01e5e3bdd7b542325b5867d37c677d31a14aae
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2017-10-12 14:56:21 +02:00
parent 72c167be8b
commit 96da2973c3
3 changed files with 9 additions and 0 deletions

View File

@@ -181,6 +181,12 @@ void TestResultDelegate::currentChanged(const QModelIndex &current, const QModel
emit sizeHintChanged(previous);
}
void TestResultDelegate::clearCache()
{
m_lastProcessedIndex = QModelIndex();
m_lastProcessedFont = QFont();
}
void TestResultDelegate::recalculateTextLayout(const QModelIndex &index, const QString &output,
const QFont &font, int width) const
{