Skip to content

WebEngineHistory

⋔ Inheritance diagram

graph TD
  1473574740544["webenginecore.WebEngineHistory"]
  140713234304496["builtins.object"]
  140713234304496 --> 1473574740544

🛈 DocStrings

Source code in prettyqt\webenginecore\webenginehistory.py
class WebEngineHistory:
    def __init__(self, history: webenginecore.QWebEngineHistory):
        self.history = history

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

    def __len__(self):
        # pyside2 does not support len(self.history)
        return self.history.count()

    def __getitem__(self, index: int) -> webenginecore.WebEngineHistoryItem:
        item = self.history.itemAt(index)
        return webenginecore.WebEngineHistoryItem(item)

    def __iter__(self) -> Iterator[webenginecore.WebEngineHistoryItem]:
        items = [webenginecore.WebEngineHistoryItem(i) for i in self.history.items()]
        return iter(items)

    def get_items(self) -> list[webenginecore.WebEngineHistoryItem]:
        """Get history items."""
        return [webenginecore.WebEngineHistoryItem(i) for i in self.history.items()]

get_items() -> list[webenginecore.WebEngineHistoryItem]

Get history items.

Source code in prettyqt\webenginecore\webenginehistory.py
def get_items(self) -> list[webenginecore.WebEngineHistoryItem]:
    """Get history items."""
    return [webenginecore.WebEngineHistoryItem(i) for i in self.history.items()]