Workaround for erroneously accept of Qt::Key_Delete on QAbstractItemView

see http://bugreports.qt.nokia.com/browse/QTBUG-8270

solved for PeersDialog, MessagesDialog and TransfersDialog


git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2858 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-05-06 14:39:50 +00:00
parent 47f97e20b9
commit aae947ecd8
6 changed files with 72 additions and 44 deletions

View file

@ -220,6 +220,11 @@ PeersDialog::PeersDialog(QWidget *parent)
loadmypersonalstatus();
loadEmoticonsgroupchat();
// workaround for Qt bug, should be solved in next Qt release 4.7.0
// http://bugreports.qt.nokia.com/browse/QTBUG-8270
QShortcut *Shortcut = new QShortcut(QKeySequence (Qt::Key_Delete), ui.peertreeWidget, 0, 0, Qt::WidgetShortcut);
connect(Shortcut, SIGNAL(activated()), this, SLOT( removefriend ()));
/* Hide platform specific features */
#ifdef Q_WS_WIN
@ -334,16 +339,17 @@ void PeersDialog::peertreeWidgetCostumPopupMenu( QPoint point )
contextMnu.exec( mevent->globalPos() );
}
void PeersDialog::keyPressEvent(QKeyEvent *e)
{
if(e->key() == Qt::Key_Delete)
{
removefriend() ;
e->accept() ;
}
else
MainPage::keyPressEvent(e) ;
}
// replaced by shortcut
//void PeersDialog::keyPressEvent(QKeyEvent *e)
//{
// if(e->key() == Qt::Key_Delete)
// {
// removefriend() ;
// e->accept() ;
// }
// else
// MainPage::keyPressEvent(e) ;
//}
void PeersDialog::updateDisplay()
{