diff --git a/src/widgets/omnibar.cpp b/src/widgets/omnibar.cpp index 4f54de2b..bea0cce6 100644 --- a/src/widgets/omnibar.cpp +++ b/src/widgets/omnibar.cpp @@ -4,6 +4,8 @@ #include #include #include +#include + Omnibar::Omnibar(MainWindow *main, QWidget *parent) : QLineEdit(parent), @@ -84,6 +86,15 @@ void Omnibar::showCommands() completer->complete(); } +void Omnibar::clear() +{ + QLineEdit::clear(); + + // Close the potential shown completer popup + clearFocus(); + setFocus(); +} + void Omnibar::on_gotoEntry_returnPressed() { QString str = this->text(); diff --git a/src/widgets/omnibar.h b/src/widgets/omnibar.h index 7722dfe3..db21dd87 100644 --- a/src/widgets/omnibar.h +++ b/src/widgets/omnibar.h @@ -20,6 +20,7 @@ private slots: public slots: void showCommands(); + void clear(); private: void setupCompleter();