forked from qt-creator/qt-creator
Fixes: find: make "item activated" in the search treeview jump to
the file.
This commit is contained in:
@@ -50,7 +50,7 @@ SearchResultTreeView::SearchResultTreeView(QWidget *parent)
|
|||||||
setIndentation(14);
|
setIndentation(14);
|
||||||
header()->hide();
|
header()->hide();
|
||||||
|
|
||||||
connect (this, SIGNAL(activated(const QModelIndex&)), this, SLOT(emitJumpToSearchResult(const QModelIndex&)));
|
connect (this, SIGNAL(activated(QModelIndex)), this, SLOT(emitJumpToSearchResult(QModelIndex)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void SearchResultTreeView::setAutoExpandResults(bool expand)
|
void SearchResultTreeView::setAutoExpandResults(bool expand)
|
||||||
@@ -76,10 +76,7 @@ void SearchResultTreeView::appendResultLine(int index, const QString &fileName,
|
|||||||
|
|
||||||
void SearchResultTreeView::emitJumpToSearchResult(const QModelIndex &index)
|
void SearchResultTreeView::emitJumpToSearchResult(const QModelIndex &index)
|
||||||
{
|
{
|
||||||
if (model()->data(index, ItemDataRoles::TypeRole).toString().compare("row") != 0)
|
QString fileName = model()->data(index, ItemDataRoles::FileNameRole).toString();
|
||||||
return;
|
|
||||||
|
|
||||||
QString fileName(model()->data(index, ItemDataRoles::FileNameRole).toString());
|
|
||||||
int position = model()->data(index, ItemDataRoles::ResultIndexRole).toInt();
|
int position = model()->data(index, ItemDataRoles::ResultIndexRole).toInt();
|
||||||
int lineNumber = model()->data(index, ItemDataRoles::ResultLineNumberRole).toInt();
|
int lineNumber = model()->data(index, ItemDataRoles::ResultLineNumberRole).toInt();
|
||||||
int searchTermStart = model()->data(index, ItemDataRoles::SearchTermStartRole).toInt();
|
int searchTermStart = model()->data(index, ItemDataRoles::SearchTermStartRole).toInt();
|
||||||
|
Reference in New Issue
Block a user