Skip to content
Permalink
Browse files

Fix Escape key press should close current stacked panel

Code was present but not correctly hooked up before

(cherry-picked from 846ca49)
  • Loading branch information
nyalldawson committed Apr 6, 2018
1 parent f1249ce commit b5644dd436390eb88b22b359e2b6bb2e929d5179
Showing with 11 additions and 0 deletions.
  1. +2 −0 python/gui/qgspanelwidgetstack.sip.in
  2. +8 −0 src/gui/qgspanelwidgetstack.cpp
  3. +1 −0 src/gui/qgspanelwidgetstack.h
@@ -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 b5644dd

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