From ea51c14faccfe00753e8a2b708885f23be9ff717 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Wed, 25 Jan 2023 11:56:21 +0100 Subject: [PATCH] Delete googlesuggest As a networking example it doesn't contribute much. But it has some interesting uses of widget/events Change-Id: I194d32e6a304ae41819c20751e9f1ee1d9b5abdb Reviewed-by: Konrad Kujawa Reviewed-by: Timur Pocheptsov Reviewed-by: Alex Blasche (cherry picked from commit 21453410713650a97a074a8f3d78afbb4c70e6b3) Reviewed-by: Qt Cherry-pick Bot --- examples/network/CMakeLists.txt | 1 - .../doc/images/googlesuggest-example.png | Bin 21272 -> 0 bytes examples/network/doc/src/googlesuggest.qdoc | 153 --------------- examples/network/googlesuggest/CMakeLists.txt | 39 ---- .../network/googlesuggest/googlesuggest.cpp | 184 ------------------ .../network/googlesuggest/googlesuggest.h | 37 ---- .../network/googlesuggest/googlesuggest.pro | 8 - examples/network/googlesuggest/main.cpp | 14 -- examples/network/googlesuggest/searchbox.cpp | 35 ---- examples/network/googlesuggest/searchbox.h | 28 --- examples/network/network.pro | 1 - src/network/doc/src/examples.qdoc | 1 - 12 files changed, 501 deletions(-) delete mode 100644 examples/network/doc/images/googlesuggest-example.png delete mode 100644 examples/network/doc/src/googlesuggest.qdoc delete mode 100644 examples/network/googlesuggest/CMakeLists.txt delete mode 100644 examples/network/googlesuggest/googlesuggest.cpp delete mode 100644 examples/network/googlesuggest/googlesuggest.h delete mode 100644 examples/network/googlesuggest/googlesuggest.pro delete mode 100644 examples/network/googlesuggest/main.cpp delete mode 100644 examples/network/googlesuggest/searchbox.cpp delete mode 100644 examples/network/googlesuggest/searchbox.h diff --git a/examples/network/CMakeLists.txt b/examples/network/CMakeLists.txt index 59a97cca89f..1b1cfa55f79 100644 --- a/examples/network/CMakeLists.txt +++ b/examples/network/CMakeLists.txt @@ -16,7 +16,6 @@ if(TARGET Qt6::Widgets) qt_internal_add_example(http) qt_internal_add_example(loopback) qt_internal_add_example(threadedfortuneserver) - qt_internal_add_example(googlesuggest) qt_internal_add_example(torrent) qt_internal_add_example(multicastreceiver) qt_internal_add_example(multicastsender) diff --git a/examples/network/doc/images/googlesuggest-example.png b/examples/network/doc/images/googlesuggest-example.png deleted file mode 100644 index c704f5b2b4943d4382ee251dd5c5ebe4c91094bd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21272 zcmYg&b97`+v~?!Q#J1V7ZQHhO+qN+=CYac^ok=orCbn(o>-oL!t@Zxs?tAOjtyS1( z*EzeYI!aMq0v-kj1_T5IUP@9_83g28GVuBt3Ig~&l4a-&{DF3q)N%m z5Cv+VY#f#W915E3-dIwYV+AYL=gK*SPAiR8%k5Y7e2;*-dSg}`?6!-+vcC4kG_T9y z@4t6EGcM-Sq<>rN=Ho{ReKPQQT9kEkLTV(Cp};|d1l8D-mFKZ^SyOR)pF$9}q%Okt z)3SR-{OsT>N(w1ah@w_ef%(1}n&4n4Z4hyB{V@1ErFV9A;ei={>V2}ydVd&eh_%Yd zP`8x`5+p)`5)@Vku&NQ`L?x%@42T5y6v{~w_}mloYv1x$R1}_tmofay<{C3tfE*>7 z=|BDA`*pac_^riZEtXbBw5X$u_}}w;NkCyy88eTEEm$P<_|D+s%8F~22j;&T|Ae)z zL$f}!UJV7{#F0$G_+_Hj)5VksW;k*N8)2=mOQKj-L{DDyo!t;k`ehe?Rjr}`UlW?i zNDDKlbE+`X=5*VBN_|et-gyaOR z&ugzy+k%6ejm_x@^6~mW%0&Eas-RE;9tQ`PYNI#5+eao+V7P@ppAwuD`Q9=WEg`yq zQ`AcyB&~W556)1u$n=@jb&AXzF=%`2YLL0!E*lIIVTgRK_x)E)qFMWBZdO*vkQTd# zETMEjZFIFnzcmGaLu@hE3NGXG2L+F18o-xdp|!Km zQv=9qas4{rLMPcpQj86 zpGavQ6kw{>f2KYzdHqx7l&V}~&>ab3#OWkXV|3bNYV8~rXQkqp7d)7Bg*_wfFMpGn zM-eA`T-?+;iyz3PB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PMt6qZULpn}%a&^eRt2V=p;<{MscX>)1#?IYH;% zCw$N7*|&w@3X#rSVc9`LSJY6IUd%t$H{ve|k`tSkKh%`J_MPnX?5XQI1dLvQrN0;l zwxDZ$&jUJ@o}V&QIm6jKc8~T1s=#8objuVM$1hhp?FJ@fL+NkiaE9X*@4RKm;SK!{ zKrxW2Uyt!tr*zbwF{+>Idp;_%mPFTCc3v_D+%`?(-Q^OT>e^?2Hpr@99~KUqDLh7R zRCna|dUPLmD!HFXhUO@oJQMo7`=7l2JKw_{kU=CG$Uy!IkJ*r_#Un~bM?XlV&L1@P z(h1Hi%CEAx{=lI}ZrZZ)oEjh8u?8$i8g!+lsTb1k%I$qeDxjB|-_%@Yf|sm6 zB^S)xof=EWtRD$=>YaG`BdWEDVMKX&qtMF;IpE8S$(Y7moB)06Q?jl*3}6I>dUmWT z=w?x-#_nGR{OOr9tP3mJpGwtl_l3Wu5q+((%TW179b|A3!bKdLPE90vp!J^;EuFKj zYJyPl^)Xt_!X7n`H&pA3&dshCTa}{`mq-5J-wxa2E1=#L^QP7iCI^cEQw1E5Shwm8(j=fZ`e&Q_0x)wf&P}Qn*Yj)pRcM z3EQVS{tcPDV+)Ia#=^S zTy`0#f7X#RxK7*+RE|fs=g?`h{Hk#Z`lu)kd)giD48ci!ttqF;AikI*4yS#E=M6^I zR5v0hj;=-YfLlGtB+L2NAN9Hu)oy+jFEXjgZBEvFuzQVDrQhU|c-yr>ld}qrv(4o1 iUJ(Z!@wS>vvV})&>|h4ANa7Ke*TC|spuAT`e*Xmv_+{Au diff --git a/examples/network/doc/src/googlesuggest.qdoc b/examples/network/doc/src/googlesuggest.qdoc deleted file mode 100644 index 0cd1b6d868f..00000000000 --- a/examples/network/doc/src/googlesuggest.qdoc +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only - -/*! - \example googlesuggest - \title Google Suggest Example - \ingroup examples-network - \brief Obtains the list of search recommendations by the Google search engine. - - The example uses the QNetworkAccessManager to obtain the list of search - recommendations by Google as the user types into a QLineEdit. - - \image googlesuggest-example.png - - The application makes use of the \c get function in - QNetworkAccessManager to post a request and obtain the result of the search - query sent to the Google search engine. The results returned are listed as - clickable links appearing below the search box as a drop-down menu. - - The widget is built up by a QLineEdit as the search box, and a QTreeView - used as a popup menu below the search box. - - \section1 GSuggestCompletion Class Declaration - - This class implements an event filter and a number of functions to display - the search results and to determent when and how to perform the search. - - \snippet googlesuggest/googlesuggest.h 1 - - The class connects to a QLineEdit and uses a QTreeWidget to display the - results. A QTimer controls the start of the network requests that are - executed using a QNetworkAccessManager. - - \section1 GSuggestCompletion Class Implementation - - We start by defining a constant containing the URL to be used in the Google - queries. This is the basis for the query. The letters typed into the search - box will be added to the query to perform the search itself. - - \snippet googlesuggest/googlesuggest.cpp 1 - - In the constructor, we set the parent of this GSuggestCompletion instance - to be the QLineEdit passed in. For simplicity, the QLineEdit is also stored - in the explicit \c editor member variable. - - We then create a QTreeWidget as a toplevel widget and configure the various - properties to give it the look of a popup widget. The widget is populated - with the results by Google Suggest API request. - - Furthermore, we install the GSuggestCompletion instance as an event filter - on the QTreeWidget, and connect the \c itemClicked() signal with the \c - doneCompletion() slot. - - A single-shot QTimer is used to start the request when the user has stopped - typing for 500 ms. - - Finally, we connect the networkManagers \c finished() signal with the \c - handleNetworkData() slot to handle the incoming data. - - \snippet googlesuggest/googlesuggest.cpp 2 - - Since the QTreeWidget popup has been instantiated as a toplevel widget, the - destructor has to delete it explicitly from memory to avoid a memory leak. - - \snippet googlesuggest/googlesuggest.cpp 3 - - The event filter handles mouse press and key press events that are - delivered to the popup. For mouse press events we just hide the popup and - return focus to the editor widget, and then return true to prevent further - event processing. - - Key event handling is implemented so that Enter and Return execute the - selected link, while the Escape key hides the popup. Since we want to be - able to navigate the list of suggestions using the different navigation - keys on the keyboard we let Qt continue regular event processing for those - by returning false from the eventFilter reimplementation. - - For all other keys, the event will be passed on to the editor widget and the - popup is hidden. This way the user's typing will not be interrupted by the - popping up of the completion list. - - \snippet googlesuggest/googlesuggest.cpp 4 - - The \c showCompletion() function populates the QTreeWidget with the results - returned from the query. It takes a QStringList of the suggested search - terms. - - \snippet googlesuggest/googlesuggest.cpp 5 - - A QTreeWidgetItem is created for each index in the list and inserted into - the QTreeWidget. Finally, we adjust position and size of the popup to make - sure that it pops up in the correct position below the editor, and show it. - - The \c doneCompletion() function, which is called by the event filter when - either Enter or Return keys are pressed, stops the timer to prevent further - requests and passes the text of the selected item to the editor. We then - make the \c editor QLineEdit emit the returnPressed() signal, to which the - application can connect to open the respective web page. - - \snippet googlesuggest/googlesuggest.cpp 6 - - The \c autoSuggest() slot is called when the timer times out, and uses the - text in the editor to build the complete search query. The query is then - passed to the QNetworkAccessManager's \c get() function to start the - request. - - \snippet googlesuggest/googlesuggest.cpp 7 - - The function \c preventSuggest() stops the timer to prevent further - requests from being started. - - \snippet googlesuggest/googlesuggest.cpp 8 - - When the network request is finished, the QNetworkAccessManager delivers the - data received from the server through the networkReply object. - - \snippet googlesuggest/googlesuggest.cpp 9 - - To extract the data from the reply we use the \c readAll() function, which - is inherited from QIODevice and returns a QByteArray. Since this data is - encoded in XML we can use a QXmlStreamReader to traverse the data and - extract the search result as QStrings, which we can stream into two - QStringLists used to populate the popup. - - Finally, we schedule the QNetworkReply object for deletion using the \c - deleteLater function. - - \section1 SearchBox Class Declaration - - The SearchBox class inherits QLineEdit and adds the protected slot \c - doSearch(). - - A \c GSuggestCompletion member provides the SearchBox with the request - functionality and the suggestions returned from the Google search engine. - - \snippet googlesuggest/searchbox.h 1 - - \section1 SearchBox Class Implementation - - The search box constructor instantiates the GSuggestCompletion object and - connects the returnPressed() signal to the doSearch() slot. - - \snippet googlesuggest/searchbox.cpp 1 - - The function \c doSearch() stops the completer from sending any further - queries to the search engine. - - Further, the function extracts the selected search phrase and opens it - in the default web browser using QDesktopServices. - - \snippet googlesuggest/searchbox.cpp 2 - -*/ diff --git a/examples/network/googlesuggest/CMakeLists.txt b/examples/network/googlesuggest/CMakeLists.txt deleted file mode 100644 index 4d331e218b8..00000000000 --- a/examples/network/googlesuggest/CMakeLists.txt +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: BSD-3-Clause - -cmake_minimum_required(VERSION 3.16) -project(googlesuggest LANGUAGES CXX) - -if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") -endif() - -set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/network/googlesuggest") - -find_package(Qt6 REQUIRED COMPONENTS Core Gui Network Widgets) - -qt_standard_project_setup() - -qt_add_executable(googlesuggest - googlesuggest.cpp googlesuggest.h - main.cpp - searchbox.cpp searchbox.h -) - -set_target_properties(googlesuggest PROPERTIES - WIN32_EXECUTABLE TRUE - MACOSX_BUNDLE TRUE -) - -target_link_libraries(googlesuggest PRIVATE - Qt6::Core - Qt6::Gui - Qt6::Network - Qt6::Widgets -) - -install(TARGETS googlesuggest - RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" - BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" - LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" -) diff --git a/examples/network/googlesuggest/googlesuggest.cpp b/examples/network/googlesuggest/googlesuggest.cpp deleted file mode 100644 index b8cb5892626..00000000000 --- a/examples/network/googlesuggest/googlesuggest.cpp +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -#include "googlesuggest.h" - -//! [1] -const QString gsuggestUrl(QStringLiteral("http://google.com/complete/search?output=toolbar&q=%1")); -//! [1] - -//! [2] -GSuggestCompletion::GSuggestCompletion(QLineEdit *parent): QObject(parent), editor(parent) -{ - popup = new QTreeWidget; - popup->setWindowFlags(Qt::Popup); - popup->setFocusPolicy(Qt::NoFocus); - popup->setFocusProxy(parent); - popup->setMouseTracking(true); - - popup->setColumnCount(1); - popup->setUniformRowHeights(true); - popup->setRootIsDecorated(false); - popup->setEditTriggers(QTreeWidget::NoEditTriggers); - popup->setSelectionBehavior(QTreeWidget::SelectRows); - popup->setFrameStyle(QFrame::Box | QFrame::Plain); - popup->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - popup->header()->hide(); - - popup->installEventFilter(this); - - connect(popup, &QTreeWidget::itemClicked, - this, &GSuggestCompletion::doneCompletion); - - timer.setSingleShot(true); - timer.setInterval(500); - connect(&timer, &QTimer::timeout, - this, &GSuggestCompletion::autoSuggest); - connect(editor, &QLineEdit::textEdited, - &timer, QOverload<>::of(&QTimer::start)); - - connect(&networkManager, &QNetworkAccessManager::finished, - this, &GSuggestCompletion::handleNetworkData); - -} -//! [2] - -//! [3] -GSuggestCompletion::~GSuggestCompletion() -{ - delete popup; -} -//! [3] - -//! [4] -bool GSuggestCompletion::eventFilter(QObject *obj, QEvent *ev) -{ - if (obj != popup) - return false; - - if (ev->type() == QEvent::MouseButtonPress) { - popup->hide(); - editor->setFocus(); - return true; - } - - if (ev->type() == QEvent::KeyPress) { - bool consumed = false; - int key = static_cast(ev)->key(); - switch (key) { - case Qt::Key_Enter: - case Qt::Key_Return: - doneCompletion(); - consumed = true; - break; - - case Qt::Key_Escape: - editor->setFocus(); - popup->hide(); - consumed = true; - break; - - case Qt::Key_Up: - case Qt::Key_Down: - case Qt::Key_Home: - case Qt::Key_End: - case Qt::Key_PageUp: - case Qt::Key_PageDown: - break; - - default: - editor->setFocus(); - editor->event(ev); - popup->hide(); - break; - } - - return consumed; - } - - return false; -} -//! [4] - -//! [5] -void GSuggestCompletion::showCompletion(const QList &choices) -{ - if (choices.isEmpty()) - return; - - const QPalette &pal = editor->palette(); - QColor color = pal.color(QPalette::Disabled, QPalette::WindowText); - - popup->setUpdatesEnabled(false); - popup->clear(); - - for (const auto &choice : choices) { - auto item = new QTreeWidgetItem(popup); - item->setText(0, choice); - item->setForeground(0, color); - } - - popup->setCurrentItem(popup->topLevelItem(0)); - popup->resizeColumnToContents(0); - popup->setUpdatesEnabled(true); - - popup->move(editor->mapToGlobal(QPoint(0, editor->height()))); - popup->setFocus(); - popup->show(); -} -//! [5] - -//! [6] -void GSuggestCompletion::doneCompletion() -{ - timer.stop(); - popup->hide(); - editor->setFocus(); - QTreeWidgetItem *item = popup->currentItem(); - if (item) { - editor->setText(item->text(0)); - QMetaObject::invokeMethod(editor, "returnPressed"); - } -} -//! [6] - -//! [7] -void GSuggestCompletion::autoSuggest() -{ - QString str = editor->text(); - QString url = gsuggestUrl.arg(str); - networkManager.get(QNetworkRequest(url)); -} -//! [7] - -//! [8] -void GSuggestCompletion::preventSuggest() -{ - timer.stop(); -} -//! [8] - -//! [9] -void GSuggestCompletion::handleNetworkData(QNetworkReply *networkReply) -{ - QUrl url = networkReply->url(); - if (networkReply->error() == QNetworkReply::NoError) { - QList choices; - - QByteArray response(networkReply->readAll()); - QXmlStreamReader xml(response); - while (!xml.atEnd()) { - xml.readNext(); - if (xml.tokenType() == QXmlStreamReader::StartElement) - if (xml.name() == u"suggestion") { - auto str = xml.attributes().value("data"); - choices << str.toString(); - } - } - - showCompletion(choices); - } - - networkReply->deleteLater(); -} -//! [9] diff --git a/examples/network/googlesuggest/googlesuggest.h b/examples/network/googlesuggest/googlesuggest.h deleted file mode 100644 index c46b58044b7..00000000000 --- a/examples/network/googlesuggest/googlesuggest.h +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -#ifndef GOOGLESUGGEST_H -#define GOOGLESUGGEST_H - -#include -#include -#include - -//! [1] -class GSuggestCompletion : public QObject -{ - Q_OBJECT - -public: - explicit GSuggestCompletion(QLineEdit *parent = nullptr); - ~GSuggestCompletion(); - bool eventFilter(QObject *obj, QEvent *ev) override; - void showCompletion(const QList &choices); - -public slots: - - void doneCompletion(); - void preventSuggest(); - void autoSuggest(); - void handleNetworkData(QNetworkReply *networkReply); - -private: - QLineEdit *editor = nullptr; - QTreeWidget *popup = nullptr; - QTimer timer; - QNetworkAccessManager networkManager; -}; -//! [1] -#endif // GOOGLESUGGEST_H - diff --git a/examples/network/googlesuggest/googlesuggest.pro b/examples/network/googlesuggest/googlesuggest.pro deleted file mode 100644 index 6e739063038..00000000000 --- a/examples/network/googlesuggest/googlesuggest.pro +++ /dev/null @@ -1,8 +0,0 @@ -QT += network widgets -requires(qtConfig(itemviews)) -SOURCES = main.cpp searchbox.cpp googlesuggest.cpp -HEADERS = searchbox.h googlesuggest.h - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/network/googlesuggest -INSTALLS += target diff --git a/examples/network/googlesuggest/main.cpp b/examples/network/googlesuggest/main.cpp deleted file mode 100644 index 0e927f3d23d..00000000000 --- a/examples/network/googlesuggest/main.cpp +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -#include - -#include "searchbox.h" - -int main(int argc, char * argv[]) -{ - QApplication app(argc, argv); - SearchBox searchEdit; - searchEdit.show(); - return app.exec(); -} diff --git a/examples/network/googlesuggest/searchbox.cpp b/examples/network/googlesuggest/searchbox.cpp deleted file mode 100644 index 56ca44dac44..00000000000 --- a/examples/network/googlesuggest/searchbox.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -#include -#include - -#include "searchbox.h" -#include "googlesuggest.h" - -const QString gsearchUrl = QStringLiteral("http://www.google.com/search?q=%1"); - -//! [1] -SearchBox::SearchBox(QWidget *parent) - : QLineEdit(parent) - , completer(new GSuggestCompletion(this)) -{ - connect(this, &SearchBox::returnPressed, this, &SearchBox::doSearch); - - setWindowTitle("Search with Google"); - - adjustSize(); - resize(400, height()); - setFocus(); -} -//! [1] - -//! [2] -void SearchBox::doSearch() -{ - completer->preventSuggest(); - QString url = gsearchUrl.arg(text()); - QDesktopServices::openUrl(url); -} -//! [2] - diff --git a/examples/network/googlesuggest/searchbox.h b/examples/network/googlesuggest/searchbox.h deleted file mode 100644 index be9beba1bcd..00000000000 --- a/examples/network/googlesuggest/searchbox.h +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -#ifndef SEARCHBOX_H -#define SEARCHBOX_H - -//! [1] -#include - -class GSuggestCompletion; - -class SearchBox: public QLineEdit -{ - Q_OBJECT - -public: - explicit SearchBox(QWidget *parent = nullptr); - -protected slots: - void doSearch(); - -private: - GSuggestCompletion *completer = nullptr; -//! [1] -}; - - -#endif // SEARCHBOX_H diff --git a/examples/network/network.pro b/examples/network/network.pro index 3f851d7c711..f4db039c7d4 100644 --- a/examples/network/network.pro +++ b/examples/network/network.pro @@ -14,7 +14,6 @@ qtHaveModule(widgets) { http \ loopback \ threadedfortuneserver \ - googlesuggest \ torrent \ multicastreceiver \ multicastsender diff --git a/src/network/doc/src/examples.qdoc b/src/network/doc/src/examples.qdoc index 1eb397d0115..42691213a29 100644 --- a/src/network/doc/src/examples.qdoc +++ b/src/network/doc/src/examples.qdoc @@ -31,7 +31,6 @@ \li \l{network/loopback}{Loopback} \li \l{network/threadedfortuneserver}{Threaded Fortune Server}\raisedaster \li \l{network/torrent}{Torrent} - \li \l{network/googlesuggest}{Google Suggest} \li \l{network/bearercloud}{Bearer Cloud}\raisedaster \li \l{network/bearermonitor}{Bearer Monitor} \li \l{network/securesocketclient}{Secure Socket Client}