diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2019-08-22 09:59:38 +0200 |
---|---|---|
committer | Michal Klocek <michal.klocek@qt.io> | 2019-11-25 13:00:56 +0100 |
commit | 25fb3b04706752932e33b9d96fab74fa8469400d (patch) | |
tree | bceb9b3d9f793ddcc55c5f0d120da6c974bcedad /src/src.pro | |
parent | e3802e913e1d6a3694d0084a35516145e2be32df (diff) |
Add a QImageIOHandler to render PDF with QtQuick Image
Now you can use Image in QML to display the first page of a PDF file
by default. (The implementation is very similar to the handler
plugin in the QtSVG module.) To display other pages, you can set
the new currentFrame property that is being added to Image in 5.14.
QPdfIOHandler uses its own instance of QPdfDocument to do the rendering.
An instance will be created each time the image needs to read a frame
from the file (on creation; each time the currentFrame property
is changed; each time sourceSize is changed to require a different
resolution rendering). This approach is not as efficient as it would
be to share the QPdfDocument instance among multiple Images that are
rendering different pages at the same time, as well as sharing with the
QML Document declaration that we plan to add. However, if you set
asynchronous: true, each Image will render its page from the PDF in
its own thread. PDFium is not thread-safe, so sharing the QPdfDocument
among multiple threads is not safe. It may be possible to make it safe
by having a dedicated PDF-rendering thread, but that is not yet done
in this patch.
Change-Id: I7a1f8cd7bd5b8f93d45fa9350752b2d9356b04fe
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'src/src.pro')
-rw-r--r-- | src/src.pro | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/src.pro b/src/src.pro index 97b6e5419..4bacba3b9 100644 --- a/src/src.pro +++ b/src/src.pro @@ -42,7 +42,7 @@ qtConfig(build-qtwebengine-core):qtConfig(webengine-core-support) { qtConfig(build-qtpdf):qtConfig(webengine-core-support) { pdf.depends = buildtools - SUBDIRS += buildtools pdf + SUBDIRS += buildtools pdf plugins qtConfig(pdf-widgets) { pdfwidgets.depends = pdf SUBDIRS += pdfwidgets |