mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-15 04:22:27 -04:00
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:
parent
47f97e20b9
commit
aae947ecd8
6 changed files with 72 additions and 44 deletions
|
@ -130,6 +130,11 @@ MessagesDialog::MessagesDialog(QWidget *parent)
|
|||
// connect after setting model
|
||||
connect( ui.messagestreeView->selectionModel(), SIGNAL(currentChanged ( QModelIndex, QModelIndex ) ) , this, SLOT( currentChanged( const QModelIndex & ) ) );
|
||||
|
||||
// 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.messagestreeView, 0, 0, Qt::WidgetShortcut);
|
||||
connect(Shortcut, SIGNAL(activated()), this, SLOT( removemessage ()));
|
||||
|
||||
/* hide the Tree +/- */
|
||||
ui.msgList->setRootIsDecorated( false );
|
||||
ui.msgList->setSelectionMode( QAbstractItemView::ExtendedSelection );
|
||||
|
@ -199,16 +204,17 @@ MessagesDialog::~MessagesDialog()
|
|||
delete(timer);
|
||||
}
|
||||
|
||||
void MessagesDialog::keyPressEvent(QKeyEvent *e)
|
||||
{
|
||||
if(e->key() == Qt::Key_Delete)
|
||||
{
|
||||
removemessage() ;
|
||||
e->accept() ;
|
||||
}
|
||||
else
|
||||
MainPage::keyPressEvent(e) ;
|
||||
}
|
||||
// replaced by shortcut
|
||||
//void MessagesDialog::keyPressEvent(QKeyEvent *e)
|
||||
//{
|
||||
// if(e->key() == Qt::Key_Delete)
|
||||
// {
|
||||
// removemessage() ;
|
||||
// e->accept() ;
|
||||
// }
|
||||
// else
|
||||
// MainPage::keyPressEvent(e) ;
|
||||
//}
|
||||
|
||||
void MessagesDialog::messageslistWidgetCostumPopupMenu( QPoint point )
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue