Skip to content

Commit

Permalink
#9094: AttributeTableDialog use del/backspace
Browse files Browse the repository at this point in the history
 use
  • Loading branch information
ahuarte47 committed Dec 17, 2013
1 parent 58d2093 commit 9106659
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
10 changes: 10 additions & 0 deletions src/app/qgsattributetabledialog.cpp
Expand Up @@ -222,6 +222,16 @@ void QgsAttributeTableDialog::closeEvent( QCloseEvent* event )
}
}

void QgsAttributeTableDialog::keyPressEvent( QKeyEvent* event )
{
QDialog::keyPressEvent( event );

if ( ( event->key() == Qt::Key_Backspace || event->key() == Qt::Key_Delete ) && mDeleteSelectedButton->isEnabled() )
{
QgisApp::instance()->deleteSelected( mLayer, this );
}
}

void QgsAttributeTableDialog::columnBoxInit()
{
foreach ( QAction* a, mFilterColumnsMenu->actions() )
Expand Down
6 changes: 6 additions & 0 deletions src/app/qgsattributetabledialog.h
Expand Up @@ -172,6 +172,12 @@ class APP_EXPORT QgsAttributeTableDialog : public QDialog, private Ui::QgsAttrib
*/
void closeEvent( QCloseEvent* event );

/*
* Handle KeyPress event of the window
* @param event
*/
void keyPressEvent( QKeyEvent* event );

private slots:
/**
* Initialize column box
Expand Down
3 changes: 0 additions & 3 deletions src/ui/qgsattributetabledialog.ui
Expand Up @@ -127,9 +127,6 @@
<height>18</height>
</size>
</property>
<property name="shortcut">
<string>Delete</string>
</property>
</widget>
</item>
<item>
Expand Down

0 comments on commit 9106659

Please sign in to comment.