I have a QWebView that opens a local web page on my computer, and everything works perfectly in Qt4.8. (It also works with a browser). But after porting the software to Qt5.0 (and making the change from QWebView to QtWebKitWidgets/QWebView, I get the failure return from loadFinished().
Here’s the code: HelpManager::HelpManager(QObject *parent) :
QObject(parent)
{
view = new QWebView();
connect (view, SIGNAL(loadStarted()), SLOT(loadIsStarted()));
connect (view, SIGNAL(loadProgress(int)), SLOT(loadInProgress(int)));
connect (view, SIGNAL(loadFinished(bool)), SLOT(loadIsFinisehd(bool)));
view->load(QUrl("../Help/IDTNVMeMgr-web/index.html"));
view->setWindowTitle("IDTVMeMgr Help Information");
view->show();
}
void HelpManager::loadIsStarted()
{
qDebug() << "loadIsStarted";
}
void HelpManager::loadInProgress(int progress)
{
qDebug() << "loadInProgress, progress =" << progress;
}
void HelpManager::loadIsFinisehd(bool isOk)
{
qDebug() << "loadIsFinshed, status = " << isOk;
}
Here is the successful output using Qt4.8
loadIsStarted
loadInProgress, progress = 10
loadInProgress, progress = 10
loadInProgress, progress = 27
loadInProgress, progress = 29
loadInProgress, progress = 32
loadInProgress, progress = 36
loadInProgress, progress = 36
loadInProgress, progress = 36
loadInProgress, progress = 90
loadInProgress, progress = 90
loadInProgress, progress = 90
loadInProgress, progress = 90
loadInProgress, progress = 90
loadInProgress, progress = 100
loadIsFinshed, status = true
And here is the failure using Qt5.0
loadIsStarted
loadInProgress, progress = 10
loadIsFinshed, status = false
loadInProgress, progress = 100
Does anybody have any ideas?
↧