Skip to content

PdfBookmarkModel

Qt Base Class: QPdfBookmarkModel

Signature: QPdfBookmarkModel(self) -> None QPdfBookmarkModel(self, parent: PySide6.QtCore.QObject) -> None

Base classes

Name Children Inherits
AbstractItemModelMixin
prettyqt.core.abstractitemmodel
QPdfBookmarkModel
PySide6.QtPdf
QPdfBookmarkModel(self) -> None

⋔ Inheritance diagram

graph TD
  1473572217392["pdf.PdfBookmarkModel"]
  1473299890176["core.AbstractItemModelMixin"]
  1473299815024["core.ObjectMixin"]
  140713234304496["builtins.object"]
  1473572210560["QtPdf.QPdfBookmarkModel"]
  1473289050128["QtCore.QAbstractItemModel"]
  1473288842240["QtCore.QObject"]
  1473291690208["Shiboken.Object"]
  1473299890176 --> 1473572217392
  1473299815024 --> 1473299890176
  140713234304496 --> 1473299815024
  1473572210560 --> 1473572217392
  1473289050128 --> 1473572210560
  1473288842240 --> 1473289050128
  1473291690208 --> 1473288842240
  140713234304496 --> 1473291690208

🛈 DocStrings

Bases: AbstractItemModelMixin, QPdfBookmarkModel

Holds a tree of of links within a PDF document, such as the table of contents.

Source code in prettyqt\pdf\pdfbookmarkmodel.py
class PdfBookmarkModel(core.AbstractItemModelMixin, pdf.QPdfBookmarkModel):
    """Holds a tree of of links within a PDF document, such as the table of contents."""

    def __init__(self, parent: core.QObject | None = None):
        super().__init__(parent)
        self.setDocument(pdf.PdfDocument(self))

    def set_document(self, document: datatypes.PathType | pdf.QPdfDocument):
        """Set document for model."""
        if not isinstance(document, pdf.QPdfDocument):
            path = os.fspath(document)
            document = pdf.PdfDocument(self)
            document.load(path)
        self.setDocument(document)

set_document(document: datatypes.PathType | pdf.QPdfDocument)

Set document for model.

Source code in prettyqt\pdf\pdfbookmarkmodel.py
def set_document(self, document: datatypes.PathType | pdf.QPdfDocument):
    """Set document for model."""
    if not isinstance(document, pdf.QPdfDocument):
        path = os.fspath(document)
        document = pdf.PdfDocument(self)
        document.load(path)
    self.setDocument(document)

⌗ Property table

Qt Property Type Doc
objectName QString
document QPdfDocument