diff --git a/src/libs/qmldebug/qmldebugconnection.cpp b/src/libs/qmldebug/qmldebugconnection.cpp index 33b050efb37..50736b6468e 100644 --- a/src/libs/qmldebug/qmldebugconnection.cpp +++ b/src/libs/qmldebug/qmldebugconnection.cpp @@ -346,8 +346,12 @@ void QmlDebugConnection::connectToHost(const QString &hostName, quint16 port) emit logStateChange(socketStateToString(state)); }); - connect(socket, QOverload::of(&QAbstractSocket::error), - this, [this](QAbstractSocket::SocketError error) { +#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) + const auto errorOccurred = QOverload::of(&QAbstractSocket::error); +#else + const auto errorOccurred = &QAbstractSocket::errorOccurred; +#endif + connect(socket, errorOccurred, this, [this](QAbstractSocket::SocketError error) { emit logError(socketErrorToString(error)); socketDisconnected(); }, Qt::QueuedConnection); diff --git a/src/plugins/qmakeprojectmanager/externaleditors.cpp b/src/plugins/qmakeprojectmanager/externaleditors.cpp index 50983370c30..bbcc87e4fe9 100644 --- a/src/plugins/qmakeprojectmanager/externaleditors.cpp +++ b/src/plugins/qmakeprojectmanager/externaleditors.cpp @@ -288,8 +288,12 @@ bool DesignerExternalEditor::startEditor(const QString &fileName, QString *error m_processCache.insert(binary, socket); auto mapSlot = [this, binary] { processTerminated(binary); }; connect(socket, &QAbstractSocket::disconnected, this, mapSlot); - connect(socket, QOverload::of(&QAbstractSocket::error), - this, mapSlot); +#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) + const auto errorOccurred = QOverload::of(&QAbstractSocket::error); +#else + const auto errorOccurred = &QAbstractSocket::errorOccurred; +#endif + connect(socket, errorOccurred, this, mapSlot); } return true; } diff --git a/src/tools/iostool/main.cpp b/src/tools/iostool/main.cpp index 8eccc68d171..3e4141aaf3b 100644 --- a/src/tools/iostool/main.cpp +++ b/src/tools/iostool/main.cpp @@ -225,9 +225,12 @@ void Relayer::setClientSocket(QTcpSocket *clientSocket) QTC_CHECK(!m_clientSocket); m_clientSocket = clientSocket; if (m_clientSocket) { - connect(m_clientSocket, - QOverload::of(&QAbstractSocket::error), - this, &Relayer::handleClientHasError); +#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) + const auto errorOccurred = QOverload::of(&QAbstractSocket::error); +#else + const auto errorOccurred = &QAbstractSocket::errorOccurred; +#endif + connect(m_clientSocket, errorOccurred, this, &Relayer::handleClientHasError); connect(m_clientSocket, &QAbstractSocket::disconnected, this, [this](){server()->removeRelayConnection(this);}); }