PDA

View Full Version : unknown error in Qwebview



patrick1973
26th January 2014, 21:42
Hello,

We using QT in our Touchscreen displays for machine controls. This HMI is communicating with a IPC. This IPC has a webserver to access information of the IPC.

In this HMI i use the QwebView to show this webserver on the HMI.
by using this code:
( the webserver is at http://192.168.10.30)

//connections
connect(m_ui->webView,SIGNAL(loadStarted()),this,SLOT(pageLoadin g()));
connect(m_ui->webView,SIGNAL(loadFinished(bool)),this,SLOT(pageL oadFinished(bool)));
connect(m_ui->webView,SIGNAL(loadProgress(int)),m_ui->progressBar,SLOT(setValue(int)));

QWebSettings::globalSettings()->setAttribute(QWebSettings::LocalContentCanAccessRe moteUrls, true);
m_ui->webView->load(QUrl("http://192.168.10.30"));
m_ui->keyboardFrame->setVisible(false);
m_ui->webView->page()->mainFrame()->setScrollBarPolicy(Qt::Vertical,Qt::ScrollBarAlway sOff);
m_ui->webView->setZoomFactor(1.0);



when i replace the ip address by http://google.com then everything works fine.
When i use the http://192.168.10.30 then i got the message:
Access denied.
Client does not have
access to the resourse
on the server

if i access the webserver with an ordinairy brouwser every thing worksfine.

What can be the reason of this error?

Regards
Patrick

ChrisW67
27th January 2014, 01:13
What can be the reason of this error?
The configuration of the web server (assuming the error message is the content of the returned page). The web server access and error logs may well be informative.


if i access the webserver with an ordinairy brouwser every thing worksfine.
So is this browser running on the same machine?
Using the same proxy as your Qt application?
Using SSL?
Quietly providing a client certificate to authenticate?