Commit 04cbf8b8 authored by Christian Stenger's avatar Christian Stenger

AutoTest: Support find in results pane

Change-Id: I899325dd87439d6bea22fa52aed640fa8158e113
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
parent 4b30b30d
......@@ -23,6 +23,7 @@
**
****************************************************************************/
#include "testresultdelegate.h"
#include "testresultmodel.h"
#include <QFontMetrics>
......@@ -74,10 +75,15 @@ static QIcon testResultIcon(Result::Type result) {
QVariant TestResultItem::data(int column, int role) const
{
if (role == Qt::DecorationRole)
switch (role) {
case Qt::DecorationRole:
return m_testResult ? testResultIcon(m_testResult->result()) : QVariant();
return Utils::TreeItem::data(column, role);
case Qt::DisplayRole:
return m_testResult ? TestResultDelegate::outputString(*m_testResult.data(), true)
: QVariant();
default:
return Utils::TreeItem::data(column, role);
}
}
void TestResultItem::updateDescription(const QString &description)
......@@ -131,8 +137,8 @@ QVariant TestResultModel::data(const QModelIndex &idx, int role) const
if (!idx.isValid())
return QVariant();
if (role == Qt::DecorationRole)
return itemForIndex(idx)->data(0, Qt::DecorationRole);
if (role == Qt::DecorationRole || role == Qt::DisplayRole)
return itemForIndex(idx)->data(0, role);
return QVariant();
}
......
......@@ -35,6 +35,7 @@
#include <coreplugin/coreconstants.h>
#include <coreplugin/coreicons.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/find/itemviewfind.h>
#include <coreplugin/icontext.h>
#include <coreplugin/icore.h>
......@@ -115,7 +116,7 @@ TestResultsPane::TestResultsPane(QObject *parent) :
TestResultDelegate *trd = new TestResultDelegate(this);
m_treeView->setItemDelegate(trd);
outputLayout->addWidget(m_treeView);
outputLayout->addWidget(Core::ItemViewFind::createSearchableWrapper(m_treeView));
createToolButtons();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment