mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-13 10:32:11 +01:00
LocationCompleterView: Fix Shift+Tab handling
This commit is contained in:
parent
11e2ff168e
commit
d443a69d8f
|
@ -199,11 +199,15 @@ bool LocationCompleterView::eventFilter(QObject* object, QEvent* event)
|
||||||
|
|
||||||
case Qt::Key_Tab:
|
case Qt::Key_Tab:
|
||||||
case Qt::Key_Backtab: {
|
case Qt::Key_Backtab: {
|
||||||
if (keyEvent->modifiers() != Qt::NoModifier) {
|
const bool isShift = keyEvent->modifiers() == Qt::ShiftModifier;
|
||||||
|
if (keyEvent->modifiers() != Qt::NoModifier && !isShift) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Qt::Key k = keyEvent->key() == Qt::Key_Tab ? Qt::Key_Down : Qt::Key_Up;
|
bool isBack = keyEvent->key() == Qt::Key_Backtab;
|
||||||
QKeyEvent ev(QKeyEvent::KeyPress, k, Qt::NoModifier);
|
if (keyEvent->key() == Qt::Key_Tab && isShift) {
|
||||||
|
isBack = true;
|
||||||
|
}
|
||||||
|
QKeyEvent ev(QKeyEvent::KeyPress, isBack ? Qt::Key_Up : Qt::Key_Down, Qt::NoModifier);
|
||||||
QApplication::sendEvent(focusProxy(), &ev);
|
QApplication::sendEvent(focusProxy(), &ev);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user