Fix Roomlist Shortcuts

Fix the ctrl + pgup/pgdwn shortcuts for the room list so that they work with tree model

BUG: 485949
(cherry picked from commit 28c9d94457)
This commit is contained in:
James Graham
2024-04-22 22:01:46 +00:00
committed by Tobias Fella
parent 3786710d81
commit 4dfd4b68eb
3 changed files with 30 additions and 14 deletions

View File

@@ -205,4 +205,14 @@ void SortFilterRoomTreeModel::setMode(SortFilterRoomTreeModel::Mode mode)
invalidate();
}
QModelIndex SortFilterRoomTreeModel::currentRoomIndex() const
{
const auto roomModel = dynamic_cast<RoomTreeModel *>(sourceModel());
if (roomModel == nullptr) {
return {};
}
return mapFromSource(roomModel->indexForRoom(RoomManager::instance().currentRoom()));
}
#include "moc_sortfilterroomtreemodel.cpp"

View File

@@ -76,6 +76,8 @@ public:
Mode mode() const;
void setMode(Mode mode);
Q_INVOKABLE QModelIndex currentRoomIndex() const;
protected:
/**
* @brief Returns true if the value of source_left is less than source_right.