From 61afc6d109b22c7a71194fbdbac9774aa7c78c09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Tue, 16 May 2023 13:18:43 +0200 Subject: [PATCH] Network chat: make ctors explicit Task-number: QTBUG-108873 Change-Id: I08cd676aeb732d32b4d1e7d13a0aa1b37a46283f Reviewed-by: Konrad Kujawa Reviewed-by: Timur Pocheptsov --- examples/network/network-chat/chatdialog.h | 2 +- examples/network/network-chat/connection.h | 4 ++-- examples/network/network-chat/peermanager.h | 2 +- examples/network/network-chat/server.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/network/network-chat/chatdialog.h b/examples/network/network-chat/chatdialog.h index adda73fb726..45a98588223 100644 --- a/examples/network/network-chat/chatdialog.h +++ b/examples/network/network-chat/chatdialog.h @@ -12,7 +12,7 @@ class ChatDialog : public QDialog, private Ui::ChatDialog Q_OBJECT public: - ChatDialog(QWidget *parent = nullptr); + explicit ChatDialog(QWidget *parent = nullptr); public slots: void appendMessage(const QString &from, const QString &message); diff --git a/examples/network/network-chat/connection.h b/examples/network/network-chat/connection.h index ee9b00c1027..77c116cf6b5 100644 --- a/examples/network/network-chat/connection.h +++ b/examples/network/network-chat/connection.h @@ -32,8 +32,8 @@ public: Undefined }; - Connection(QObject *parent = nullptr); - Connection(qintptr socketDescriptor, QObject *parent = nullptr); + explicit Connection(QObject *parent = nullptr); + explicit Connection(qintptr socketDescriptor, QObject *parent = nullptr); ~Connection(); QString name() const; diff --git a/examples/network/network-chat/peermanager.h b/examples/network/network-chat/peermanager.h index d077e2c0e13..dadabd88aa2 100644 --- a/examples/network/network-chat/peermanager.h +++ b/examples/network/network-chat/peermanager.h @@ -18,7 +18,7 @@ class PeerManager : public QObject Q_OBJECT public: - PeerManager(Client *client); + explicit PeerManager(Client *client); void setServerPort(int port); QString userName() const; diff --git a/examples/network/network-chat/server.h b/examples/network/network-chat/server.h index f41ffebaefa..0557de30de2 100644 --- a/examples/network/network-chat/server.h +++ b/examples/network/network-chat/server.h @@ -13,7 +13,7 @@ class Server : public QTcpServer Q_OBJECT public: - Server(QObject *parent = nullptr); + explicit Server(QObject *parent = nullptr); signals: void newConnection(Connection *connection);