Skip to content
Snippets Groups Projects
Commit 733b2248 authored by Daniel Teske's avatar Daniel Teske
Browse files

SearchResultTreeView: Use Utils::TreeView as base class


Slightly fixes the keyboard handling.

Change-Id: Ifd7f19012457fb6d8e29f511cf63566db6093665
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent 094a309a
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
......@@ -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;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment