Skip to content

Commit cfc8bdc

Browse files
committedSep 25, 2012
Enable up/down arrow key navigation of browser application data layers
1 parent 4c33582 commit cfc8bdc

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed
 

‎src/browser/qgsbrowser.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,19 @@ void QgsBrowser::keyPressEvent( QKeyEvent * e )
375375
}
376376
}
377377

378+
void QgsBrowser::keyReleaseEvent( QKeyEvent * e )
379+
{
380+
QgsDebugMsg( "Entered" );
381+
if ( treeView->hasFocus() && ( e->key() == Qt::Key_Up || e->key() == Qt::Key_Down ) )
382+
{
383+
itemClicked( treeView->selectionModel()->currentIndex() );
384+
}
385+
else
386+
{
387+
e->ignore();
388+
}
389+
}
390+
378391
void QgsBrowser::stopRendering()
379392
{
380393
// you might have seen this already in QgisApp

‎src/browser/qgsbrowser.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class QgsBrowser : public QMainWindow, private Ui::QgsBrowserBase
5959

6060
protected:
6161
void keyPressEvent( QKeyEvent * e );
62+
void keyReleaseEvent( QKeyEvent * e );
6263

6364
bool layerClicked( QgsLayerItem* ptr );
6465

0 commit comments

Comments
 (0)
Please sign in to comment.