Enable up/down arrow key navigation of browser application data layers

This commit is contained in:
Larry Shaffer 2012-09-24 18:27:01 -06:00
parent 4c335826b7
commit cfc8bdc97a
2 changed files with 14 additions and 0 deletions

View File

@ -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

View File

@ -59,6 +59,7 @@ class QgsBrowser : public QMainWindow, private Ui::QgsBrowserBase
protected:
void keyPressEvent( QKeyEvent * e );
void keyReleaseEvent( QKeyEvent * e );
bool layerClicked( QgsLayerItem* ptr );