Hi All,

This is my first thread to the forum and below is a short description on what I'm trying to do:

I would to have my QWebView to work like browser that connect to internet, through proxy. Therefore, I use QNetworkAccessManager and use setNetworkAccessManager in QWebPage.
However, the proxyAuthenticationRequired signal keep firing even the correct username and password is provided. I have no idea what else I can do, and hopefully someone can help or give me some enlightenment.

Below is the simplified code:
Qt Code:
  1. /* main */
  2. WebView* view = new WebView (this);
  3. view->load(QUrl("http://www.mySite.com"));
  4.  
  5. WebView::WebView(QWidget *parent)
  6. : QWebView(parent)
  7. , m_page(new WebPage(this))
  8. {
  9. setPage(m_page);
  10. }
  11.  
  12. WebPage::WebPage(QObject *parent)
  13. : QWebPage(parent)
  14. {
  15. setNetworkAccessManager(/*networkAccessManager*/);
  16. }
  17.  
  18. networkManager::networkManager(QWidget *parent)
  19. : QNetworkAccessManager(parent)
  20. {
  21. connect(this, SIGNAL(authenticationRequired(QNetworkReply*, QAuthenticator*)),
  22. SLOT(authentication_required(QNetworkReply*,QAuthenticator*)));
  23.  
  24. connect(this, SIGNAL(proxyAuthenticationRequired(const QNetworkProxy&, QAuthenticator*)),
  25. SLOT(proxy_authentication_required(const QNetworkProxy&, QAuthenticator*)));
  26.  
  27. /* create and set proxy */
  28. QNetworkProxy proxy(QNetworkProxy::HttpProxy,
  29. "my-proxy",
  30. 8080,
  31. user_name,
  32. user_password);
  33. setProxy(proxy);
  34. }
  35.  
  36. void networkManager::proxy_authentication_required
  37. (
  38. const QNetworkProxy &proxy,
  39. QAuthenticator *authenticator
  40. )
  41. {
  42. /* create a dialog to allow user to type usename and password */
  43.  
  44. authenticator->setUser(/*username*/);
  45. authenticator->setPassword(/*password*/);
  46. }
To copy to clipboard, switch view to plain text mode 

I have an application that download file from a website across internet, behind proxy as well. I used QHttp (setHost() and get()) for the application and yet the proxyAuthenticationRequired is working fine.

I'm using Qt 4.7.0

Any advice on the problem described above is much appreciated.
Thanks in advance.