From: Flavio Tordini Date: Wed, 29 Jul 2009 08:52:00 +0000 (+0200) Subject: Autocompleter refinements X-Git-Tag: 0.5~8 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=356d4eb7481232a19f8bb31ce9d166d31461e992;p=minitube Autocompleter refinements --- 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);