Comments, Code and Qt. Some words about the wonderful world of software engineering

30Jul/1119

Why QNetworkAccessManager should not have the finished(QNetworkReply *) signal

Posted by kypeli

I was recently writing some network code in Qt using QNetworkAccessManager and again I did the mistake I've already done a few times. The reason for my mistake was that QNetworkAccessManager provides the finished(QNetworkReply *) signal. There are essentially two ways to request some data from the net using QNetworkAccessManager. In the first approach you have the QNetworkAccessManager as an instance variable in your class and you connect the finished(QNetworkReply *) signal from the instance variable to your slot. This is a tempting solution as it provides a quick and easy solution to fetch some data from the net.

Technorati Tags: , , ,