I simplify the code.
So I want QWebView displays detai loading the page in a QStatuBar
int main(int argc, char* argv)
QStatusBar *a=new QStatusBar();
QMainWindow *ongle = new QMainWindow();
QWebView *page=new QWebView();
the problems is that code displays the page without details for exempel chrome when it load a page it display a small bar in the right corner that displai details
Btw. You've got your variable name wrong - QWebView is not a page. QWebView::page() returns a QWebPage that is a page. QWebView is a widget.
if you haven't shown up, I suppose that I will continue trying to solve a problem without solution
so how do Imake this "the url of the currently loaded resource"
dbzhang800 last edited by
Hi, the simplified code you given doesn't work, as your mainWindow don't have a statusbar at all. and the toplevel statusbar which isn't belong to mainWindow isn't shown by you too.
how I fix it and how to do to make the satutbar display information about the page load (the currently loaded resource.)
You can add a QStatusBar to your QMainWindow with "setStatusBar":http://qt-project.org/doc/qt-5.1/qtwidgets/qmainwindow.html#setStatusBar or via the designer. Also by default, when you create a new app, you get a .ui form with mainwindow that already has a statusbar and a toolbar.
Now for monitoring resources. The easiest way is to subclass QNetworkAccessManager and set it on your QWebPage with "setNetworkAccessManager":http://qt-project.org/doc/qt-5.1/qtwebkit/qwebpage.html#setNetworkAccessManager
In your NAM implementation you override get, post and other types of requests to emit a custom signal like requestedResource(QString url) and then call base implementation.
Then, in your main window you connect to that custom signal and display the url in the status bar.