Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. Maximum duration for a script
Forum Updated to NodeBB v4.3 + New Features

Maximum duration for a script

Scheduled Pinned Locked Moved Qt WebKit
3 Posts 2 Posters 3.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    clouis
    wrote on last edited by
    #1

    What is the maximum duration a script can run before Qt decides that it has hung up and shows the message - "The script on this page appears to have a problem. Do you want to stop the script?"

    1 Reply Last reply
    0
    • C Offline
      C Offline
      clouis
      wrote on last edited by
      #2

      How do I overcome this problem? Any help will be greatly appreciated!!!

      1 Reply Last reply
      0
      • L Offline
        L Offline
        ljl_
        wrote on last edited by
        #3

        Hi,

        I am also new at this forum and not an expert on QT, and i will also appreciate some people to help and answer the questions. But it is not the case !!

        For your question i have seen following :

        ./qt/src/3rdparty/webkit/Source/WebKit/qt/Api/qwebpage.cpp

        /*!
        \fn bool QWebPage::shouldInterruptJavaScript()
        \since 4.6
        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.
        

        /
        bool QWebPage::shouldInterruptJavaScript()
        {
        #ifdef QT_NO_MESSAGEBOX
        return false;
        #else
        QWidget
        parent = (d->client) ? d->client->ownerWidget() : 0;
        return QMessageBox::Yes == QMessageBox::information(parent, tr("JavaScript Problem - %1").arg(mainFrame()->url().host()), tr("The script on this page appears to have a problem. Do you want to stop the script?"), QMessageBox::Yes, QMessageBox::No);
        #endif
        }

        So i guess you can deactivate this dialog box by using :
        QT_NO_MESSAGEBOX

        Regards

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved