Skip to content

PdfSearchModel

Qt Base Class: QPdfSearchModel

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

Base classes

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

⋔ Inheritance diagram

graph TD
  1473572218368["pdf.PdfSearchModel"]
  1473299890176["core.AbstractItemModelMixin"]
  1473299815024["core.ObjectMixin"]
  140713234304496["builtins.object"]
  1473572211536["QtPdf.QPdfSearchModel"]
  1473289043296["QtCore.QAbstractListModel"]
  1473289050128["QtCore.QAbstractItemModel"]
  1473288842240["QtCore.QObject"]
  1473291690208["Shiboken.Object"]
  1473299890176 --> 1473572218368
  1473299815024 --> 1473299890176
  140713234304496 --> 1473299815024
  1473572211536 --> 1473572218368
  1473289043296 --> 1473572211536
  1473289050128 --> 1473289043296
  1473288842240 --> 1473289050128
  1473291690208 --> 1473288842240
  140713234304496 --> 1473291690208

🛈 DocStrings

Bases: AbstractItemModelMixin, QPdfSearchModel

Searches for a string in a PDF document and holds the results.

Source code in prettyqt\pdf\pdfsearchmodel.py
class PdfSearchModel(core.AbstractItemModelMixin, pdf.QPdfSearchModel):
    """Searches for a string in a PDF document and holds the results."""

    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\pdfsearchmodel.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
searchString QString