diff options
Diffstat (limited to 'examples/network/googlesuggest/searchbox.cpp')
-rw-r--r-- | examples/network/googlesuggest/searchbox.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/network/googlesuggest/searchbox.cpp b/examples/network/googlesuggest/searchbox.cpp index 21599e0..ae08a75 100644 --- a/examples/network/googlesuggest/searchbox.cpp +++ b/examples/network/googlesuggest/searchbox.cpp @@ -47,12 +47,12 @@ #define GSEARCH_URL "http://www.google.com/search?q=%1" - +//! [1] SearchBox::SearchBox(QWidget *parent): QLineEdit(parent) { completer = new GSuggestCompletion(this); - connect(this, SIGNAL(returnPressed()), SLOT(doSearch())); + connect(this, SIGNAL(returnPressed()),this, SLOT(doSearch())); setWindowTitle("Search with Google"); @@ -60,10 +60,13 @@ SearchBox::SearchBox(QWidget *parent): QLineEdit(parent) resize(400, height()); setFocus(); } +//! [1] +//! [2] void SearchBox::doSearch() { completer->preventSuggest(); QString url = QString(GSEARCH_URL).arg(text()); QDesktopServices::openUrl(QUrl(url)); } +//! [2]
\ No newline at end of file |