5#include <private/qpdffile_p.h>
6#include <QtCore/qmetatype.h>
7#include <QtCore/qstandardpaths.h>
8#include <QtQml/qqmlcontext.h>
9#include <QtQml/qqmlengine.h>
10#include <QtQuick/qquickitem.h>
11#include <QtQml/qqmlfile.h>
71 m_maxPageWidthHeight =
QSizeF();
73 m_carrierFile =
nullptr;
91 switch (m_doc->
error()) {
93 return tr(
"no error");
98 return tr(
"data not yet available");
101 return tr(
"file not found");
104 return tr(
"invalid file format");
107 return tr(
"incorrect password");
110 return tr(
"unsupported security scheme");
113 return tr(
"unknown error");
147 return m_maxPageWidthHeight.
width();
153 return m_maxPageWidthHeight.
height();
166QPdfFile *QQuickPdfDocument::carrierFile()
169 m_carrierFile =
new QPdfFile(m_doc);
170 return m_carrierFile;
173void QQuickPdfDocument::updateMaxPageSize()
const
175 if (m_maxPageWidthHeight.
isValid())
185 m_maxPageWidthHeight =
QSizeF(
w,
h);
267#include "moc_qquickpdfdocument_p.cpp"
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
void deleteLater()
\threadsafe
The QPdfDocument class loads a PDF document and renders pages from it.
Error error() const
Returns the type of error if \l status is Error, or NoError if there is no error.
Status
This enum describes the current status of the document.
int pageCount
This property holds the number of pages in the loaded document or 0 if no document is loaded.
@ UnsupportedSecurityScheme
Error load(const QString &fileName)
Loads the document contents from fileName.
void statusChanged(QPdfDocument::Status status)
Q_INVOKABLE QSizeF pagePointSize(int page) const
Returns the size of page page in points (1/72 of an inch).
The QQmlContext class defines a context within a QML engine.
static QString urlToLocalFileOrQrc(const QString &)
If url is a local file returns a path suitable for passing to QFile.
QUrl resolvedSource() const
~QQuickPdfDocument() override
void setSource(QUrl source)
\qmlproperty url PdfDocument::source
QQuickPdfDocument(QObject *parent=nullptr)
A representation of a PDF document.
void classBegin() override
Invoked after class creation, but before any properties have been set.
constexpr bool isValid() const noexcept
Returns true if both the width and height are equal to or greater than 0; otherwise returns false.
constexpr qreal width() const noexcept
Returns the width.
constexpr qreal height() const noexcept
Returns the height.
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool isValid() const
Returns true if the URL is non-empty and valid; otherwise returns false.
Combined button and popup list for selecting options.
constexpr const T & qMax(const T &a, const T &b)
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLenum GLsizei count
GLfloat GLfloat GLfloat GLfloat h
GLsizei GLsizei GLchar * source
QQmlContext * qmlContext(const QObject *obj)
QObject * qmlExtendedObject(QObject *object)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent