[Qt-interest] Breaking the authenticationRequired loop

Brian Zambrano brianz at gmail.com
Mon Aug 10 19:10:48 CEST 2009


Hi all,

I'm working with a webservice which requires a valid username/password
for every call.  From Qt (PyQt, really), I'm accessing the webservice
using
QNetworkAccessManager which emits the

"authenticationRequired (QNetworkReply*, QAuthenticator*)"

signal when (obviously), authentication is required.  When I fill in
the a valid user/passwd for QAuthenticator, everything works fine.
However, I can't see an obvious way to break the loop when the user is
*not* valid.  From the docs for authenticationRequired:

"If it rejects the credentials, this signal will be emitted again."

Invalid credentials means this signal is emitted again, and again, and
again....looking at the error code in the reply showed 0.  How is this
case supposed to be handled so it terminates with an error?  I know I
can say reply.abort(), but how is it supposed to be determined that
this particular signal was emitted from invalid credentials?

Thanks,
BZ



More information about the Qt-interest-old mailing list