QPdfView Class▲
-
Header: QPdfView
-
Since: Qt 5.14
-
Inherits: QAbstractScrollArea
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.
Member Type Documentation▲
enum QPdfView::PageMode▲
This enum describes the overall behavior of the PDF viewer:
enum QPdfView::ZoomMode▲
This enum describes the magnification behavior of the PDF viewer:
Constant |
Value |
Description |
---|---|---|
QPdfView::ZoomMode::Custom |
0 |
Use zoomFactor only. |
QPdfView::ZoomMode::FitToWidth |
1 |
Automatically choose a zoom factor so that the width of the page fits in the view. |
QPdfView::ZoomMode::FitInView |
2 |
Automatically choose a zoom factor so that the entire page fits in the view. |
Property Documentation▲
document : QPdfDocument*▲
This property holds the document to be viewed.
Access functions:
-
*document() const
-
void setDocument( *document)
Notifier signal:
-
void documentChanged( *document)
documentMargins : QMargins▲
This property holds the margins around the page view.
Access functions:
-
documentMargins() const
-
void setDocumentMargins( margins)
Notifier signal:
-
void documentMarginsChanged( documentMargins)
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() const
-
void setPageMode( mode)
Notifier signal:
-
void pageModeChanged( pageMode)
pageSpacing : int▲
This property holds the size of the padding between pages in the MultiPage mode.
Access functions:
-
int pageSpacing() const
-
void setPageSpacing(int spacing)
Notifier signal:
-
void pageSpacingChanged(int pageSpacing)
zoomFactor : qreal▲
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:
-
qreal zoomFactor() const
-
void setZoomFactor(qreal factor)
Notifier signal:
-
void zoomFactorChanged(qreal zoomFactor)
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() const
-
void setZoomMode( mode)
Notifier signal:
-
void zoomModeChanged( zoomMode)