c++qtqtwebkit

Loading Webpages in local network using QWebView


I am writing a program that uses a QWebView to display a webpage hosted on a server within the local network. Unfortunatly, it does not work with any local webpage (e.g. 192.168.1.1).

One webpage in the network is also acessible from outside (using dyndns). Accessing that page works, if I do so using the dyndns url (as it does with any remote webpage such as www.qwant.com), but not if I use it's local ip. Using Firefox, all those local pages were loaded successfully.

This is my code that should display the page:

QNetworkProxyFactory::setUseSystemConfiguration(true);
ui->webView->load(settings.value(SETTINGS_KEY_URL).toUrl());
ui->webView->show();

I added the setUseSystemConfiguration(true) after I read https://forum.qt.io/topic/18231/qtwebkit-can-not-display-image-in-case-of-local-network-path, but it did not solve my problem.

What am I doing wrong?


Solution

  • I have found a workaround: I now use a QWebEngineView instead of a QWebView and it works. I have no idea why it didn't using a QWebView...