[Solved]Problem Downloading a file
-
[quote author="peppe" date="1314174967"]
This is completely nonsense. Not only that doesn't compile, but there's no QNetworkRequest(QByteArray) ctor
[/quote]The compiler will call the non-explicit QString(QByteArray) constructor for this, unless QT_NO_CAST_FROM_ASCII is defined.
-
[quote author="Volker" date="1314177476"]
[quote author="peppe" date="1314174967"]
This is completely nonsense. Not only that doesn't compile, but there's no QNetworkRequest(QByteArray) ctor
[/quote]The compiler will call the non-explicit QString(QByteArray) constructor for this, unless QT_NO_CAST_FROM_ASCII is defined.
[/quote]Nope -- QNetwokRequest wants a QUrl. There are two conversions to be made (QByteArray -> QString -> QUrl), and C++ forbids that (not to mention the fact that you can disable either of them with macros).
-
Then what should i do?
-
It's what I'm trying to do...
-
[quote author="peppe" date="1314177763"]
Nope -- QNetwokRequest wants a QUrl. There are two conversions to be made (QByteArray -> QString -> QUrl), and C++ forbids that (not to mention the fact that you can disable either of them with macros).
[/quote]Eek, you're right. I mixed up the parentheses. I need to do more LISP to get used to that ;-)
-
Solved!!!
Below the solution about my problem:@
QString strUrl="http://myStore-dev.com/zip/mioFile%2_B.zip";QByteArray baUrl(strUrl.toAscii().data());
QUrl tmpUrl1;
tmpUrl1.setEncodedUrl(baUrl);
iNetReply = iNetManager->get(QNetworkRequest(tmpUrl1));
@Thanks to all.
Bye bye.