[Interest] Where is there QNetworkReply::error and QNetworkReply::finished signals?

Mandeep Sandhu mandeepsandhu.chd at gmail.com
Thu Sep 26 06:52:03 CEST 2013


On Wed, Sep 25, 2013 at 12:08 AM, Philipp Kursawe <phil.kursawe at gmail.com>wrote:

> Since finished is called regardless of errors I wonder what for you
> use the error signal if you can also just check for the error inside
> your finished slot?
>

According to the documentation of QNetworkReply::error():

"This signal is emitted when the reply detects an error in processing. The
finished() signal will _probably_ follow, indicating that the connection is
over."

So, there's no guarantee that the finished() signal will be emitted if an
error() signal was emitted. Though I've never encountered such a scenario
while using Qt's networking classes, it can happen.

But to be on the safe side, you should look for the error() signal and do
cleanup in that. For the positive cases (no error) you can do your
processing in the finished signal.

HTH,
-mandeep



>
> If I connect to the error signal I still have to check for errors in
> my finished handler.
>
> Or maybe its better to always only combine readyRead and error OR use
> only the finished signal?
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130926/67ad46d9/attachment.html>


More information about the Interest mailing list