Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-2883

runJavascript() bindings undocumented in PySide6, possibly wrong

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3: Somewhat important
    • 6.8.0
    • 6.7.2, 6.7.3
    • PySide
    • None
    • All
    • All
    • b9da1ecd9 (dev), 732fdd80b (dev), c68ae5cab (dev), b8d46ca7a (dev)

    Description

      I am not sure if this is a bug or simply a documentation gap.

      First, the PySide6 bindings for the QWebEnginePage.runJavascript() have distinct call signatures from the C++ or Qt6 bindings, but the documentation contains no information on how to use them. In particular the arguments have no names and type of the final argument (what is presumably the callback function?) is just labelled "Object". 

      Second, I am not sure if the second call signature, which appears to accept a worldId but not a callback, is correct. The two options that PyQt6 and Qt C++ offer are about whether or not worldId must be specified, with both signatures accepting a callback. This is apparently correct documentation but possibly a mistake in the bindings, where the final argument was truncated instead of the second one.

      void QWebEnginePage::runJavaScript(const QString &scriptSource, 
                                                                          const std::function<void (const QVariant &)> &resultCallback)
      
      void QWebEnginePage::runJavaScript(const QString &scriptSource, quint32 worldId = 0,
                                                                           const std::function<void (const QVariant &)> &resultCallback = {})
      

      Attachments

        Issue Links

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

          Activity

            People

              kleint Friedemann Kleint
              robertm314 Robert Mastragostino
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes