Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

How can i reimplement the shouldInterruptJavaScript() in Qt (C++)?



  • According to the help of Qt for QWebPage [Slot ShoudInteruptJavaScript]

    This function is called when a JavaScript program is running for a long period of time.

    If the user wanted to stop the JavaScript the implementation should return true; otherwise false.

    The default implementation executes the query using QMessageBox::information with QMessageBox::Yes and QMessageBox::No buttons.

    *Warning: Because of binary compatibility constraints, this function is not virtual. If you want to provide your own implementation in a QWebPage subclass, reimplement the shouldInterruptJavaScript() slot in your subclass instead. QtWebKit will dynamically detect the slot and call it.
    *
    I don't want qt show a message when javascript runnig for long period of time.
    So, how can i reimplement ShoudInteruptJavaScript?
    and where should i create it?
    Please show me a sample Thanks



  • Look at "this ":http://developer.qt.nokia.com/forums/viewthread/13921/post:

    I faced a similar problem and AcerExtension published some code that could be usefull for you.
    In my case the issue was more complicated to resolve because I used DLLs that pointed a QWebView passed from an EXE. In such case, the override must be done in the EXE and doing so in the DLL is more complicated.


Log in to reply