188080501/JQHttpServer

QT5.15.0中对于API的变更

xqqy opened this issue · 2 comments

xqqy commented

在Qt5.15.0(Ubuntu20.04自编译)环境下,发现使用JQNet.cpp会提示

‘void QNetworkReply::error(QNetworkReply::NetworkError)’ is deprecated: Use QNetworkReply::errorOccurred(QNetworkReply::NetworkError) instead

看起来是有一些API变更了呢

附带错误提示全文:

../H2server/library/JQLibrary/src/JQNet.cpp: In member function ‘void JQNet::HTTP::handle(QNetworkReply*, const int&, const std::function<void(const QList<QPair<QByteArray, QByteArray> >&, const QByteArray&)>&, const std::function<void(const QList<QPair<QByteArray, QByteArray> >&, const QNetworkReply::NetworkError&, const QByteArray&)>&, const std::function<void()>&)’:
../H2server/library/JQLibrary/src/JQNet.cpp:682:124: warning: ‘void QNetworkReply::error(QNetworkReply::NetworkError)’ is deprecated: Use QNetworkReply::errorOccurred(QNetworkReply::NetworkError) instead [-Wdeprecated-declarations]
  682 |     QObject::connect( reply, static_cast< void( QNetworkReply::* )( QNetworkReply::NetworkError ) >( &QNetworkReply::error ), [ reply, timer, onError, isCalled ](const QNetworkReply::NetworkError &code)
      |                                                                                                                            ^
In file included from /opt/qt5.15.0/include/QtNetwork/QNetworkReply:1,
                 from ../H2server/library/JQLibrary/include/JQNet.h:31,
                 from ../H2server/library/JQLibrary/src/JQNet.cpp:18:
/opt/qt5.15.0/include/QtNetwork/qnetworkreply.h:161:10: note: declared here
  161 |     void error(QNetworkReply::NetworkError);
      |          ^~~~~
../H2server/library/JQLibrary/src/JQNet.cpp:682:124: warning: ‘void QNetworkReply::error(QNetworkReply::NetworkError)’ is deprecated: Use QNetworkReply::errorOccurred(QNetworkReply::NetworkError) instead [-Wdeprecated-declarations]
  682 |     QObject::connect( reply, static_cast< void( QNetworkReply::* )( QNetworkReply::NetworkError ) >( &QNetworkReply::error ), [ reply, timer, onError, isCalled ](const QNetworkReply::NetworkError &code)
      |                                                                                                                            ^
In file included from /opt/qt5.15.0/include/QtNetwork/QNetworkReply:1,
                 from ../H2server/library/JQLibrary/include/JQNet.h:31,
                 from ../H2server/library/JQLibrary/src/JQNet.cpp:18:
/opt/qt5.15.0/include/QtNetwork/qnetworkreply.h:161:10: note: declared here
  161 |     void error(QNetworkReply::NetworkError);
      |          ^~~~~

感谢反馈,我去找个5.15的环境看下

已经修复
b262256