QPdfView#
A PDF viewer widget. More…
Synopsis#
Properties#
Functions#
def
currentSearchResultIndex
()def
document
()def
documentMargins
()def
pageMode
()def
pageNavigator
()def
pageSpacing
()def
searchModel
()def
setDocument
(document)def
setDocumentMargins
(margins)def
setPageSpacing
(spacing)def
setSearchModel
(searchModel)def
zoomFactor
()def
zoomMode
()
Slots#
def
setCurrentSearchResultIndex
(currentResult)def
setPageMode
(mode)def
setZoomFactor
(factor)def
setZoomMode
(mode)
Signals#
def
currentSearchResultIndexChanged
(currentResult)def
documentChanged
(document)def
documentMarginsChanged
(documentMargins)def
pageModeChanged
(pageMode)def
pageSpacingChanged
(pageSpacing)def
searchModelChanged
(searchModel)def
zoomFactorChanged
(zoomFactor)def
zoomModeChanged
(zoomMode)
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description#
QPdfView
is a PDF viewer widget that offers a user experience similar to many common PDF viewer applications, with two modes
. In the MultiPage
mode, it supports flicking through the pages in the entire document, with narrow gaps between the page images. In the SinglePage
mode, it shows one page at a time.
- class PySide6.QtPdfWidgets.QPdfView#
PySide6.QtPdfWidgets.QPdfView(parent)
- Parameters:
parent –
PySide6.QtWidgets.QWidget
Constructs a PDF viewer with parent widget parent
.
Note
Properties can be used directly when from __feature__ import true_property
is used or via accessor functions otherwise.
- property PᅟySide6.QtPdfWidgets.QPdfView.currentSearchResultIndex: int#
If this property is set to a positive number, and searchModel
is set, QPdfView
draws a frame around the search result provided by QPdfSearchModel
at the given index. For example, if QPdfSearchModel
is used as the model for a QListView, you can keep this property updated by connecting QItemSelectionModel::currentChanged() from QListView::selectionModel() to a function that will in turn call this function.
By default it is -1
, so that no search results are framed.
- Access functions:
setCurrentSearchResultIndex
(currentResult)Signal
currentSearchResultIndexChanged
(currentResult)
- property PᅟySide6.QtPdfWidgets.QPdfView.document: PySide6.QtPdf.QPdfDocument#
This property holds the document to be viewed.
- Access functions:
document
()setDocument
(document)Signal
documentChanged
(document)
- property PᅟySide6.QtPdfWidgets.QPdfView.documentMargins: PySide6.QtCore.QMargins#
This property holds the margins around the page view.
- Access functions:
setDocumentMargins
(margins)Signal
documentMarginsChanged
(documentMargins)
- property PᅟySide6.QtPdfWidgets.QPdfView.pageMode: PageMode#
This property holds whether to show one page at a time, or all pages in the document. The default is SinglePage
.
- Access functions:
pageMode
()setPageMode
(mode)Signal
pageModeChanged
(pageMode)
- property PᅟySide6.QtPdfWidgets.QPdfView.pageSpacing: int#
This property holds the size of the padding between pages in the MultiPage
mode
.
- Access functions:
pageSpacing
()setPageSpacing
(spacing)Signal
pageSpacingChanged
(pageSpacing)
- property PᅟySide6.QtPdfWidgets.QPdfView.searchModel: PySide6.QtPdf.QPdfSearchModel#
If this property is set, QPdfView
draws highlight rectangles over the search results provided by resultsOnPage()
. By default it is nullptr
.
- Access functions:
searchModel
()setSearchModel
(searchModel)Signal
searchModelChanged
(searchModel)
- property PᅟySide6.QtPdfWidgets.QPdfView.zoomFactor: float#
This property holds the ratio of pixels to points. The default is 1
, meaning one point (1/72 of an inch) equals 1 logical pixel.
- Access functions:
zoomFactor
()setZoomFactor
(factor)Signal
zoomFactorChanged
(zoomFactor)
- property PᅟySide6.QtPdfWidgets.QPdfView.zoomMode: ZoomMode#
This property indicates whether to use a custom size for the page(s), or zoom them to fit to the view. The default is CustomZoom
.
- Access functions:
zoomMode
()setZoomMode
(mode)Signal
zoomModeChanged
(zoomMode)
- PySide6.QtPdfWidgets.QPdfView.PageMode#
This enum describes the overall behavior of the PDF viewer:
Constant
Description
QPdfView.PageMode.SinglePage
Show one page at a time.
QPdfView.PageMode.MultiPage
Allow scrolling through all pages in the document.
- PySide6.QtPdfWidgets.QPdfView.ZoomMode#
This enum describes the magnification behavior of the PDF viewer:
Constant
Description
QPdfView.ZoomMode.Custom
Use
zoomFactor
only.QPdfView.ZoomMode.FitToWidth
Automatically choose a zoom factor so that the width of the page fits in the view.
QPdfView.ZoomMode.FitInView
Automatically choose a zoom factor so that the entire page fits in the view.
- PySide6.QtPdfWidgets.QPdfView.currentSearchResultIndex()#
- Return type:
int
See also
Getter of property currentSearchResultIndex
.
- PySide6.QtPdfWidgets.QPdfView.currentSearchResultIndexChanged(currentResult)#
- Parameters:
currentResult – int
Notification signal of property currentSearchResultIndex
.
- PySide6.QtPdfWidgets.QPdfView.document()#
- Return type:
See also
Getter of property document
.
- PySide6.QtPdfWidgets.QPdfView.documentChanged(document)#
- Parameters:
document –
PySide6.QtPdf.QPdfDocument
Notification signal of property document
.
- PySide6.QtPdfWidgets.QPdfView.documentMargins()#
- Return type:
See also
Getter of property documentMargins
.
- PySide6.QtPdfWidgets.QPdfView.documentMarginsChanged(documentMargins)#
- Parameters:
documentMargins –
PySide6.QtCore.QMargins
Notification signal of property documentMargins
.
- PySide6.QtPdfWidgets.QPdfView.pageMode()#
- Return type:
See also
Getter of property pageMode
.
Notification signal of property pageMode
.
- Return type:
This accessor returns the navigation stack that will handle back/forward navigation.
- PySide6.QtPdfWidgets.QPdfView.pageSpacing()#
- Return type:
int
See also
Getter of property pageSpacing
.
- PySide6.QtPdfWidgets.QPdfView.pageSpacingChanged(pageSpacing)#
- Parameters:
pageSpacing – int
Notification signal of property pageSpacing
.
- PySide6.QtPdfWidgets.QPdfView.searchModel()#
- Return type:
See also
Getter of property searchModel
.
- PySide6.QtPdfWidgets.QPdfView.searchModelChanged(searchModel)#
- Parameters:
searchModel –
PySide6.QtPdf.QPdfSearchModel
Notification signal of property searchModel
.
- PySide6.QtPdfWidgets.QPdfView.setCurrentSearchResultIndex(currentResult)#
- Parameters:
currentResult – int
See also
Setter of property currentSearchResultIndex
.
- PySide6.QtPdfWidgets.QPdfView.setDocument(document)#
- Parameters:
document –
PySide6.QtPdf.QPdfDocument
See also
Setter of property document
.
- PySide6.QtPdfWidgets.QPdfView.setDocumentMargins(margins)#
- Parameters:
margins –
PySide6.QtCore.QMargins
See also
Setter of property documentMargins
.
Setter of property pageMode
.
- PySide6.QtPdfWidgets.QPdfView.setPageSpacing(spacing)#
- Parameters:
spacing – int
See also
Setter of property pageSpacing
.
- PySide6.QtPdfWidgets.QPdfView.setSearchModel(searchModel)#
- Parameters:
searchModel –
PySide6.QtPdf.QPdfSearchModel
See also
Setter of property searchModel
.
- PySide6.QtPdfWidgets.QPdfView.setZoomFactor(factor)#
- Parameters:
factor – float
See also
Setter of property zoomFactor
.
Setter of property zoomMode
.
- PySide6.QtPdfWidgets.QPdfView.zoomFactor()#
- Return type:
float
See also
Getter of property zoomFactor
.
- PySide6.QtPdfWidgets.QPdfView.zoomFactorChanged(zoomFactor)#
- Parameters:
zoomFactor – float
Notification signal of property zoomFactor
.
- PySide6.QtPdfWidgets.QPdfView.zoomMode()#
- Return type:
See also
Getter of property zoomMode
.
Notification signal of property zoomMode
.