summaryrefslogtreecommitdiffstats
path: root/src/pdf
diff options
context:
space:
mode:
Diffstat (limited to 'src/pdf')
-rw-r--r--src/pdf/doc/about_credits_entry.tmpl3
-rw-r--r--src/pdf/doc/src/qtpdf-index.qdoc7
-rw-r--r--src/pdf/doc/src/qtpdf-platformnotes.qdoc11
-rw-r--r--src/pdf/qpdfbookmarkmodel.cpp12
-rw-r--r--src/pdf/qpdfpagenavigator.cpp8
-rw-r--r--src/pdf/qpdfsearchmodel.cpp10
-rw-r--r--src/pdf/qpdfsearchmodel.h1
7 files changed, 24 insertions, 28 deletions
diff --git a/src/pdf/doc/about_credits_entry.tmpl b/src/pdf/doc/about_credits_entry.tmpl
index 294198709..c6dc90242 100644
--- a/src/pdf/doc/about_credits_entry.tmpl
+++ b/src/pdf/doc/about_credits_entry.tmpl
@@ -1,6 +1,5 @@
/*!
-\page qtpdf-3rdparty-{{name-sanitized}}.html
-\attribution
+\page qtpdf-3rdparty-{{name-sanitized}}.html attribution
\ingroup qtpdf-licensing
\brief {{license-type}}
\title {{name}}
diff --git a/src/pdf/doc/src/qtpdf-index.qdoc b/src/pdf/doc/src/qtpdf-index.qdoc
index fb44eb5fa..b72619fbf 100644
--- a/src/pdf/doc/src/qtpdf-index.qdoc
+++ b/src/pdf/doc/src/qtpdf-index.qdoc
@@ -17,7 +17,7 @@
and holds the search results. The QPdfBookmarkModel class holds the
table of contents, if present. The QPdfLinkModel holds information
about hyperlinks on a page. The \l QPdfView widget is a complete
- PDF viewer, and the \l {PDF Viewer Example} shows how to use it.
+ PDF viewer, and the \l {PDF Viewer Widget Example} shows how to use it.
For Qt Quick applications, three kinds of full-featured viewer
components are provided. \l PdfMultiPageView should be your
@@ -65,6 +65,11 @@
\li \l{Qt Quick PDF QML Types}
\endlist
+ \section1 Articles and Guides
+ \list
+ \li {Qt PDF Platform Notes} {Platform Notes}
+ \endlist
+
\section1 Licenses and Attributions
Qt PDF is available under commercial licenses from \l{The Qt Company}.
diff --git a/src/pdf/doc/src/qtpdf-platformnotes.qdoc b/src/pdf/doc/src/qtpdf-platformnotes.qdoc
new file mode 100644
index 000000000..f50be120d
--- /dev/null
+++ b/src/pdf/doc/src/qtpdf-platformnotes.qdoc
@@ -0,0 +1,11 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \page qtpdf-platformnotes.html
+ \title Qt PDF Platform Notes
+
+ Building Qt PDF for Android is currently
+ \l{https://bugreports.qt.io/browse/QTBUG-83459} {not supported} on Windows host platforms.
+*/
+
diff --git a/src/pdf/qpdfbookmarkmodel.cpp b/src/pdf/qpdfbookmarkmodel.cpp
index c9035f21a..78d89cc9b 100644
--- a/src/pdf/qpdfbookmarkmodel.cpp
+++ b/src/pdf/qpdfbookmarkmodel.cpp
@@ -176,17 +176,7 @@ struct QPdfBookmarkModelPrivate
const FPDF_DEST dest = FPDFBookmark_GetDest(document, bookmark);
const int pageNumber = FPDFDest_GetDestPageIndex(document, dest);
- double pageHeight = 11.69 * 72; // A4 height
- {
- // get actual page height
- const QPdfMutexLocker lock;
- FPDF_PAGE pdfPage = FPDF_LoadPage(document, pageNumber);
- if (pdfPage)
- pageHeight = FPDF_GetPageHeight(pdfPage);
- else
- qCWarning(qLcBM) << "failed to load page" << pageNumber;
- }
-
+ const qreal pageHeight = m_document->pagePointSize(pageNumber).height();
FPDF_BOOL hasX, hasY, hasZoom;
FS_FLOAT x, y, zoom;
bool ok = FPDFDest_GetLocationInPage(dest, &hasX, &hasY, &hasZoom, &x, &y, &zoom);
diff --git a/src/pdf/qpdfpagenavigator.cpp b/src/pdf/qpdfpagenavigator.cpp
index 253c1dff8..e077e2184 100644
--- a/src/pdf/qpdfpagenavigator.cpp
+++ b/src/pdf/qpdfpagenavigator.cpp
@@ -207,9 +207,9 @@ void QPdfPageNavigator::jump(QPdfLink destination)
emit currentLocationChanged(currentLocation());
if (d->changing)
return;
- if (!backAvailableWas)
+ if (backAvailableWas != backAvailable())
emit backAvailableChanged(backAvailable());
- if (forwardAvailableWas)
+ if (forwardAvailableWas != forwardAvailable())
emit forwardAvailableChanged(forwardAvailable());
emit jumped(currentLink());
qCDebug(qLcNav) << "push: index" << d->currentHistoryIndex << destination << "-> history" <<
@@ -263,9 +263,9 @@ void QPdfPageNavigator::jump(int page, const QPointF &location, qreal zoom)
emit currentLocationChanged(currentLocation());
if (d->changing)
return;
- if (!backAvailableWas)
+ if (backAvailableWas != backAvailable())
emit backAvailableChanged(backAvailable());
- if (forwardAvailableWas)
+ if (forwardAvailableWas != forwardAvailable())
emit forwardAvailableChanged(forwardAvailable());
emit jumped(currentLink());
qCDebug(qLcNav) << "push: index" << d->currentHistoryIndex << "page" << page
diff --git a/src/pdf/qpdfsearchmodel.cpp b/src/pdf/qpdfsearchmodel.cpp
index 3109430f0..90be76b8e 100644
--- a/src/pdf/qpdfsearchmodel.cpp
+++ b/src/pdf/qpdfsearchmodel.cpp
@@ -196,21 +196,13 @@ void QPdfSearchModel::setDocument(QPdfDocument *document)
disconnect(d->documentConnection);
d->documentConnection = connect(document, &QPdfDocument::pageCountChanged, this,
- &QPdfSearchModel::onDocumentPageCountChanged);
+ [this]() { d_func()->clearResults(); });
d->document = document;
d->clearResults();
emit documentChanged();
}
-void QPdfSearchModel::onDocumentPageCountChanged(int count)
-{
- Q_UNUSED(count);
-
- Q_D(QPdfSearchModel);
- d->clearResults();
-}
-
void QPdfSearchModel::timerEvent(QTimerEvent *event)
{
Q_D(QPdfSearchModel);
diff --git a/src/pdf/qpdfsearchmodel.h b/src/pdf/qpdfsearchmodel.h
index b1094b67b..c1e4e64ec 100644
--- a/src/pdf/qpdfsearchmodel.h
+++ b/src/pdf/qpdfsearchmodel.h
@@ -55,7 +55,6 @@ Q_SIGNALS:
protected:
void updatePage(int page);
void timerEvent(QTimerEvent *event) override;
- void onDocumentPageCountChanged(int count);
private:
QHash<int, QByteArray> m_roleNames;