Hi, i know this topic has already been discussed in other forums. I've found some solutions, and i tried everything with no luck.

the problem is depicted here :
http://old.nabble.com/QWebView-and-h...d28519684.html

simply put, using QWebView with https results in the SslErrors slot never been called.

can someone point me in the right direction ? As you see, this is a simple source to better illustrate the problem. no certificates are loaded, so it should call the SslErrors in any way. but it doesnt.

regards, valerio

Qt Code:
  1. MainWindow::MainWindow(QWidget *parent) :
  2. QMainWindow(parent),
  3. ui(new Ui::MainWindow)
  4. {
  5. ui->setupUi(this);
  6. connect (ui->pushButton,SIGNAL(clicked()),this,SLOT(onGoClick()));
  7. m_mgr = new QNetworkAccessManager(this);
  8. }
  9.  
  10. MainWindow::~MainWindow()
  11. {
  12. delete ui;
  13. delete m_mgr;
  14. }
  15.  
  16. void MainWindow::onSslErrors(QNetworkReply *reply, const QList<QSslError> &errors)
  17. {
  18. // report ssl errors
  19. foreach (QSslError error, errors)
  20. {
  21. qDebug() << "--> onSslErrors" << error.errorString();
  22. }
  23. reply->ignoreSslErrors();
  24. }
  25.  
  26. void MainWindow::onGoClick()
  27. {
  28. if (ui->lineEdit->text().isEmpty())
  29. return;
  30.  
  31. QUrl url (ui->lineEdit->text());
  32. QWebPage* page = new QWebPage(m_mgr);
  33. page->setNetworkAccessManager(m_mgr);
  34. connect (page->networkAccessManager(),SIGNAL(sslErrors(QNetworkReply*, QList<QSslError>)),this,SLOT(onSslErrors(QNetworkReply*, QList<QSslError>)));
  35. ui->webView->setPage(page);
  36. page->mainFrame()->load(url);
  37. }
To copy to clipboard, switch view to plain text mode