[webkit-qt] QApplication instance calling exec() and quit() repeatedly

周鹏 zhoupeng19 at 126.com
Thu Apr 7 02:00:44 PDT 2011


Hi,all!

Because my program is too big,so i write this code to simulate my problem:

int main(int argc, char **argv)
{
    QApplication*  app = new QApplication(argc, argv);
    QWebSettings * settings = QWebSettings::globalSettings();
    settings->setAttribute(QWebSettings::JavascriptEnabled, true);
    
    QWebView *view = new QWebView;
    view->setHtml(content1, url1);
    view->show();
    app->exec();
     //work correctly,close the window artificial
     QWebView *view1 = new QWebView;
    view1->setHtml(content2, url2);
    view1->show();
    app->exec();
    //work correctly,close the window artificial
     QWebView *view2 = new QWebView;
    view2->setHtml(content1, url1);
    view2->show();
    app->exec();
    //doesn't work
    return 0;
} 
content1:
 <html>  
    <head> <title></title> </head>  
     <body><script language="javascript"> location.replace("default/index.aspx") </script> </body> 
 </html>
content2 is normal page.

This program  doesn't work at the third time,i can't find what's wrong with it.Can anyone tell me how to fix this problem?


Zhou Peng 
zhoupeng19 at 126.com 
2011-04-07 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-qt/attachments/20110407/c47e6410/attachment.html>


More information about the webkit-qt mailing list