Skip to content

Commit

Permalink
Enable up/down arrow key navigation of browser application data layers
Browse files Browse the repository at this point in the history
  • Loading branch information
dakcarto committed Sep 25, 2012
1 parent 4c33582 commit cfc8bdc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/browser/qgsbrowser.cpp
Expand Up @@ -375,6 +375,19 @@ void QgsBrowser::keyPressEvent( QKeyEvent * e )
}
}

void QgsBrowser::keyReleaseEvent( QKeyEvent * e )
{
QgsDebugMsg( "Entered" );
if ( treeView->hasFocus() && ( e->key() == Qt::Key_Up || e->key() == Qt::Key_Down ) )
{
itemClicked( treeView->selectionModel()->currentIndex() );
}
else
{
e->ignore();
}
}

void QgsBrowser::stopRendering()
{
// you might have seen this already in QgisApp
Expand Down
1 change: 1 addition & 0 deletions src/browser/qgsbrowser.h
Expand Up @@ -59,6 +59,7 @@ class QgsBrowser : public QMainWindow, private Ui::QgsBrowserBase

protected:
void keyPressEvent( QKeyEvent * e );
void keyReleaseEvent( QKeyEvent * e );

bool layerClicked( QgsLayerItem* ptr );

Expand Down

0 comments on commit cfc8bdc

Please sign in to comment.