Skip to content

Commit

Permalink
skip showing the empty qtoolbutton when the menu hides
Browse files Browse the repository at this point in the history
  • Loading branch information
uclaros committed Apr 17, 2020
1 parent 49b7d5d commit 856627b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/app/qgssnappinglayertreemodel.cpp
Expand Up @@ -43,8 +43,16 @@ class SnapTypeMenu: public QMenu
else
QMenu::mouseReleaseEvent( e );
}

// set focus to parent so that mTypeButton is not displayed
void hideEvent( QHideEvent *e )
{
qobject_cast<QWidget *>( parent() )->setFocus();
QMenu::hideEvent( e );
}
};


QgsSnappingLayerDelegate::QgsSnappingLayerDelegate( QgsMapCanvas *canvas, QObject *parent )
: QItemDelegate( parent )
, mCanvas( canvas )
Expand Down

0 comments on commit 856627b

Please sign in to comment.