6#include <private/qpdffile_p.h>
7#include <QtQuick/private/qquickimage_p_p.h>
80 if (!
d->doc || !
d->doc->carrierFile()) {
82 qmlWarning(
this) <<
"document property not set: falling back to inefficient loading of " <<
url;
87 if (
url !=
d->doc->resolvedSource()) {
88 url =
d->doc->resolvedSource();
89 qmlWarning(
this) <<
"document and source properties in conflict: preferring document source " <<
url;
91 auto carrierFile =
d->doc->carrierFile();
92 static int thisRequestProgress = -1;
93 static int thisRequestFinished = -1;
94 if (thisRequestProgress == -1) {
96 QQuickImageBase::staticMetaObject.indexOfSlot(
"requestProgress(qint64,qint64)");
98 QQuickImageBase::staticMetaObject.indexOfSlot(
"requestFinished()");
101 d->pix.loadImageFromDevice(
qmlEngine(
this), carrierFile,
url,
102 d->sourceClipRect.toRect(),
d->sourcesize *
d->devicePixelRatio,
105 qCDebug(qLcImg) <<
"loading page" <<
d->currentFrame <<
"of" <<
d->frameCount
106 <<
"from" << carrierFile->fileName() <<
"status" <<
d->pix.status();
108 switch (
d->pix.status()) {
113 d->pix.connectFinished(
this, thisRequestFinished);
114 d->pix.connectDownloadProgress(
this, thisRequestProgress);
115 if (
d->progress != 0.0) {
125 qCDebug(qLcImg) <<
"unexpected status" <<
d->pix.status();
133 const auto status =
d->doc->document()->status();
141#include "moc_qquickpdfpageimage_p.cpp"
Status status
This property holds the current status of the document.
void statusChanged(QPdfDocument::Status status)
void statusChanged(QQuickImageBase::Status)
void progressChanged(qreal progress)
virtual void setSource(const QUrl &url)
The QQuickImageProviderOptions class provides options for QQuickImageProviderWithOptions image reques...
void pixmapChange() override
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
QUrl resolvedSource() const
Displays one page from a PDF document.
QQuickPdfPageImagePrivate()
void documentStatusChanged()
~QQuickPdfPageImage() override
QQuickPdfDocument * document
void setDocument(QQuickPdfDocument *document)
\qmlproperty PdfDocument PdfPageImage::document
QQuickPdfPageImage(QQuickItem *parent=nullptr)
bool isEmpty() const
Returns true if the URL has no data; otherwise returns false.
Combined button and popup list for selecting options.
#define Q_LOGGING_CATEGORY(name,...)
#define qCDebug(category,...)
QQmlEngine * qmlEngine(const QObject *obj)
Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me)
QUrl url("example.com")
[constructor-url-reference]
connect(quitButton, &QPushButton::clicked, &app, &QCoreApplication::quit, Qt::QueuedConnection)
myObject disconnect()
[26]