Skip to content
Permalink
Browse files
Allow clicking mouse back button on stacked panel widgets
Only works if click occurs outside of widgets - we probably should
start ignoring clicks which aren't left/middle/right in any
mouse event handlers
  • Loading branch information
nyalldawson committed Mar 17, 2017
1 parent 7aff3e7 commit e5f581405e69607a42aec834ad6e51f8d831063a
Showing with 18 additions and 0 deletions.
  1. +5 −0 python/gui/qgspanelwidgetstack.sip
  2. +8 −0 src/gui/qgspanelwidgetstack.cpp
  3. +5 −0 src/gui/qgspanelwidgetstack.h
@@ -89,4 +89,9 @@ class QgsPanelWidgetStack: public QWidget
* @param panel The panel to close.
*/
void closePanel( QgsPanelWidget* panel );

protected:

void mouseReleaseEvent( QMouseEvent *e );

};
@@ -147,6 +147,14 @@ void QgsPanelWidgetStack::closePanel( QgsPanelWidget *panel )
this->updateBreadcrumb();
}

void QgsPanelWidgetStack::mouseReleaseEvent( QMouseEvent *e )
{
if ( e->button() == Qt::BackButton )
{
acceptCurrentPanel();
}
}

void QgsPanelWidgetStack::updateBreadcrumb()
{
QString breadcrumb;
@@ -117,6 +117,11 @@ class GUI_EXPORT QgsPanelWidgetStack : public QWidget, private Ui::QgsRendererWi
* @param panel The panel to close.
*/
void closePanel( QgsPanelWidget *panel );

protected:

void mouseReleaseEvent( QMouseEvent *e ) override;

private:
void updateBreadcrumb();
QStack<QString> mTitles;

0 comments on commit e5f5814

Please sign in to comment.