[Qt-interest] Downloading in a QSplashScreen
luper rouch
luper.rouch at gmail.com
Thu Apr 30 18:36:39 CEST 2009
2009/4/30 Girish Ramakrishnan <girish at forwardbias.in>:
> Luper Rouch wrote:
>> I'm trying to download a file from a QSplashScreen.
>>
>> I use the QNetworkAccessManager API to do that, created my request,
>> connected the reply's signals (downloadProgress(), readyRead(), etc...),
>> but the signals are not emitted.
>>
>> I tried to add a QApplication::processEvents() call after connecting the
>> signals, and even set up a timer to call it periodically, but the
>> download does not start.
>>
>> How to use QNetworkAccessManager outside of the main loop ?
>>
>
> You can use QNetworkAccessManager outside the main loop using
> processEvents(), like you described above. There is something wrong in
> your code.
>
Yes you were right thanks !
In fact the code wasn't even running outside of the main loop, the
problem was that I forgot to set the QNetworkAccessManager parent in
the constructor... Passing the QSplashScreen instance as the parent
parameter made everything work as expected.
--
Luper
More information about the Qt-interest-old
mailing list