From 5bf1ce8f0700ce4fd21e5aada1237a5653fcba6d Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 25 Aug 2013 20:45:59 +0000 Subject: [PATCH] hability to delete some lines in chat history browser (Patch from Phenom) git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6612 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/chat/ChatWidget.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/chat/ChatWidget.cpp b/retroshare-gui/src/gui/chat/ChatWidget.cpp index 995901d09..f2c5d9676 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.cpp +++ b/retroshare-gui/src/gui/chat/ChatWidget.cpp @@ -240,7 +240,20 @@ void ChatWidget::processSettings(bool load) bool ChatWidget::eventFilter(QObject *obj, QEvent *event) { - if (obj == ui->chatTextEdit) { + if (obj == ui->textBrowser) { + if (event->type() == QEvent::KeyPress) { + + QKeyEvent *keyEvent = static_cast(event); + if (keyEvent) { + if (keyEvent->key() == Qt::Key_Delete ) { + // Delete pressed + if (ui->textBrowser->textCursor().selectedText().length()>0) + ui->textBrowser->textCursor().deleteChar(); + + } + } + } + } else if (obj == ui->chatTextEdit) { if (event->type() == QEvent::KeyPress) { QKeyEvent *keyEvent = static_cast(event);