forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/5.0'
Conflicts: src/plugins/autotest/testresultdelegate.cpp Change-Id: If172206f231fc2a9f4a672cd2e6eaeaea4988c96
This commit is contained in:
@@ -144,8 +144,11 @@ QSize TestResultDelegate::sizeHint(const QStyleOptionViewItem &option, const QMo
|
||||
int fontHeight = fm.height();
|
||||
TestResultFilterModel *resultFilterModel = static_cast<TestResultFilterModel *>(view->model());
|
||||
LayoutPositions positions(opt, resultFilterModel);
|
||||
const int depth = resultFilterModel->itemForIndex(index)->level() + 1;
|
||||
const int indentation = depth * view->style()->pixelMetric(QStyle::PM_TreeViewIndentation, &opt);
|
||||
|
||||
QSize s;
|
||||
s.setWidth(opt.rect.width());
|
||||
s.setWidth(opt.rect.width() - indentation);
|
||||
|
||||
if (selected) {
|
||||
const TestResult *testResult = resultFilterModel->testResult(index);
|
||||
@@ -153,7 +156,7 @@ QSize TestResultDelegate::sizeHint(const QStyleOptionViewItem &option, const QMo
|
||||
QString output = testResult->outputString(selected);
|
||||
limitTextOutput(output);
|
||||
output.replace('\n', QChar::LineSeparator);
|
||||
recalculateTextLayout(index, output, opt.font, positions.textAreaWidth());
|
||||
recalculateTextLayout(index, output, opt.font, positions.textAreaWidth() - indentation);
|
||||
|
||||
s.setHeight(m_lastCalculatedHeight + 3);
|
||||
} else {
|
||||
@@ -174,9 +177,12 @@ void TestResultDelegate::currentChanged(const QModelIndex ¤t, const QModel
|
||||
|
||||
void TestResultDelegate::clearCache()
|
||||
{
|
||||
const QModelIndex current = m_lastProcessedIndex;
|
||||
m_lastProcessedIndex = QModelIndex();
|
||||
m_lastProcessedFont = QFont();
|
||||
m_lastWidth = -1;
|
||||
if (current.isValid())
|
||||
emit sizeHintChanged(current);
|
||||
}
|
||||
|
||||
void TestResultDelegate::limitTextOutput(QString &output) const
|
||||
|
||||
Reference in New Issue
Block a user