| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
This example exists to show a simpler viewer using PdfScrollablePageView
rather than PdfMultiPageView. Most users will probably prefer the latter,
so we don't highlight this one.
Pick-to: 6.7
Task-number: QTBUG-81560
Change-Id: Ia601b8c8ec0cb9002aa118917720a37b4f8095a5
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's better for usability in case the user is doing repeated searches:
press control-F and start typing to search for different text, rather
than needing to do something else to select or delete the existing
text in the search field.
Fixes: QTBUG-120447
Pick-to: 6.2 6.5 6.6 6.7
Change-Id: I8d5a519a631c406dff91198b23a022856609fa4c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A crash was possible if there are no search results and the user
presses the up/down buttons alongside the search field on the toolbar.
That was easily fixed (in a previous patch); but actually those buttons
should be disabled if there are no results to navigate. To do that, we
need a notifying property rather than depending on the invokable
QAIM::rowCount(). Follow the usual pattern for a one-dimensional model:
add a `count` property in the subclass (as in XmlListModel,
FolderListModel, CalendarModel, and a few others).
Task-number: QTBUG-119776
Change-Id: I51c75b58f3a440c1c470794518a572b384376ea7
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
It's unfortunate that we need to use a numeric index; but it will be ok
as long as we don't rearrange tabs any more.
Pick-to: 6.2 6.5
Fixes: QTBUG-106359
Change-Id: I036c45a6de7690e9ed122c74448a89da343f10d5
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
| |
Drop a different file onto the window to replace its contents with a
different PDF.
Pick-to: 6.4
Change-Id: I824d9f0caee69382352ab8d943b9977984db4fc9
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
License files are organized under LICENSES directory.
Pick-to: 6.4
Task-number: QTBUG-67283
Change-Id: I869ffda1080e283f231eb0dc4477b260f2054d99
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PdfSearchModel.currentResult is now the index within the whole list
of search results, rather than starting over from 0 on each page.
This simplifies some code.
The way that PdfMultiPageView uses PdfSearchModel, the currentPage
property is read-only: it tells the page of currentResult (which we need
in the view, because each page has the ability to show a
current-search-result highlight shape, but only one page actually needs
to show it). The controls in a viewer to iterate search results (up and
down arrows in the footer) simply increment and derement currentResult;
the currentPage property gets updated to tell the view which page
currently holds currentResult; and the ListView highlight follows along
in the sidebar too, because ListView.currentIndex is now bound to
searchModel.currentResult.
But in PdfScrollablePageView, we still need to bind the currentPage
property, to get the currentPageBoundingPolygons property updated
when we switch pages. Since that viewer only sees one page at a
time, it's much more declarative to do it that way, rather than
calling the invokable boundingPolygonsOnPage(int) function.
Bindings get updated on their own; whereas in PdfMultiPageView
it's a bit inelegant that we need to call boundingPolygonsOnPage()
repeatedly, at the right times so that the highlights are never
shown in the wrong places at the wrong time. It could be avoided
if we had a separate per-page model object to filter the results
from the main PdfSearchModel; but that would add significant API
complexity, and perhaps be too confusing for anyone who tries to
re-implement a QML-based viewer component.
The current search result highlight now stays on the page where
the user left it: scrolling manually to another page will no
longer choose a current result on the new page, as it did before.
This is more consistent with typical applications.
A currentResultLink property is added, to make it easy to call
PdfPageNavigator.jump(link), thus passing along the QPdfLink.rectangles.
The same link object gets re-emitted in the PdfPageNavigator.jumped
signal to tell the view to scroll in such a way as to get those
rectangles visible in the viewport, via TableView.positionViewAtCell().
There are a couple of drive-by fixes:
QQuickPdfSearchModel::documentChanged() doesn't need to be declared,
because we are using the signal inherited from QPdfSearchModel.
And const-correctness is improved in the implementation of
boundingPolygonsOnPage().
[ChangeLog][QtPDF] PdfSearchModel.currentResult is now the result index
within the whole set of search results rather than on currentPage;
and changing currentPage no longer makes currentResult change.
In the views, this means the current highlighted search result stays
on the same page even when the user views a different page.
Change-Id: I96957f50e703f62101b3d3c708ff5f27b162cd8d
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|
|
|
|
|
|
|
| |
If the caller doesn't want to change it, it's easier to omit it rather
than remembering that 0 is a special value.
Change-Id: I851f678941e5144a9dea306fddba59fd15ed9939
Reviewed-by: Doris Verria <doris.verria@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
This API is available for both C++ and QML.
The pageModel makes it easier to populate item-views with per-page
information, such as thumbnails labeled with page labels.
Fixes: QTBUG-102271
Change-Id: I70df481b378efed0327e7bb89a63c7669daecc70
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|
|
|
|
|
|
| |
It was just an alias for currentFrame.
Change-Id: Ib16f579b1905cf5fe43496553ebde054d474a7c7
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the sidebar only held search results, it was enough to show it when
pressing enter on the search field; but now it holds two other views
that the user will want to easily look at. It's a Drawer, and those are
tricky to open and close by mouse-dragging. The button is more obvious,
like the one at the bottom of Creator. Its checked state shows whether
the sidebar is open, and clicking it opens the sidebar if it wasn't
already open. Clicking outside the sidebar closes it.
Change-Id: Ib4e403aa6f06d5e4dbad08a80c99496ab6c5fa0f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|
|
|
|
| |
Change-Id: I33a365a1591565bc2a95c6ae62382c71c7e1850b
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|
|
|
|
|
|
|
|
| |
Change the PdfDocument's id to doc, because in the GridView delegate,
PdfPageImage { document: document } causes trouble (even though the same
sort of binding was ok elsewhere).
Change-Id: I9eafd818c25a31bef50b0b7fba36449c1dcf884a
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Drawer is now not only for search results, but has a sideways TabBar
just like the widget example has; and now it can show search results and
bookmarks (table of contents) on different tabs. (Perhaps TabBar was not
meant to be rotated, but it seems to work in the styles I've tried so
far.) Clicking a bookmark takes you to that page, location and zoom.
Followup to 303c25e79ab12d5d48523aa890f2091e98d3b560 which added this
feature to a manual test.
Task-number: QTBUG-77510
Change-Id: I235ff14c9f6597eb8282ef1d73112b023a61ef8a
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|
|
|
|
|
|
| |
Pick-to: 6.3
Task-number: QTBUG-81560
Change-Id: I062e022a97c146e9a746b6d6358868bfe0c0a7d7
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
- no need for the document.onStatusChanged handler
- no need for empty-argument function() { ... } in onSignal handlers
- unqualified access and so on
- scale the search field margins and erase-button a bit better
Change-Id: Ice8a41e4cc1fb0385046aa1867fdb4b1400234b6
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
When the user has not yet entered a password, document.status == Error;
but we pop up the password prompt dialog on top of the error dialog.
After the user has entered it, either it's correct and the error goes
away, or we need to tell the user that it's incorrect, so the dialog
should stay open.
Change-Id: Ib3332f543b23fdf50ccd0df0c7e79cdc95f2e8da
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The multipage example was OK already; this adds the same password-prompt
dialog to the single-page-at-a-time pdfviewer example and to the
withdoc.qml manual test. Also, the dialogs seem to size themselves
better if we explicitly set the contentItem properties. And an
error dialog should not have an OK button but a Close button:
the error is not OK, but the example does not provide a way to
try to fix it either.
Fixes: QTBUG-83988
Fixes: QTBUG-96574
Change-Id: I9d8c3cbe1f955cea4319982869ec9180d7c8666c
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- required properties
- unused imports
- nullish coalescing
- issues found by qmllint (despite all the noise)
Reverts 99db09404787901647213abceda74befc7efa8f1
Task-number: QTBUG-82873
Change-Id: I0042d2eaeacba58adcf280c37b9668f8d76d0f93
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
| |
Qt.labs.platform is becoming obsolete, and creates a widgets dependency.
QtQuick.Dialogs uses platform dialogs when available.
Pick-to: 6.2 6.3
Change-Id: I9b608e28cc7b9a99d0aaeec2aa24fee9d569dfe8
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Port QtPdf to Qt6:
* QtPdf,QtPdfWidgets,QtPdfQuick libs
* QtPdfQuickPlugin, QtPdfPlugin (imageformat) plugins
* widget and quick examples
* qtpdf tests
To fit gn cmake integration and new repo layout code is a bit
reshuffled.
Compared to qmke build following features are not ported yet:
* ios fat libs
* qtbase 3rdparty static dependencies
WebEngine build can be skipped with setting
QT_FEATURE_qtwebengine_build=OFF
Note this patch needs follow up for 6.2 branch to disable qtpdf
builds by default, since this should not part of qt 6.2 release.
Pick-to: 6.2
Task-number: QTBUG-95353
Change-Id: I4dd9f3934bdd478fb6d2fa686074a24d91f09953
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
|
|
|
|
|
|
|
|
|
| |
SpinBox.valueModified is emitted only when the user interactively
modifies the value; so SpinBox.value++ doesn't trigger view.goToPage().
Therefore we should call it explicitly when handling those key shortcuts.
Change-Id: I9648d1d143812d34d77218fd9ed7559415d13f63
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
| |
The QtQml import isn't working in any QML dependencies unless it's detected
because of having been included in the main QML file.
Task-number: QTBUG-82873
Change-Id: I2ed2ca439651c40089d667255effb1155af58a01
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
The usual shortcut (control-A) now selects all text on the current page,
it is highlighted, and it can be copied to the clipboard.
Change-Id: I5e6d9cae675862808f8b9027cb47024ca65cf2fd
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
...as separate roles, to make alignment easier, and to avoid hard-coding
HTML tags in the Context role as it was before.
But the strings in these context roles are not always adjacent to the
search results in geometric coordinates sometimes, in some PDF files,
despite having adjacent character indices. I.e. the "next" character
after the search string, or the "previous" character before it, could be
anywhere on the page.
Change-Id: Ief0a490b64fdb3c3ca98506926650648b609ece1
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TableView is missing some features compared to ListView; so finding out
where we currently are (which row) and programmatic positioning on a
specific y coordinate of a specific row require some workarounds for now,
including helpers in PdfDocument.
TableView also assumes (and sporadically enforces) that all cells in a
column have the same width. So we need a placeholder Item for each page.
This also helps with rotation: the placeholder is now as wide as the
window or the image, whichever is wider, and the "paper" is centered
within; thus there's always room to rotate it.
There's still some problem with setting contentY in goToPage() after
the page has been zoomed to a size larger than the window: the values
look correct, but it scrolls too far.
But on the plus side, horizontal scrolling works. So now we attempt to
control the horizontal position too: NavigationStack tracks it, and can
go back to a previous position; and links can in theory jump to specific
positions and zoom levels, scrolling horizontally such that a specific x
coordinate is visible.
Includes minor UI tweaks to make it look better on iOS.
Change-Id: I643d8ef48ef815aeb49cae77dcb84c3682563d56
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On iOS, the native FileDialog doesn't work, sharing doesn't work, and
packaging files along with the application requires manual effort; so
a PDF file in resources seems to be the easiest alternative to make
the examples demo-able.
QPdfDocument wants a file path, because it uses QFile; but we like
to use URLs in Qt Quick. So it's a bit of an impedance mismatch,
there are several choices about when and where to do the conversion,
and it's hard to say which way is more correct. This way happens
to work for now.
Also do the rest of the things necessary to get this working on iOS.
Change-Id: Icb8614d5eed2510f101aefba534ef80cf890518f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Hiding the search feature in a closed Drawer might not have been
sufficiently touch-friendly and discoverable, for example on iOS where
the user is not going to press control-F to start searching.
But the top toolbar is too full to put the search field back up there.
It's familiar from Firefox to have the search field at the bottom,
and we have enough space for it there. So now you can search and
jump around the search results without opening the drawer; but pressing
Enter in the search field opens the drawer. Hopefully swiping to open
the drawer is also convenient enough on touch platforms; otherwise we
could add another button for that, perhaps at the left of the footer.
Change-Id: Iaec63bc22b03e29156fee817d197daae5b0cf9d5
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now it looks more similar to PdfMultiPageView.qml: public properties
and functions are grouped by functionality, implementation details are
"below the fold", and properties and functions that we don't want to
expose as API are nested inside inner items.
Also fixed ColumnLayout attached properties.
Change-Id: Iafe6f983a34ca6bac9b0d4f3a26aba5a426e0232
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's a QAbstractListModel, so now PdfMultiPageView has a ListView in a
left-side Drawer showing all results found so far.
- In PdfMultiPageView, multiple pages exist at once, so it makes sense
to use the same searchmodel for all.
- It's faster and saves memory.
- Search results on each page can be cached.
- It's possible to show search results in a ListView or QListView.
Change-Id: I66fba6975954a09a4d23262be87ff8cc25ee7478
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This version still has separate PdfSearchModel instances on each page,
but now there are buttons to iterate and highlight the search results
in order. When you come to the last result on one page, hitting the
"Find Next" button will jump to the next page, and keep jumping forward
from there until another result is found. Unfortunately this jumping
takes time if it skips over a lot of pages because of empty search
results. That seems to be another reason to make PdfSearchModel into a
whole-document search model and use one instance.
Also reorganize PdfMultiPageView.qml's public API into sections
according to functionality rather than by type.
Change-Id: I677a764fcbf231b2656aff8abe7240a27582a696
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Unfortunately it's getting harder to do things declaratively, because we
have to avoid circular bindings, and because of needing to use imperative
APIs. The current-page spinbox provides onValueModified() to detect when
the user modifies it, distinct from the simple fact that the value changed.
We shouldn't make bindings to set ListView.currentIndex anyway, because
that results in slow animation (and loading pages in all delegates along
the way) rather than quick jumping to the correct page. Instead we need
to use ListView.positionViewAtIndex(), another imperative API, to get
quick jumps without having to calculate and set contentY in some other way.
Now we move toward the NavigationStack providing storage for the current
destination at all times. Changes there will trigger programmatically
moving the ListView.
When the user scrolls manually, that generates a "destination" in the
navigation stack, such that the back button can jump back to the
previous location, and then the forward button can return to the
destination where manual scrolling ended up.
Fixes: QTBUG-77510
Change-Id: I47544210d2e0f9aa790f3d2594839678374e463d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, scaleToWidth() and scaleToPage() choose the scale of the
first page to fit the given viewport size, and as long as all pages are
the same size, it works. On the other hand, the PinchHandler only
affects the scale of the page on which the pinch gesture occurs.
Calling resetScale(), scaleToWidth() or scaleToPage() undoes the
effect of any previous pinch gesture or any other kind of scaling change.
Task-number: QTBUG-77513
Change-Id: Ia3227ca9c4af263eb8505dbd6336657984c66ab0
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
So far it's a ListView with a page per delegate. Many features are working,
but zooming and rotation are not working yet.
Change-Id: I9ee7aa60ad4411bd8734fe2cd987a68906a5cf57
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|