Qt6 WebEngine: QWebEngineScript.ScriptWorldId should be int enum

Florian Bruhin me at the-compiler.org
Thu Aug 26 16:25:31 BST 2021


On Thu, Aug 26, 2021 at 05:18:32PM +0200, Florian Bruhin wrote:
> Hi again :D
> 
> It's possible to add +1 to a Qt.ItemDataRole to use user-defined roles:
> 
>     [...]
> 
> But the same isn't possible with QWebEngineScript.ScriptWorldId:
> 
>     [...]

In a related vein, QWebEngineScript.setWorldId takes an int, so this
won't work:

    >>> from PyQt6.QtWebEngineCore import QWebEngineScript
    >>> s = QWebEngineScript()
    >>> s.setWorldId(QWebEngineScript.ScriptWorldId.UserWorld)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: setWorldId(self, int): argument 1 has unexpected type 'ScriptWorldId'

But I suppose a fix for the issue above will fix this too.

Florian

-- 
            me at the-compiler.org | https://www.qutebrowser.org 
       https://bruhin.software/ | https://github.com/sponsors/The-Compiler/
       GPG: 916E B0C8 FD55 A072 | https://the-compiler.org/pubkey.asc
             I love long mails! | https://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20210826/8deddbf2/attachment.sig>


More information about the PyQt mailing list