I'm trying to download files of my webpage with one class separately. But when i include in the main of my program and do this since mainwindow:
Downloader d;
d.doDownload("http://myweb/currxml.php");
Downloader d;
d.doDownload("http://myweb/currxml.php");
To copy to clipboard, switch view to plain text mode
Not works so i was thinking to use qobject to call since outside. But when i use like you saw in the first post singleton instance only download the file one time. I think because i am using lambda and sigletone thing so i am using only one instance. like you see in the first post.
At the moment i think it's better to include in the main of my program like signal and slot. And then call with some sender . like:
connect(this, SIGNAL(finished(QNetworkReply*)),this, SLOT(replyFinished(QNetworkReply*)));
connect(this, SIGNAL(finished(QNetworkReply*)),this, SLOT(replyFinished(QNetworkReply*)));
To copy to clipboard, switch view to plain text mode
but one question i can emit the signal of this code like:
emit finished(QNetworkReply*); but not seems to works too.
I need some way to emit this signal without using button, other way.
Conclusion, i was trying to use one class separately qobject but i think like i always use one instance with singleton pattern only download the file one time. When i connect again not download the file. I tried the other way second post. But when i included to my mainwindow program seems like is outside class it cant to call.
So finally i was thinking to include to my mainwindow and do this, i repeat:
connect(this, SIGNAL(finished(QNetworkReply*)),this, SLOT(replyFinished(QNetworkReply*)));
connect(this, SIGNAL(finished(QNetworkReply*)),this, SLOT(replyFinished(QNetworkReply*)));
To copy to clipboard, switch view to plain text mode
But i need to emit the signal some way without buttons etc.
Bookmarks