Hi,guys!
I want to get the page content after all external resource is loaded,but i
don't want to call the QApplication::exec() function,is it possible(because
this function open a window,but i don't need it,all i want is the content of
the page)?this is my code:
class View : public QWebView
{
Q_OBJECT
public:
View(QWidget *parent = 0);
private slots:
void loadFinished(bool ok);
};
View::View(QWidget *parent) : QWebView(parent)
{
setUrl(QUrl("http://blog.people.com.cn/blog/c3/s3328,w1299523481642728"));
connect(this, SIGNAL(loadFinished(bool)), SLOT(loadFinished(bool)));
}
void View::loadFinished(bool ok)
{
Q_UNUSED(ok);
QWebFrame *frame = page()->mainFrame();
qDebug() << frame->toHtml();//output
}
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
View view;
view.show();
return app.exec();
}
In other words,i want to delete the last line of code in main function,but i
need the program work correctly,is it possible?If yes,how can i do it?
Zhou Peng
[email protected]
2011-03-08 _______________________________________________
webkit-qt mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-qt