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

Upgraded from 4.7.1 to 4.8.2 libs. Now getting weird behavior.



  • Using Qt for embedded linux with webkit for UI.

    For some reason during a particular javascript function execution a message box is being displayed: "JavaScript Problem" . Message box contains Yes, No buttons asking to stop the script execution.

    QWebPage::javaScriptConsoleMessage is being called and states, "JavaScript execution exceeded timeout.".

    First, I'm not even certain why this is happening. The script does take a while to complete however. Second, why is the message box even appearing? I am re-implementing QWebPages just as before (4.7.1). javaScriptConsoleMessage is being re-implemented properly, but it doesn't appear javaScriptAlert is. Was there a change that I am not aware of?

    @#include "adiwebpage.h"
    #include <QDebug>

    AdiWebPage::AdiWebPage(QObject *parent) :
    QWebPage(parent)
    {
    }

    void AdiWebPage::javaScriptAlert ( QWebFrame * frame, const QString & msg )
    {
    Q_UNUSED(frame);
    if (logger()->isDebugEnabled())
    logger()->debug() << msg;
    }

    bool AdiWebPage::javaScriptConfirm ( QWebFrame * frame, const QString & msg )
    {
    Q_UNUSED(frame);
    if (logger()->isDebugEnabled())
    logger()->debug() << msg;
    return false;
    }

    void AdiWebPage::javaScriptConsoleMessage ( const QString & message, int lineNumber, const QString & sourceID )
    {
    if (logger()->isDebugEnabled())
    {
    logger()->debug() << message;
    logger()->debug() << lineNumber << ":" << sourceID;
    }
    }

    bool AdiWebPage::javaScriptPrompt ( QWebFrame * frame, const QString & msg, const QString & defaultValue, QString * result )
    {
    Q_UNUSED(frame);
    Q_UNUSED(result);
    if (logger()->isDebugEnabled())
    logger()->debug() << defaultValue << " " << msg;
    return false;
    }
    @



  • I just saw javaScriptAlert reimplemented. So I am not sure what is sending an alert to create a message box, but this is something I will really need to suppress.



  • Ok..it looks like I need to re-implement shouldInterruptJavaScript (). It looks like it wasn't being properly being called in Qt 4.7.1 for whatever reason.


Log in to reply