Skip to content
Permalink
Browse files

Add F2 to rename browser favourite item (#8164)

  • Loading branch information
NathanW2 committed Oct 11, 2018
1 parent e4738d4 commit 9cad526f2442b20b945ff4d8cf6df55b5873a213
@@ -136,6 +136,9 @@ Connections changed in the browser
Show event override
%End

virtual void keyPressEvent( QKeyEvent *event );


};


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

0 comments on commit 9cad526

Please sign in to comment.
You can’t perform that action at this time.