Skip to content

Commit

Permalink
Replace 'signals' and 'slots' macros wih 'QT_SIGNALS' and 'QT_SLOTS'
Browse files Browse the repository at this point in the history
When using qmake with QT 6, the 'signals' and 'slots' macros will yield an error.
This is done on purpose, because those keywords can cause conflicts when mixing
QT with other libraries with their own signal slot subsystem (for example boost).

More info here:
https://doc.qt.io/qt-5/signalsandslots.html#using-qt-with-3rd-party-signals-and-slots
  • Loading branch information
ejvr committed Apr 11, 2022
1 parent 6abd396 commit a5c001d
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions src/mqtt/qmqtt_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class Q_MQTT_EXPORT Client : public QObject
void setSslConfiguration(const QSslConfiguration& config);
#endif // QT_NO_SSL

public slots:
public Q_SLOTS:
void setHost(const QHostAddress& host);
void setHostName(const QString& hostName);
void setPort(const quint16 port);
Expand Down Expand Up @@ -246,7 +246,7 @@ public slots:
void ignoreSslErrors(const QList<QSslError>& errors);
#endif // QT_NO_SSL

signals:
Q_SIGNALS:
void connected();
void disconnected();
void error(const QMQTT::ClientError error);
Expand All @@ -260,7 +260,7 @@ public slots:
void sslErrors(const QList<QSslError>& errors);
#endif // QT_NO_SSL

protected slots:
protected Q_SLOTS:
void onNetworkConnected();
void onNetworkDisconnected();
void onNetworkReceived(const QMQTT::Frame& frame);
Expand Down
6 changes: 3 additions & 3 deletions src/mqtt/qmqtt_network_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ class Network : public NetworkInterface
void setSslConfiguration(const QSslConfiguration& config);
#endif // QT_NO_SSL

public slots:
public Q_SLOTS:
void connectToHost(const QHostAddress& host, const quint16 port);
void connectToHost(const QString& hostName, const quint16 port);
void disconnectFromHost();
#ifndef QT_NO_SSL
void ignoreSslErrors();
#endif // QT_NO_SSL

protected slots:
protected Q_SLOTS:
void onSocketError(QAbstractSocket::SocketError socketError);

protected:
Expand All @@ -125,7 +125,7 @@ protected slots:
int _shift;
QByteArray _data;

protected slots:
protected Q_SLOTS:
void onSocketReadReady();
void onDisconnected();
void connectToHost();
Expand Down
4 changes: 2 additions & 2 deletions src/mqtt/qmqtt_networkinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ class Q_MQTT_EXPORT NetworkInterface : public QObject
virtual void setSslConfiguration(const QSslConfiguration& config) = 0;
#endif // QT_NO_SSL

public slots:
public Q_SLOTS:
virtual void connectToHost(const QHostAddress& host, const quint16 port) = 0;
virtual void connectToHost(const QString& hostName, const quint16 port) = 0;
virtual void disconnectFromHost() = 0;
#ifndef QT_NO_SSL
virtual void ignoreSslErrors() = 0;
#endif // QT_NO_SSL

signals:
Q_SIGNALS:
void connected();
void disconnected();
void received(const QMQTT::Frame& frame);
Expand Down
4 changes: 2 additions & 2 deletions src/mqtt/qmqtt_routesubscription.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ class Q_MQTT_EXPORT RouteSubscription : public QObject

QString route() const;

signals:
Q_SIGNALS:
void received(const RoutedMessage &message);

private slots:
private Q_SLOTS:
void routeMessage(const Message &message);

private:
Expand Down
2 changes: 1 addition & 1 deletion src/mqtt/qmqtt_socketinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class Q_MQTT_EXPORT SocketInterface : public QObject
virtual void setSslConfiguration(const QSslConfiguration& config) { Q_UNUSED(config); }
#endif // QT_NO_SSL

signals:
Q_SIGNALS:
void connected();
void disconnected();
void error(QAbstractSocket::SocketError socketError);
Expand Down
2 changes: 1 addition & 1 deletion src/mqtt/qmqtt_timerinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Q_MQTT_EXPORT TimerInterface : public QObject
virtual void start() = 0;
virtual void stop() = 0;

signals:
Q_SIGNALS:
void timeout();
};

Expand Down
4 changes: 2 additions & 2 deletions src/mqtt/qmqtt_websocketiodevice_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class WebSocketIODevice : public QIODevice

virtual qint64 bytesAvailable() const;

signals:
Q_SIGNALS:
void connected();

void disconnected();
Expand All @@ -71,7 +71,7 @@ class WebSocketIODevice : public QIODevice

virtual qint64 writeData(const char *data, qint64 maxSize);

private slots:
private Q_SLOTS:
void binaryMessageReceived(const QByteArray &frame);

private:
Expand Down
2 changes: 1 addition & 1 deletion tests/benchmarks/message/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class tst_message: public QObject
{
Q_OBJECT

private slots:
private Q_SLOTS:
void emptyMessage();
void message();
void equality_data();
Expand Down
2 changes: 1 addition & 1 deletion tests/gtest/tests/tcpserver.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class TcpServer : public QTcpServer
QTcpSocket* _socket;
QByteArray _data;

protected slots:
protected Q_SLOTS:
void on_newConnection();
void on_readyRead();
};
Expand Down

0 comments on commit a5c001d

Please sign in to comment.