forked from qt-creator/qt-creator
Handle various versions for QAbstractSocket::SocketError{Occurred}
I don't think it's worthwhile to put that in some header, it's only four occurrences. Task-number: QTCREATORBUG-24098 Change-Id: Ic4e505f264a5d9970d8be1071c849d2bb3389746 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -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<QAbstractSocket::SocketError>::of(&QAbstractSocket::error),
|
||||
this, mapSlot);
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
|
||||
const auto errorOccurred = QOverload<QAbstractSocket::SocketError>::of(&QAbstractSocket::error);
|
||||
#else
|
||||
const auto errorOccurred = &QAbstractSocket::errorOccurred;
|
||||
#endif
|
||||
connect(socket, errorOccurred, this, mapSlot);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user