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
This commit is contained in:
csoler 2013-08-25 20:45:59 +00:00
parent d1d2fbb869
commit 5bf1ce8f07

View File

@ -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<QKeyEvent*>(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<QKeyEvent*>(event);