Add F2 to rename browser favourite item (#8164)

This commit is contained in:
Nathan Woodrow 2018-10-11 14:08:49 +10:00 committed by GitHub
parent e4738d4eed
commit 9cad526f24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 0 deletions

View File

@ -136,6 +136,9 @@ Connections changed in the browser
Show event override
%End
virtual void keyPressEvent( QKeyEvent *event );
};

View File

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

View File

@ -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();