Qt6 WebEngine: QWebEngineScript.ScriptWorldId should be int enum
Florian Bruhin
me at the-compiler.org
Thu Aug 26 16:18:29 BST 2021
Hi again :D
It's possible to add +1 to a Qt.ItemDataRole to use user-defined roles:
>>> from PyQt6.QtCore import Qt
>>> Qt.ItemDataRole.UserRole
<ItemDataRole.UserRole: 256>
>>> Qt.ItemDataRole.UserRole + 1
257
But the same isn't possible with QWebEngineScript.ScriptWorldId:
>>> from PyQt6.QtWebEngineCore import QWebEngineScript
>>> QWebEngineScript.ScriptWorldId.UserWorld
<ScriptWorldId.UserWorld: 2>
>>> QWebEngineScript.ScriptWorldId.UserWorld + 1
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for +: 'ScriptWorldId' and 'int'
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/5b2d368f/attachment.sig>
More information about the PyQt
mailing list