1

I want to display my html page which I added to my projects resources. But my page wont display - I only see a blank page, see code below:

#include <QApplication>
#include <QWebView>

int main(int argc, char *argv[]) {

    QApplication a(argc, argv);

    Q_INIT_RESOURCE(html);

    QWebView *myWebView = new QWebView;
    //myWebView->load(QUrl("http://google.pl")); // always works
    myWebView->load(QUrl(":/html/index")); // doesnt work at all :(
    //myWebView->load(QUrl("index.html")); // works only when I have index.html in my build-dir
    myWebView->show();

    return a.exec(); }

added

QT += webkit
QT += webkit webkitwidgets

to *.pro file.

Heres my whole project: http://www.speedyshare.com/bzg2M/qt-web-page-resources.tar.gz

mazix
  • 2,540
  • 8
  • 39
  • 56

0 Answers0