Hi,
I have done an application in which I get Latitude and Longitude,then based on this I am checking for some condition and hitting a URL ,now the problem is I am able to Hit URL as I can see Entry on Server, but the SLOTis not called So I am unable to get Reply.void LatLong::finishedslot(QNetworkReply* reply)
I don't know what is the problem,can we use Position Update Slot and FinishedSlot together??
Below is the Code for PositionUpdate Slot,, interval is Kept for 10 Secs:
Code:void LatLong::positionUpdated(const QGeoPositionInfo &info) { double latitude = 0.0000; double longitude = 0.0000; latitude = info.coordinate().latitude(); longitude = info.coordinate().longitude(); QVariant lat(latitude); QVariant longi(longitude); if(latitude == 0.0000) { ui->lineEdit_Latitude_2->setText(lat.toString()); } else { ui->lineEdit_Latitude_2->setText(lat.toString()); } if(longitude == 0.0000) { ui->lineEdit_Longitude_2->setText(longi.toString()); } else { ui->lineEdit_Longitude_2->setText(longi.toString()); } checkandHitUrl(double value); }
Below is Code for checkandHitUrl(double valuee) :
Code:void LatLong::checkandHitUrl(double value) { if(some condition) { flag = true; } else if(some condition) { set = true; flag = false; } else { flag = false; } if(flag) { set = false; QUrl url("My URL"); QNetworkReply* reply = nam->get(QNetworkRequest(url)); } else { //Do nothing } }
Below is Code for finishedslot which is Never Called :
Code:void LatLong::finishedslot(QNetworkReply* reply) { if (reply->error() == QNetworkReply::NoError) { QByteArray bytearray = reply->readAll(); QString byte_to_string(bytearray); // string QString trimstr= byte_to_string.trimmed(); QMessageBox::information(this,"Info",trimstr); if(condition) { QMessageBox::information(this,"Info","info"); } else { QMessageBox::information(this,"Info",trimstr); } } else { QMessageBox::information(this,"Error","Error Hitting URL."); } reply->deleteLater(); }
Can any one help me on this issue:
Regards,
Vishal

Reply With Quote
Mistake I was Using Wrong Signal 


