Skip to content
Permalink
Browse files
Fix Escape key press should close current stacked panel
Code was present but not correctly hooked up before
  • Loading branch information
nyalldawson committed Apr 4, 2018
1 parent 7e6f423 commit 846ca49755693af617d93cafe52a557b85a31951
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
@@ -130,6 +130,8 @@ This slot is normally auto connected to panelAccepted when a panel is shown.

virtual void mouseReleaseEvent( QMouseEvent *e );

virtual void keyPressEvent( QKeyEvent *e );


};

@@ -155,6 +155,14 @@ void QgsPanelWidgetStack::mouseReleaseEvent( QMouseEvent *e )
}
}

void QgsPanelWidgetStack::keyPressEvent( QKeyEvent *e )
{
if ( e->key() == Qt::Key_Escape )
{
acceptCurrentPanel();
}
}

void QgsPanelWidgetStack::updateBreadcrumb()
{
QString breadcrumb;
@@ -122,6 +122,7 @@ class GUI_EXPORT QgsPanelWidgetStack : public QWidget, private Ui::QgsRendererWi
protected:

void mouseReleaseEvent( QMouseEvent *e ) override;
void keyPressEvent( QKeyEvent *e ) override;

private:
void updateBreadcrumb();

0 comments on commit 846ca49

Please sign in to comment.