2011/4/28 周鹏 <[email protected]>:
> 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
_______________________________________________
webkit-qt mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-qt

Reply via email to