diff options
| author | Felix (xq) Queißner <git@mq32.de> | 2020-06-26 23:53:47 +0200 |
|---|---|---|
| committer | Felix (xq) Queißner <git@mq32.de> | 2020-06-26 23:53:47 +0200 |
| commit | a2d567a95e388e946cae8b0a5e30a7428f12eba4 (patch) | |
| tree | 75338838a6803574a51b59bdde3f6adec631211f /src/widgets/searchbar.cpp | |
| parent | d725accd2bc2c6d9e9a749f8758c6a287a81c9b1 (diff) | |
| download | kristall-a2d567a95e388e946cae8b0a5e30a7428f12eba4.tar.gz | |
Adds favourite completions in the toolbar. This was waaaay easier than planned.
Diffstat (limited to 'src/widgets/searchbar.cpp')
| -rw-r--r-- | src/widgets/searchbar.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/widgets/searchbar.cpp b/src/widgets/searchbar.cpp index 4d8ea3a..a89b8d6 100644 --- a/src/widgets/searchbar.cpp +++ b/src/widgets/searchbar.cpp @@ -1,10 +1,16 @@ #include "searchbar.hpp" +#include "kristall.hpp" #include <QKeyEvent> +#include <QCompleter> SearchBar::SearchBar(QWidget *parent) : QLineEdit(parent) { - + QCompleter *completer = new QCompleter(this); + completer->setModel(&global_favourites); + completer->setCaseSensitivity(Qt::CaseInsensitive); + completer->setCompletionRole(Qt::DisplayRole); + this->setCompleter(completer); } void SearchBar::keyPressEvent(QKeyEvent *event) |
