Salut,
J'ai écrit ce code et le retour terminal ne me plait pas :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35 void GetRSSThread::run() { AppVars::urlRSSlist << "http://rss.lemonde.fr/c/205/f/3050/index.rss"; qDebug() << "enter run thread"; Sleep(10000); QList<QNetworkAccessManager*> netManList; netManList<< new QNetworkAccessManager(); connect (netManList[0], SIGNAL(finished(QNetworkReply*)), this, SLOT(downloadedRSSalaune(QNetworkReply*))) ; for(int i=0;i<AppVars::urlRSSlist.size();i++){ qDebug() << "enter for loop for i = "+QString::number(i); netManList[i]->get(QNetworkRequest(QUrl(AppVars::urlRSSlist[i]))); } start : qDebug() << "enter start loop thread"; Sleep(20000); emit instantNews("monde","à l'autre bout du monde","http://www.google.fr"); Sleep(5000); emit instantNews("monde","à l'autre bout du monde","http://www.google.fr"); goto start; } void GetRSSThread::downloadedRSSalaune(QNetworkReply* reply){ qDebug() << reply->errorString(); qDebug() << "fichier recu"; QByteArray data =QByteArray(reply->readAll()); [...] }
voila ce qu'affiche le terminal :
(d'ailleur c'est bizarre qu'il y est les guillemets pour "enter for loop for i = 0")
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5enter run thread "enter for loop for i = 0" enter start loop thread enter start loop thread enter start loop thread
enfin bon, downloadedRSSalaune(QNetworkReply* reply) n'est jamais executé
What est da problemo ?
NB : le code source de tout l'appli est là : https://sourceforge.net/projects/directnewsfrance/
le fichier est getrssthread.cpp
Partager