I think you can see when the download actually starts if you hook to the dataReadProgress signal.
When you first receive this signal then it means that the first chunk has been donwloaded.
To display some text I suggest using QTimer.
I cannot give you an example since I am not sure it would work. Just a draft, maybe:
in constructor:
mTimer->setInterval(1000); //1 second;
mStringList << "message1";
mStringList << "message2";
mStringList << "message3";
mStringList << "message4";
connect(mTimer, SIGNAL(timeout()), this, SLOT(cycleMessages()));
connect(downloadButton, SIGNAL(clicked()), mTimer, SLOT(start())); //start the timer when download is pressed
this is the timer slot:
void HttpWindow::cycleMessages()
{
int msgIndex = mStringList.indexOf(firstLabel->text());
if(msgIndex < 0 )
msgIndex = 0;
else
msgIndex++;
if(msgIndex >= mStringList.count())
msgIndex = 0;
firstLabel->setText(mStringList.at(msgIndex);
}
void HttpWindow::updateDataReadProgress(int bytesRead, int totalBytes)
{
...
mTimer->stop();
}
in constructor:
mTimer = new QTimer();
mTimer->setInterval(1000); //1 second;
mStringList << "message1";
mStringList << "message2";
mStringList << "message3";
mStringList << "message4";
connect(mTimer, SIGNAL(timeout()), this, SLOT(cycleMessages()));
connect(downloadButton, SIGNAL(clicked()), mTimer, SLOT(start())); //start the timer when download is pressed
this is the timer slot:
void HttpWindow::cycleMessages()
{
int msgIndex = mStringList.indexOf(firstLabel->text());
if(msgIndex < 0 )
msgIndex = 0;
else
msgIndex++;
if(msgIndex >= mStringList.count())
msgIndex = 0;
firstLabel->setText(mStringList.at(msgIndex);
}
void HttpWindow::updateDataReadProgress(int bytesRead, int totalBytes)
{
...
mTimer->stop();
}
To copy to clipboard, switch view to plain text mode
So there you will have a label that just displays those 4 messages in a cycle. The message is switched every second.
When it reaches the end of the list, it starts again from the beginning.
mTimer is a QTimer* member.
mStringList is a QStringList member.
firstLabel is a QLabel* member.
Make sure to delete the QTimer in the destructor.
Regards
Bookmarks