Skip to content

WebEngineScriptCollection

⋔ Inheritance diagram

graph TD
  1473574746400["webenginecore.WebEngineScriptCollection"]
  140713234304496["builtins.object"]
  140713234304496 --> 1473574746400

🛈 DocStrings

Source code in prettyqt\webenginecore\webenginescriptcollection.py
class WebEngineScriptCollection:
    def __init__(self, item: QtWebEngineCore.QWebEngineScriptCollection):
        self.item = item

    def __getattr__(self, val):
        return getattr(self.item, val)

    def __getitem__(self, index: str) -> QtWebEngineCore.QWebEngineScript:
        return self.item.find(index)[0]

    def __len__(self):
        return self.item.count()

    def __iter__(self) -> Iterator[QtWebEngineCore.QWebEngineScript]:
        return iter(self.item.toList())

    def __contains__(self, other: QtWebEngineCore.QWebEngineScript):
        return self.item.contains(other)

    def __add__(
        self,
        other: (
            QtWebEngineCore.QWebEngineScript | list[QtWebEngineCore.QWebEngineScript]
        ),
    ):
        self.item.insert(other)
        return self