From 356d4eb7481232a19f8bb31ce9d166d31461e992 Mon Sep 17 00:00:00 2001 From: Flavio Tordini Date: Wed, 29 Jul 2009 10:52:00 +0200 Subject: [PATCH] Autocompleter refinements --- src/searchlineedit.cpp | 10 +++++++++- src/searchlineedit.h | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/searchlineedit.cpp b/src/searchlineedit.cpp index 3c4e1fa..01b8fc2 100644 --- a/src/searchlineedit.cpp +++ b/src/searchlineedit.cpp @@ -176,7 +176,7 @@ m_searchButton(new SearchButton(this)) setSizePolicy(QSizePolicy::Preferred, policy.verticalPolicy()); // completion - completion = new GSuggestCompletion(m_lineEdit); + completion = new GSuggestCompletion(this, m_lineEdit); } void SearchLineEdit::paintEvent(QPaintEvent *event) @@ -246,3 +246,11 @@ void SearchLineEdit::returnPressed() completion->preventSuggest(); emit search(lineEdit()->text()); } + +void SearchLineEdit::enableSuggest() { + completion->enableSuggest(); +} + +void SearchLineEdit::preventSuggest() { + completion->preventSuggest(); +} diff --git a/src/searchlineedit.h b/src/searchlineedit.h index 99ab266..36c8fe1 100644 --- a/src/searchlineedit.h +++ b/src/searchlineedit.h @@ -86,6 +86,8 @@ public: QMenu *menu() const; void setMenu(QMenu *menu); void updateGeometries(); + void enableSuggest(); + void preventSuggest(); protected: void resizeEvent(QResizeEvent *event); -- 2.39.5