Commit 35277af9 authored by Milian Wolff's avatar Milian Wolff

Add 'back' to QuickOpenEmbeddedWidgetInterface

The AbstractNavigationWidget already supported this, and it was
picked up by KTextEditor. But our own quickopen embedded widget
interface didn't allow going 'back' via Alt + Backspace yet. This
patch fixes this.
parent db9740ef
......@@ -54,15 +54,13 @@ public:
QSize sizeHint() const override;
public Q_SLOTS:
///Keyboard-action "next"
/// keyboard navigation support
void next() override;
///Keyboard-action "previous"
void previous() override;
///Keyboard-action "accept"
void accept() override;
void up() override;
void down() override;
virtual void back();
void back() override;
///These are temporarily for gettings these events directly from kate
///@todo Do this through a public interface post 4.2
......@@ -70,6 +70,8 @@ public:
virtual void up() = 0;
///Is called when the keyboard-shortcut "scroll down" is triggered on the widget, which currently is ALT+Down
virtual void down() = 0;
///Is called when the keyboard-shortcut "back" is triggered on the widget, which currently is ALT+Backspace
virtual void back() = 0;
......@@ -447,13 +447,16 @@ bool QuickOpenWidget::eventFilter(QObject* watched, QEvent* event)
case Qt::Key_Down:
case Qt::Key_Up:
case Qt::Key_Backspace:
if (keyEvent->modifiers() == Qt::AltModifier) {
if (auto interface = getInterface()) {
if (keyEvent->key() == Qt::Key_Down) {
} else {
} else if (keyEvent->key() == Qt::Key_Up) {
} else {
return true; // eat event
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment