PDA

View Full Version : QWebView shows blank page on Raspberry Pi 2



mefi100
8th October 2015, 14:45
Hi, I am developing a Qt Web Kit application to run on Raspberry Pi 2. When I run the application on Ubuntu 14.04 on desktop it runs as expected. However when I run it on my Raspberry only blank page is shown. I also tried setting other HTML pages in QWebView, but that also ended in blank pages. I tried local HTMLs, ones from the internet and I even tried setting HTML text from code myself. Sometimes, and I don't know why, depending on QString I set as HTML i get "$66" written in top left corner of the screen. It just doesn't make sens tome. At the end of the thread are functions which I use to set web kit and web view. Is the problem maybe that I need to set some other parameters of MainWindow, which is inherited from QWebView? In my HTML I have a lot of images, actually that is all there is. I thought that was the problem, but simple HTMLs and some sites like google don't work too, so I ruled that problem out.



void MainWindow::initializeWebKit()
{
_network = new QNetworkAccessManager(this);
_cache = new QNetworkDiskCache(this);
_cache->setCacheDirectory(CACHE_DIRECTORY);
_cache->setMaximumCacheSize(CACHE_SIZE);
_network->setCache(_cache);
page()->setNetworkAccessManager(_network);
}

void MainWindow::initializeFrontend()
{
QUrl startURL = QUrl("qrc:/Web/Roulette.html");
setUrl(startURL);
}