1

I'm working at a browser-like project based on QtWebKit.
It can display any webpage as good as any other browser can, but I can't make display local html documents!

I am using a QtWebView in a QMainWindow and I'm loading pages with

view->show();

Can anyone tell me what is wrong?

Thank you wery much!!!

3
  • impossible to guess with only the view->show(); part of your code. Commented May 19, 2012 at 16:39
  • in fact, view->show(); is the most irrelevant part. Commented May 19, 2012 at 16:39
  • May be you should listen first to loadFinished signal. Commented Apr 11, 2015 at 10:10

1 Answer 1

2

I don't see anything different than loading a normal web page, but anyway this is taken from my answer here:

#include <QtGui/QApplication>
#include <QWebView>

int main(int argc, char* argv[])
{
    QApplication a(argc, argv);
    QWebView view;
    view.setUrl(QUrl("file:///home/luca/mypage.html"));
    view.show();
    return a.exec();
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.