[Qt-interest] Problems with QList and QNetworkAccessManager , kinds of `multi thread'

Markus Goetz Markus.Goetz at nokia.com
Wed Mar 17 14:18:12 CET 2010


ext Aaron Lewis wrote:
> Hi,
>        I was writting a browser, try to do a `multi thread' access.
>
> Sample Code:
>
>     QList<QNetworkAccessManager> list;
>
>     for(int i=0;i<5;i++){
>         QNetworkAccessManager *manager = new QNetworkAccessManager;
>           list << manager;
>            // parse http request
>         // connect finish signal to signal handler
>     // means i want to put it in background , so user interface will 
> kept working
>         delete manager;
>     }
>
>
> But these doesn't work , i can't use operator << like that.
>
> Any ideas will appreciate ;-)
>
>   
QList<NetworkAccessManager*> list; // notice the "*"

You want to use a pointer list. What you used was a normal QObject list.



More information about the Qt-interest-old mailing list