summaryrefslogtreecommitdiffstats
path: root/examples/network/googlesuggest/googlesuggest.h
diff options
context:
space:
mode:
Diffstat (limited to 'examples/network/googlesuggest/googlesuggest.h')
-rw-r--r--examples/network/googlesuggest/googlesuggest.h19
1 files changed, 6 insertions, 13 deletions
diff --git a/examples/network/googlesuggest/googlesuggest.h b/examples/network/googlesuggest/googlesuggest.h
index 1d42f31571..a0b0ac069c 100644
--- a/examples/network/googlesuggest/googlesuggest.h
+++ b/examples/network/googlesuggest/googlesuggest.h
@@ -53,14 +53,7 @@
#include <QtWidgets>
#include <QtNetwork>
-#include <QObject>
-
-QT_BEGIN_NAMESPACE
-class QLineEdit;
-class QNetworkReply;
-class QTimer;
-class QTreeWidget;
-QT_END_NAMESPACE
+#include <QtCore>
//! [1]
class GSuggestCompletion : public QObject
@@ -68,10 +61,10 @@ class GSuggestCompletion : public QObject
Q_OBJECT
public:
- GSuggestCompletion(QLineEdit *parent = 0);
+ explicit GSuggestCompletion(QLineEdit *parent = nullptr);
~GSuggestCompletion();
bool eventFilter(QObject *obj, QEvent *ev) override;
- void showCompletion(const QStringList &choices);
+ void showCompletion(const QVector<QString> &choices);
public slots:
@@ -81,9 +74,9 @@ public slots:
void handleNetworkData(QNetworkReply *networkReply);
private:
- QLineEdit *editor;
- QTreeWidget *popup;
- QTimer *timer;
+ QLineEdit *editor = nullptr;
+ QTreeWidget *popup = nullptr;
+ QTimer timer;
QNetworkAccessManager networkManager;
};
//! [1]