add compatibility code for pre 5.15 qt (#807)

This commit is contained in:
Rosemary Witchaven 2022-07-16 08:45:04 -05:00 committed by GitHub
parent d056030e6c
commit 15c2e0022d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -152,7 +152,11 @@ void NetworkManager::connect_to_server(server_type p_server)
});
connect(server_socket.tcp, &QAbstractSocket::disconnected, ao_app,
&AOApplication::server_disconnected);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(server_socket.tcp, QOverload<QAbstractSocket::SocketError>::of(&QAbstractSocket::error), this, [this] {
#else
connect(server_socket.tcp, &QAbstractSocket::errorOccurred, this, [this] {
#endif
qCritical() << "TCP socket error:" << server_socket.tcp->errorString();
});