summaryrefslogtreecommitdiffstats
path: root/examples/network/fortuneserver/server.h
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@qt.io>2017-09-27 12:32:34 +0200
committerTimur Pocheptsov <timur.pocheptsov@qt.io>2017-09-28 14:07:26 +0000
commit0f5c4ba7cbd628a29d3e84219834c20c29cd6741 (patch)
tree4d7d8eff06a2990641a555e134cea0cc4d16791c /examples/network/fortuneserver/server.h
parent9e268185bbb39285ee087868f9d904d7c9f6fe61 (diff)
QtNetwork (examples) - update the fortune server example
Unlike client, this needs a bit more changes: - remove redundant (and outdated) stdlib.h includes - use QRandomGenerator (instead of qsrand/qrand pair) - replace QStringList with QVector<QString> - Q_NULLPTR->nullptr, ExplicitType * -> auto - fix some weird indentation Task-number: QTBUG-60628 Change-Id: I12eed12711b1e622407bd8ecd1afdf56a2cf2097 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'examples/network/fortuneserver/server.h')
-rw-r--r--examples/network/fortuneserver/server.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/examples/network/fortuneserver/server.h b/examples/network/fortuneserver/server.h
index ea5ed78292..c5bfa7d928 100644
--- a/examples/network/fortuneserver/server.h
+++ b/examples/network/fortuneserver/server.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the examples of the Qt Toolkit.
@@ -52,10 +52,11 @@
#define SERVER_H
#include <QDialog>
+#include <QString>
+#include <QVector>
QT_BEGIN_NAMESPACE
class QLabel;
-class QPushButton;
class QTcpServer;
class QNetworkSession;
QT_END_NAMESPACE
@@ -66,17 +67,17 @@ class Server : public QDialog
Q_OBJECT
public:
- explicit Server(QWidget *parent = Q_NULLPTR);
+ explicit Server(QWidget *parent = nullptr);
private slots:
void sessionOpened();
void sendFortune();
private:
- QLabel *statusLabel;
- QTcpServer *tcpServer;
- QStringList fortunes;
- QNetworkSession *networkSession;
+ QLabel *statusLabel = nullptr;
+ QTcpServer *tcpServer = nullptr;
+ QVector<QString> fortunes;
+ QNetworkSession *networkSession = nullptr;
};
//! [0]