SearchResultTreeView: Use Utils::TreeView as base class

Slightly fixes the keyboard handling.

Change-Id: Ifd7f19012457fb6d8e29f511cf63566db6093665
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
Daniel Teske
2014-04-09 16:56:34 +02:00
parent 094a309a10
commit 733b2248e9
2 changed files with 3 additions and 15 deletions

View File

@@ -39,7 +39,7 @@ namespace Core {
namespace Internal {
SearchResultTreeView::SearchResultTreeView(QWidget *parent)
: QTreeView(parent)
: Utils::TreeView(parent)
, m_model(new SearchResultTreeModel(this))
, m_autoExpandResults(false)
{
@@ -90,16 +90,6 @@ void SearchResultTreeView::emitJumpToSearchResult(const QModelIndex &index)
emit jumpToSearchResult(item);
}
void SearchResultTreeView::keyPressEvent(QKeyEvent *e)
{
if (!e->modifiers() && e->key() == Qt::Key_Return) {
emit activated(currentIndex());
e->accept();
return;
}
QTreeView::keyPressEvent(e);
}
SearchResultTreeModel *SearchResultTreeView::model() const
{
return m_model;

View File

@@ -32,7 +32,7 @@
#include "searchresultwindow.h"
#include <QTreeView>
#include <utils/itemviews.h>
namespace Core {
namespace Internal {
@@ -40,7 +40,7 @@ namespace Internal {
class SearchResultTreeModel;
class SearchResultColor;
class SearchResultTreeView : public QTreeView
class SearchResultTreeView : public Utils::TreeView
{
Q_OBJECT
@@ -61,8 +61,6 @@ public slots:
void emitJumpToSearchResult(const QModelIndex &index);
protected:
void keyPressEvent(QKeyEvent *e);
SearchResultTreeModel *m_model;
bool m_autoExpandResults;
};