[webkit-qt] how to auto closing javascript alert box in webkit

周鹏 zhoupeng19 at 126.com
Fri Apr 29 21:57:22 PDT 2011


Dear Andrew Webster, 

It's helps.Thanks you!


Sincerely yours, 
Zhou Peng 
zhoupeng19 at 126.com 
2011-04-30 

======= 2011-04-28 21:56, your message: Re: [webkit-qt] how to auto closing javascript alert box in webkit======= 

2011/4/28 周鹏 <zhoupeng19 at 126.com>: 
> Hi all! 
> 
> How to auto closing a alert dialog in qt webkit,such as this page: 
> <html> 
> <head><title>test</title></head> 
> <body> 
> <script>alert("alert")</script> 
> <p>test<p> 
> </body> 
> </html> 
> http://lists.trolltech.com/qt-interest/2003-01/msg00706.html said 
> " 
> 
> Maybe you can set a timer in the dialogs class, that after 5 seconds emits a 
> signal which is connected to a slot that closes the dialog. 
> 
> 
> Example : 
> 
> connect(timer, SLOT(timeout(), this, SLOT(accept())); 
> timer->start(5000, TRUE); 
> 
> 
> " 
> but how to reimplementation qdialog calss in qtwebkit program?Is it possible 
> to forbid display dialog? 
> 

Take a look at QWebPage::javaScriptAlert (and javaScriptPrompt, 
javaScriptConfirm). You can override these in your derived class and 
show your own QDialog (or do nothing at all). Does that help? 

Andrew 
. 


= = = = = = = = = = = = = = = = = = = = 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-qt/attachments/20110430/33efa5a8/attachment.html>


More information about the webkit-qt mailing list