summaryrefslogtreecommitdiffstats
path: root/examples/network/multicastreceiver/receiver.h
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@qt.io>2017-09-25 13:02:13 +0200
committerTimur Pocheptsov <timur.pocheptsov@qt.io>2017-09-28 09:28:18 +0000
commit553b6ab9cd2a1628524b5a51d69f0098679079a6 (patch)
tree72302d48c4da30025bf87f86cf729a3e61c4fe23 /examples/network/multicastreceiver/receiver.h
parent36af37c99c13244cac54313d38af183ef40133f5 (diff)
QtNetwork (examples) - update multicastreceiver example
... as soon as we updated multicastsender. Changes are minimal and mostly cosmetic - use 'explcit' and 'nullptr' where appropriate, make a socket data-member and not a pointer, move the 'datagram's declaration outside of a loop. Task-number: QTBUG-60628 Change-Id: Icfa46e6d2844c40a605f2f4066847594943a8ea8 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'examples/network/multicastreceiver/receiver.h')
-rw-r--r--examples/network/multicastreceiver/receiver.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/examples/network/multicastreceiver/receiver.h b/examples/network/multicastreceiver/receiver.h
index efef1cdb30..54927fdd63 100644
--- a/examples/network/multicastreceiver/receiver.h
+++ b/examples/network/multicastreceiver/receiver.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.
@@ -53,11 +53,10 @@
#include <QDialog>
#include <QHostAddress>
+#include <QUdpSocket>
QT_BEGIN_NAMESPACE
class QLabel;
-class QPushButton;
-class QUdpSocket;
QT_END_NAMESPACE
class Receiver : public QDialog
@@ -65,15 +64,14 @@ class Receiver : public QDialog
Q_OBJECT
public:
- Receiver(QWidget *parent = 0);
+ explicit Receiver(QWidget *parent = nullptr);
private slots:
void processPendingDatagrams();
private:
- QLabel *statusLabel;
- QPushButton *quitButton;
- QUdpSocket *udpSocket;
+ QLabel *statusLabel = nullptr;
+ QUdpSocket udpSocket;
QHostAddress groupAddress;
};