Backwards compatibility with Qt <5.11

This commit is contained in:
Bill Somerville 2020-07-26 22:58:17 +01:00
parent f6d16ea70c
commit b0f76b2fe7
No known key found for this signature in database
GPG Key ID: D864B06D1E81618F

View File

@ -96,7 +96,7 @@ public:
{ {
// handle re-opening asynchronously // handle re-opening asynchronously
auto connection = QSharedPointer<QMetaObject::Connection>::create (); auto connection = QSharedPointer<QMetaObject::Connection>::create ();
*connection = connect (socket_.get (), &QAbstractSocket::disconnected, [this, connection] () { *connection = connect (socket_.data (), &QAbstractSocket::disconnected, [this, connection] () {
qDebug () << "PSKReporter::impl::check_connection: disconnected, socket state:" << socket_->state (); qDebug () << "PSKReporter::impl::check_connection: disconnected, socket state:" << socket_->state ();
disconnect (*connection); disconnect (*connection);
check_connection (); check_connection ();
@ -150,7 +150,7 @@ public:
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
connect (socket_.get (), &QAbstractSocket::errorOccurred, this, &PSKReporter::impl::handle_socket_error); connect (socket_.get (), &QAbstractSocket::errorOccurred, this, &PSKReporter::impl::handle_socket_error);
#else #else
connect (socket_.get (), QOverload<QAbstractSocket::SocketError>::of (&QAbstractSocket::error), this, &PSKReporter::impl::handle_socket_error); connect (socket_.data (), QOverload<QAbstractSocket::SocketError>::of (&QAbstractSocket::error), this, &PSKReporter::impl::handle_socket_error);
#endif #endif
// use this for pseudo connection with UDP, allows us to use // use this for pseudo connection with UDP, allows us to use