Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-2747

Automatically connect JavaScript functions to signal emissions of plugin objects

    XMLWordPrintable

Details

    • Bug
    • Resolution: Moved
    • P2: Important
    • Some future release
    • 4.4.1
    • None
    • None

    Description

      HTML code usually hooks JavaScript functions to events emitted by plugin objects using one of the following syntaxes (assuming that the class behind testWidget has a signal "TestSignal(QString)"):

      <object id="testWidget" type="testmime" width="500" height="400">
      </object>

      <script type="text/javascript" language="javascript">
      // Netscape style
      testWidget.TestSignal = function(s)
      {
      alert(s);
      }

      // Internet Explorer style
      function testWidget::TestSignal(s)
      {
      alert(s);
      }
      </script>

      Neither of this works with QtWebKit; the C++ code that wants to hook a signal up with a JavaScript function has to do

      webView->page()>mainFrame()>evaluateJavaScript("TestSignal(\"" + s + "\")");

      instead.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vestbo Tor Arne Vestbø
            vhilshei Volker Hilsheimer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes