Skip to content

Commit

Permalink
Add F2 to rename browser favourite item (#8164)
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanW2 committed Oct 11, 2018
1 parent e4738d4 commit 9cad526
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/gui/auto_generated/qgsbrowserdockwidget.sip.in
Expand Up @@ -136,6 +136,9 @@ Connections changed in the browser
Show event override
%End

virtual void keyPressEvent( QKeyEvent *event );


};


Expand Down
9 changes: 9 additions & 0 deletions src/gui/qgsbrowserdockwidget.cpp
Expand Up @@ -157,6 +157,15 @@ void QgsBrowserDockWidget::showEvent( QShowEvent *e )
QgsDockWidget::showEvent( e );
}

void QgsBrowserDockWidget::keyPressEvent( QKeyEvent *event )
{
if ( event->key() == Qt::Key_F2 )
{
renameFavorite();
event->accept();
}
}

void QgsBrowserDockWidget::itemDoubleClicked( const QModelIndex &index )
{
QgsDataItem *item = mModel->dataItem( mProxyModel->mapToSource( index ) );
Expand Down
2 changes: 2 additions & 0 deletions src/gui/qgsbrowserdockwidget.h
Expand Up @@ -110,6 +110,8 @@ class GUI_EXPORT QgsBrowserDockWidget : public QgsDockWidget, private Ui::QgsBro
//! Show event override
void showEvent( QShowEvent *event ) override;

void keyPressEvent( QKeyEvent *event ) override;

private slots:
void itemDoubleClicked( const QModelIndex &index );
void renameFavorite();
Expand Down

0 comments on commit 9cad526

Please sign in to comment.