From 608ec4979bac9f42e49134390debbcd6a515fc5c Mon Sep 17 00:00:00 2001
From: Olli Werwolff <qtc-commiter@nokia.com>
Date: Thu, 29 Jan 2009 16:50:34 +0100
Subject: [PATCH] Fixes:    Resources in resource editor can be removed using
 the "delete" key

Task:     -
RevBy:    thorbjorn
AutoTest: -
Details:  -
---
 src/shared/qrceditor/resourceview.cpp | 8 ++++++++
 src/shared/qrceditor/resourceview.h   | 1 +
 2 files changed, 9 insertions(+)

diff --git a/src/shared/qrceditor/resourceview.cpp b/src/shared/qrceditor/resourceview.cpp
index ee9c507337f..cb010f0f4b9 100644
--- a/src/shared/qrceditor/resourceview.cpp
+++ b/src/shared/qrceditor/resourceview.cpp
@@ -382,6 +382,14 @@ void ResourceView::mouseReleaseEvent(QMouseEvent *e)
     QTreeView::mouseReleaseEvent(e);
 }
 
+void ResourceView::keyPressEvent(QKeyEvent *e)
+{
+    if (e->key() == Qt::Key_Delete)
+        removeItem();
+    else
+        QTreeView::keyPressEvent(e);
+}
+
 void ResourceView::popupMenu(const QModelIndex &index)
 {
     if (!m_releasePos.isNull()) {
diff --git a/src/shared/qrceditor/resourceview.h b/src/shared/qrceditor/resourceview.h
index ae11b2db93d..f50e6e6c43b 100644
--- a/src/shared/qrceditor/resourceview.h
+++ b/src/shared/qrceditor/resourceview.h
@@ -138,6 +138,7 @@ protected:
     void changeLang(const QModelIndex &index);
     void changeAlias(const QModelIndex &index);
     void mouseReleaseEvent(QMouseEvent *e);
+    void keyPressEvent(QKeyEvent *e);
 
 signals:
     void removeItem();
-- 
GitLab