Skip to content

Commit 9cad526

Browse files
authored
Add F2 to rename browser favourite item (#8164)
1 parent e4738d4 commit 9cad526

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

python/gui/auto_generated/qgsbrowserdockwidget.sip.in

+3
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ Connections changed in the browser
136136
Show event override
137137
%End
138138

139+
virtual void keyPressEvent( QKeyEvent *event );
140+
141+
139142
};
140143

141144

src/gui/qgsbrowserdockwidget.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,15 @@ void QgsBrowserDockWidget::showEvent( QShowEvent *e )
157157
QgsDockWidget::showEvent( e );
158158
}
159159

160+
void QgsBrowserDockWidget::keyPressEvent( QKeyEvent *event )
161+
{
162+
if ( event->key() == Qt::Key_F2 )
163+
{
164+
renameFavorite();
165+
event->accept();
166+
}
167+
}
168+
160169
void QgsBrowserDockWidget::itemDoubleClicked( const QModelIndex &index )
161170
{
162171
QgsDataItem *item = mModel->dataItem( mProxyModel->mapToSource( index ) );

src/gui/qgsbrowserdockwidget.h

+2
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ class GUI_EXPORT QgsBrowserDockWidget : public QgsDockWidget, private Ui::QgsBro
110110
//! Show event override
111111
void showEvent( QShowEvent *event ) override;
112112

113+
void keyPressEvent( QKeyEvent *event ) override;
114+
113115
private slots:
114116
void itemDoubleClicked( const QModelIndex &index );
115117
void renameFavorite();

0 commit comments

Comments
 (0)