As far as I know you have to connect a slot to the signal proxyAuthenticationRequired from QNetworkAccessManager. In the connected slot you will have to set the proxy. This settings are remebered according to QtDoc so te signal is only emitted once.
I currently don't have time to write any dummy code.