diff options
Diffstat (limited to 'examples/network/googlesuggest/googlesuggest.cpp')
-rw-r--r-- | examples/network/googlesuggest/googlesuggest.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/examples/network/googlesuggest/googlesuggest.cpp b/examples/network/googlesuggest/googlesuggest.cpp index d27beafd1e..2cba43178e 100644 --- a/examples/network/googlesuggest/googlesuggest.cpp +++ b/examples/network/googlesuggest/googlesuggest.cpp @@ -48,9 +48,9 @@ ** ****************************************************************************/ -//! [1] #include "googlesuggest.h" +//! [1] const QString gsuggestUrl(QStringLiteral("http://google.com/complete/search?output=toolbar&q=%1")); //! [1] @@ -74,16 +74,18 @@ GSuggestCompletion::GSuggestCompletion(QLineEdit *parent): QObject(parent), edit popup->installEventFilter(this); - connect(popup, SIGNAL(itemClicked(QTreeWidgetItem*,int)), - SLOT(doneCompletion())); + connect(popup, &QTreeWidget::itemClicked, + this, &GSuggestCompletion::doneCompletion); timer.setSingleShot(true); timer.setInterval(500); - connect(&timer, SIGNAL(timeout()), SLOT(autoSuggest())); - connect(editor, SIGNAL(textEdited(QString)), &timer, SLOT(start())); + connect(&timer, &QTimer::timeout, + this, &GSuggestCompletion::autoSuggest); + connect(editor, &QLineEdit::textEdited, + &timer, QOverload<>::of(&QTimer::start)); - connect(&networkManager, SIGNAL(finished(QNetworkReply*)), - this, SLOT(handleNetworkData(QNetworkReply*))); + connect(&networkManager, &QNetworkAccessManager::finished, + this, &GSuggestCompletion::handleNetworkData); } //! [2] |