mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-12-16 17:13:58 -05:00
fixed bug in ModelIndex creation in channel post view, and implemented arrow key navigation
This commit is contained in:
parent
0ed32eb597
commit
8a20ab33b4
5 changed files with 48 additions and 1 deletions
|
|
@ -504,6 +504,30 @@ GxsChannelPostsWidgetWithModel::GxsChannelPostsWidgetWithModel(const RsGxsGroupI
|
|||
}, mEventHandlerId, RsEventType::GXS_CHANNELS );
|
||||
}
|
||||
|
||||
void GxsChannelPostsWidgetWithModel::keyPressEvent(QKeyEvent *e)
|
||||
{
|
||||
QModelIndex index = ui->postsTree->selectionModel()->currentIndex();
|
||||
|
||||
if(index.isValid() && mChannelPostsModel->getMode() == RsGxsChannelPostsModel::TREE_MODE_GRID)
|
||||
{
|
||||
int n = mChannelPostsModel->columnCount(index.row())-1;
|
||||
|
||||
if(e->key() == Qt::Key_Left && index.column()==0)
|
||||
{
|
||||
ui->postsTree->setCurrentIndex(index.siblingAtColumn(n));
|
||||
e->accept();
|
||||
return;
|
||||
}
|
||||
if(e->key() == Qt::Key_Right && index.column()==n)
|
||||
{
|
||||
ui->postsTree->setCurrentIndex(index.siblingAtColumn(0));
|
||||
e->accept();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
GxsMessageFrameWidget::keyPressEvent(e);
|
||||
}
|
||||
void GxsChannelPostsWidgetWithModel::resizeEvent(QResizeEvent *e)
|
||||
{
|
||||
GxsMessageFrameWidget::resizeEvent(e);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue