This commit is contained in:
Martin Rotter 2021-09-27 10:53:46 +02:00
parent a87e09d49a
commit 2888458e47
2 changed files with 9 additions and 2 deletions

View File

@ -221,7 +221,14 @@ void MessagesView::setupAppearance() {
void MessagesView::focusInEvent(QFocusEvent* event) {
QTreeView::focusInEvent(event);
if (currentIndex().isValid()) {
qDebugNN << LOGSEC_GUI
<< "Message list got focus with reason"
<< QUOTE_W_SPACE_DOT(event->reason());
if ((event->reason()== Qt::FocusReason::TabFocusReason ||
event->reason()== Qt::FocusReason::BacktabFocusReason ||
event->reason()== Qt::FocusReason::ShortcutFocusReason) &&
currentIndex().isValid()) {
selectionModel()->select(currentIndex(), QItemSelectionModel::SelectionFlag::Select | QItemSelectionModel::SelectionFlag::Rows);
}
}

View File

@ -161,7 +161,7 @@ void WebBrowser::loadMessages(const QList<Message>& messages, RootItem* root) {
}
void WebBrowser::loadMessage(const Message& message, RootItem* root) {
loadMessages(QList<Message>() << message, root);
loadMessages({ message }, root);
}
bool WebBrowser::eventFilter(QObject* watched, QEvent* event) {