Skip to content

WebEngineDownloadRequest

⋔ Inheritance diagram

graph TD
  1473574727856["webenginecore.WebEngineDownloadRequest"]
  140713234304496["builtins.object"]
  140713234304496 --> 1473574727856

🛈 DocStrings

Source code in prettyqt\webenginecore\webenginedownloadrequest.py
class WebEngineDownloadRequest:
    def __init__(self, item: QtWebEngineCore.QWebEngineDownloadRequest):
        self.item = item

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

    def get_interrupt_reason(self) -> DownloadInterruptReasonStr:
        """Get reason for download interruption."""
        return DOWNLOAD_INTERRUPT_REASONS.inverse[self.item.interruptReason()]

    def get_state(self) -> DownloadStateStr:
        """Get current state."""
        return DOWNLOAD_STATE.inverse[self.item.state()]

    def set_save_page_format(self, fmt: SavePageFormatStr | Item.SavePageFormat):
        """Set the save page format.

        Args:
            fmt: save page format for the layout
        """
        self.item.setSavePageFormat(SAVE_PAGE_FORMAT.get_enum_value(fmt))

    def get_save_page_format(self) -> SavePageFormatStr:
        """Return current save page format.

        Returns:
            Save page format
        """
        return SAVE_PAGE_FORMAT.inverse[self.item.savePageFormat()]

get_interrupt_reason() -> DownloadInterruptReasonStr

Get reason for download interruption.

Source code in prettyqt\webenginecore\webenginedownloadrequest.py
def get_interrupt_reason(self) -> DownloadInterruptReasonStr:
    """Get reason for download interruption."""
    return DOWNLOAD_INTERRUPT_REASONS.inverse[self.item.interruptReason()]

get_save_page_format() -> SavePageFormatStr

Return current save page format.

Source code in prettyqt\webenginecore\webenginedownloadrequest.py
def get_save_page_format(self) -> SavePageFormatStr:
    """Return current save page format.

    Returns:
        Save page format
    """
    return SAVE_PAGE_FORMAT.inverse[self.item.savePageFormat()]

get_state() -> DownloadStateStr

Get current state.

Source code in prettyqt\webenginecore\webenginedownloadrequest.py
def get_state(self) -> DownloadStateStr:
    """Get current state."""
    return DOWNLOAD_STATE.inverse[self.item.state()]

set_save_page_format(fmt: SavePageFormatStr | Item.SavePageFormat)

Set the save page format.

Parameters:

Name Type Description Default
fmt SavePageFormatStr | SavePageFormat

save page format for the layout

required
Source code in prettyqt\webenginecore\webenginedownloadrequest.py
def set_save_page_format(self, fmt: SavePageFormatStr | Item.SavePageFormat):
    """Set the save page format.

    Args:
        fmt: save page format for the layout
    """
    self.item.setSavePageFormat(SAVE_PAGE_FORMAT.get_enum_value(fmt))