Skip to content

Commit 9106659

Browse files
committed
#9094: AttributeTableDialog use del/backspace
use
1 parent 58d2093 commit 9106659

3 files changed

+16
-3
lines changed

src/app/qgsattributetabledialog.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,16 @@ void QgsAttributeTableDialog::closeEvent( QCloseEvent* event )
222222
}
223223
}
224224

225+
void QgsAttributeTableDialog::keyPressEvent( QKeyEvent* event )
226+
{
227+
QDialog::keyPressEvent( event );
228+
229+
if ( ( event->key() == Qt::Key_Backspace || event->key() == Qt::Key_Delete ) && mDeleteSelectedButton->isEnabled() )
230+
{
231+
QgisApp::instance()->deleteSelected( mLayer, this );
232+
}
233+
}
234+
225235
void QgsAttributeTableDialog::columnBoxInit()
226236
{
227237
foreach ( QAction* a, mFilterColumnsMenu->actions() )

src/app/qgsattributetabledialog.h

+6
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,12 @@ class APP_EXPORT QgsAttributeTableDialog : public QDialog, private Ui::QgsAttrib
172172
*/
173173
void closeEvent( QCloseEvent* event );
174174

175+
/*
176+
* Handle KeyPress event of the window
177+
* @param event
178+
*/
179+
void keyPressEvent( QKeyEvent* event );
180+
175181
private slots:
176182
/**
177183
* Initialize column box

src/ui/qgsattributetabledialog.ui

-3
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,6 @@
127127
<height>18</height>
128128
</size>
129129
</property>
130-
<property name="shortcut">
131-
<string>Delete</string>
132-
</property>
133130
</widget>
134131
</item>
135132
<item>

0 commit comments

Comments
 (0)