Skip to content

Commit

Permalink
Only highlight feature of active attribute dialog
Browse files Browse the repository at this point in the history
Fix #13634
  • Loading branch information
m-kuhn committed Oct 23, 2015
1 parent b9b0865 commit 2e85053
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/gui/qgsattributedialog.cpp
Expand Up @@ -125,3 +125,13 @@ void QgsAttributeDialog::init( QgsVectorLayer* layer, QgsFeature* feature, const
restoreGeometry();
focusNextChild();
}

bool QgsAttributeDialog::event( QEvent* e )
{
if ( e->type() == QEvent::WindowActivate && mHighlight )
mHighlight->show();
else if ( e->type() == QEvent::WindowDeactivate && mHighlight )
mHighlight->hide();

return QDialog::event( e );
}
9 changes: 9 additions & 0 deletions src/gui/qgsattributedialog.h
Expand Up @@ -118,6 +118,15 @@ class GUI_EXPORT QgsAttributeDialog : public QDialog
*/
void setEditCommandMessage( const QString& message ) { mAttributeForm->setEditCommandMessage( message ); }

/**
* Intercept window activate/deactive events to show/hide the highlighted feature.
*
* @param e The event
*
* @return The same as the parent QDialog
*/
virtual bool event( QEvent *e ) override;

public slots:
void accept() override;

Expand Down

0 comments on commit 2e85053

Please sign in to comment.