QPdfPageRenderer 类封装 PDF 文档页面的渲染。 更多...
头: | #include <QPdfPageRenderer> |
Since: | Qt 5.11 |
继承: | QObject |
该类在 Qt 5.11 引入。
enum class | RenderMode { MultiThreaded, SingleThreaded } |
QPdfPageRenderer (QObject * parent = nullptr) | |
virtual | ~QPdfPageRenderer () override |
QPdfDocument * | document () const |
QPdfPageRenderer::RenderMode | renderMode () const |
quint64 | requestPage (int pageNumber , QSize imageSize , QPdfDocumentRenderOptions options = QPdfDocumentRenderOptions()) |
void | setDocument (QPdfDocument * document ) |
void | setRenderMode (QPdfPageRenderer::RenderMode mode ) |
void | documentChanged (QPdfDocument * document ) |
void | renderModeChanged (QPdfPageRenderer::RenderMode renderMode ) |
The QPdfPageRenderer contains a queue that collects all render requests that are invoked through
requestPage
(). Depending on the configured
RenderMode
the QPdfPageRenderer processes this queue in the main UI thread on next event loop invocation (
RenderMode::SingleThreaded
) or in a separate worker thread (
RenderMode::MultiThreaded
) and emits the result through the pageRendered() signal for each request once the rendering is done.
另请参阅 QPdfDocument .
此枚举描述如何渲染页面。
常量 | 值 | 描述 |
---|---|---|
QPdfPageRenderer::RenderMode::MultiThreaded
|
0
|
All pages are rendered in a separate worker thread. |
QPdfPageRenderer::RenderMode::SingleThreaded
|
1
|
All pages are rendered in the main UI thread (default). |
另请参阅 renderMode () 和 setRenderMode ().
This property holds the document instance this object renders the pages from.
默认情况下,此特性为
nullptr
.
访问函数:
QPdfDocument * | document () const |
void | setDocument (QPdfDocument * document ) |
通知程序信号:
void | documentChanged (QPdfDocument * document ) |
另请参阅 document (), setDocument (),和 QPdfDocument .
This property holds the mode the renderer uses to render the pages.
默认情况下,此特性为
RenderMode::SingleThreaded
.
访问函数:
QPdfPageRenderer::RenderMode | renderMode () const |
void | setRenderMode (QPdfPageRenderer::RenderMode mode ) |
通知程序信号:
void | renderModeChanged (QPdfPageRenderer::RenderMode renderMode ) |
另请参阅 setRenderMode () 和 RenderMode .
Constructs a page renderer object with parent object parent .
[override virtual]
QPdfPageRenderer::
~QPdfPageRenderer
()
Destroys the page renderer object.
Returns the document this objects renders the pages from, or a
nullptr
if none has been set before.
注意: Getter function for property document.
另请参阅 setDocument () 和 QPdfDocument .
Returns the mode of how the pages are rendered.
注意: getter 函数对于特性 renderMode。
另请参阅 setRenderMode () 和 RenderMode .
Requests the renderer to render the page pageNumber 成 QImage 的大小 imageSize according to the provided options .
Once the rendering is done the pageRendered() signal is emitted with the result as parameters.
The return value is an ID that uniquely identifies the render request. If a request with the same parameters is still in the queue, the ID of that queued request is returned.
设置 document this object renders the pages from.
注意: setter 函数对于特性 document .
另请参阅 document () 和 QPdfDocument .
Sets the mode of how the pages are rendered to mode .
注意: setter 函数对于特性 renderMode .
另请参阅 renderMode () 和 RenderMode .