summaryrefslogtreecommitdiffstats
path: root/src/pdf/quick
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.15' into devAllan Sandfeld Jensen2021-04-131-2/+2
|\ | | | | | | Change-Id: Ia01415e5a44b1df9ed8b3966ff3b39a414b1563c
| * Fix static build of qml qtpdfMichal Klocek2021-04-061-2/+2
| | | | | | | | | | | | | | | | | | Fix duplicated symbols for category logging between core and qml plugin. Task-number: QTBUG-91476 Change-Id: I532ad35b8b0e8a0b93e51b9b7a7b3a4602fad9b3 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * QtPdf: Fix for loading local .pdf files on WindowsMiika Pernu2020-12-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QQuickPdfDocument passed source QUrl::path() to QPdfDocument::load. QUrl::path() output gets "/" as prefix on Windows preventing the file from being found so this needs to be accounted for by changing it to QUrl::toLocalFile(). Fixes: QTBUG-88938 Change-Id: I52ed44f67c22bea31637050442487e1914011de9 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 5852716178972dd34df34dabc52a6616eead0aca) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* | QtPdf: Fix for loading local .pdf files on WindowsMiika Pernu2020-12-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | QQuickPdfDocument passed source QUrl::path() to QPdfDocument::load. QUrl::path() output gets "/" as prefix on Windows preventing the file from being found so this needs to be accounted for by changing it to QUrl::toLocalFile(). Fixes: QTBUG-88938 Pick-to: 5.15 Change-Id: I52ed44f67c22bea31637050442487e1914011de9 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devMichael Brüning2020-07-241-1/+1
|\| | | | | | | | | | | | | | | | | Conflicts: src/core/compositor/delegated_frame_node.cpp src/core/core_chromium.pri src/core/render_widget_host_view_qt.cpp Change-Id: I9387151e9647c87fc387095e7b6d8d66560cdf71
| * Fix prl generation in sub modules of webengine repoMichal Klocek2020-07-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QtPdf and QtWebEngine builds are producing few libraries in one build. This creates some corner cases like prl file generation. Paths in prl files are replaced on installation with sed. Unfortunately this will not work well if we build libraries which depends on not yet installed libs, since prl files reused by build are not processed by sed. Add workaround in this case so all depend libs are aware of their static dependencies and generate correct prl files. Task-number: QTBUG-85616 Change-Id: I0dbeb96bccbc4865dd52dea7c5d619f8cda1a596 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Use QList instead of QVectorJarek Kobus2020-07-156-16/+16
| | | | | | | | | | | | Task-number: QTBUG-84469 Change-Id: I666a060351f73783e15e3f96884c9393a5cd7e46 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devAllan Sandfeld Jensen2020-05-1514-104/+782
|\| | | | | | | | | | | | | Conflicts: src/pdf/quick/qquickpdfselection_p.h Change-Id: I6eec37a01347c2d47cbfc1114326dfc6b58719ff
| * Add PdfMultiPageView currentPageRenderingStatus propertyShawn Rutledge2020-05-031-0/+6
| | | | | | | | | | | | | | | | It is needed to assist with autotests, and may be useful to users too. Also, avoid showing links (dashed lines) until the page is rendered. Change-Id: I1be5aa82631b2ced00de556b34de29cd2ee1d00e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * PdfMultiPageView: add workaround to deal with scale changeShawn Rutledge2020-04-301-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TableViewExtra positionViewAtCell() / positionViewAtRow() merely set contentY (also contentX if needed); but if the delegates are changing in size, it goes undetected until one tries to scroll into a certain range where Flickable detects that originY needs to be adjusted. Getting TableView to do scheduleRebuildTable(RebuildOption::All) forces it to start over with delegate sizes too, as if the model was a QAIM that emitted modelReset(). Since our model is just a number, one way we can trigger that same behavior is to reassign it. This won't be needed when we have the newer TableView with positionViewAtCell() as a built-in function. Change-Id: I18e305b4ab19302464e289e2fc403b97346b1faa Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * PDF views: jump to precise locationsShawn Rutledge2020-04-306-52/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PdfScrollingPageView and PdfMultiPageView were already jumping to the right page; but if you have zoomed in very far, you need it to jump to the right part of the page too. This affects how it jumps to search results, link locations, and the forward/back behavior. All of those should be more precise and repeatable now. But we depend on some new features that are added to TableView for Qt 6; in lieu of those, we use TableViewExtra for now. Fixes: QTBUG-83679 Change-Id: Ie974205562fe7dbf93bae274cef6fefa768aaefb Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * Add QML TableViewExtra type to help improve PdfMultiPageView positioningShawn Rutledge2020-04-304-1/+292
| | | | | | | | | | | | | | | | | | | | | | TableView in Qt 6 adds its own versions of these functions, but we need them now so that PdfMultiPageView can accurately jump back and forth between specific locations and zoom levels. Done-with: Richard Gustavsen Task-number: QTBUG-83679 Change-Id: I895186feab572395af4c49b477b1695480a813df Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * Remove stray backslashShawn Rutledge2020-04-301-1/+1
| | | | | | | | | | Change-Id: I5aba9ca9ae07a7579ee9235aa81543658264574d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * Support text selection handles in PDF viewsShawn Rutledge2020-04-305-46/+350
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Testing only on iOS so far; QtPdf doesn't work on Android because of QTBUG-83459, so we can only hope that this might perhaps be cross-platform, if only text selection handles actually existed on all platforms. As usual, text selection begins with a long-press; the iOS platform plugin intercepts that, and we get QInputMethodEvent::Cursor. There is no cursor, but we use the opportunity to do hit-testing, because the Cursor event is the only way that we receive the pixel location where the user is interacting. Then a popover menu appears, which contains Select and Select All, and either Copy or Paste depending on the qt_im_readonly property workaround. You don't get handles until you choose Select, which will select a word. That makes the popover menu disappear. You can use the toolbar button to copy to the clipboard. After that, you can drag either handle. inputMethodQuery(query, argument) is only ever called with ImCursorPosition regardless which handle is being dragged, so it doesn't make sense to change the selection there, even though that would be easy if we were given that information. Instead, the iOS platform figures out the character range for itself and sends a QInputMethodEvent::Selection event to tell us which text to select. And yet it still doesn't move the handles without being told: QGuiApplication::inputMethod()->update(Qt::ImCursorRectangle | Qt::ImAnchorRectangle) makes that happen. Then the popover menu will appear again, and now you can use the Copy function on it as an alternative way to copy text to the clipboard. By default, when the user does the initial long-press to start selecting text, the popover menu has Select, Select All, and Paste. In editable controls there is a second possible menu that normally has Cut, Copy, Paste and Delete. We are not able to enter that mode. So as a workaround, to substitute Copy instead of Paste, we set the qt_im_readonly property so that QIOSTextResponder::canPerformAction() can detect it and make the substition. Of course that won't work without the patch to 5.15; so you still get a useless Paste action on earlier Qt versions. Selecting a word via the Select popover menu item happens because iOS sends QKeySequence::MoveToPreviousWord and then QKeySequence::SelectNextWord. We spend time calling getSelectionAtIndex() twice because of that. With an actual keyboard, it should be possible to use keystrokes to extend the selection, but it doesn't seem to work yet with shift-arrows on a physical bluetooth keyboard on iOS. Select All on the popover menu works via inputMethodEvent() with attr QInputMethodEvent::Selection. Copy sends the standard copy key sequence, so keyReleaseEvent() handles it. We must rename the geometryChanged signal to selectedAreaChanged now that we're inheriting from QQuickItem, to avoid shadowing QQuickItem::geometryChanged. For this kind of text selection to work even when the rendering is scaled, it became necessary to inform PdfSelection of the rendering scale; so a renderScale property is added. Thus it is sensible (and a nice simplification in QML code) to use it for the fromPoint and toPoint properties, such that those are now expressed in pixels rather than points. Fixes: QTBUG-82441 Task-number: QTBUG-83811 Change-Id: I16ecd2db55c6a834be6139ce4f3aae23446fed54 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * QtPDF Quick: remove private API dependenciesShawn Rutledge2020-04-294-4/+2
| | | | | | | | | | Change-Id: I5cdbedb5b20c32d1c7e3ed8e8a79490be2871a77 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devAllan Sandfeld Jensen2020-04-2710-123/+364
|\| | | | | | | | | | | | | | | Conflicts: configure.pri src/pdf/api/qpdfpagerenderer.h Change-Id: I7e68277080e29238bbfe8511539ea75b2db89489
| * PdfSelection: add selectAll() function; use in examplesShawn Rutledge2020-03-115-0/+28
| | | | | | | | | | | | | | | | 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>
| * PDF quick plugin: fix warning about unused engine arg on static buildsShawn Rutledge2020-03-111-1/+3
| | | | | | | | | | | | | | The build for iOS is static. Change-Id: I3e6c13c920861a2a6bf0079e53e76322bb93935f Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * Add PdfStyle; use Control palette colorsShawn Rutledge2020-03-056-26/+189
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PdfStyle.qml can be overridden via file selectors, and contains extra styling beyond what Control.palette provides. Search results are highlighted with a lightened, translucent version of the Controls style's accent color, and the current search result is highlighted with a solid border with the accent color. The text selection color comes from the Controls theme highlight color, which tends to be the same as QPalette::Highlight. The link underscore is also configurable in PdfStyle, but its color comes from the Controls theme link color, which tends to be the same as QPalette::link. Task-number: QTBUG-82540 Change-Id: I7c7e80323cf5d7c94dde775a38cdec239a6351a9 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Render PDF link decorations as dashed underlines rather than boxesShawn Rutledge2020-03-042-6/+18
| | | | | | | | | | | | | | | | | | So they look more like (old-school) web links. The underlines are always horizontal and underneath the area of occurrence though; rotated link text has not been tested. Change-Id: I4fc01d88367b0cc9bbc23e9f85a3b42efb271fb8 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * PdfMultiPageView: correct the license headerShawn Rutledge2020-03-041-33/+19
| | | | | | | | | | | | | | Standard header for module code rather than for an example. Change-Id: I39fad99f9c018530ccc12036eb502a78a521a0c0 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| * PdfMultiPageView: update search highlights when results changeShawn Rutledge2020-02-261-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the single-page view, we bind to the PdfSearchModel.currentPageBoundingPolygons property, which is convenient because it has a changed signal, so it stays updated in all cases: when the user changes the search string, when a different document is loaded, or when changing the current page. In the multi-page view, we need to invoke a function to get the search results on each page, because results are different on each page, and we often need to show multiple pages at the same time. The challenge then is how to ensure that it gets re-evaluated often enough. It requires connecting to more than one signal; but there isn't any way to "kick" a binding when some signal occurs, so the solution isn't very declarative, unfortunately. Change-Id: I72e7dad01b8cb6c43abcccf4fa46e443409b39e0 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * PdfMultiPageView: highlight current search result when tapped in listShawn Rutledge2020-02-261-1/+2
| | | | | | | | | | Change-Id: Ib0a1aeac28350c8705899ab799ce776e6764b306 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * PdfMultiPageView: retain position after pinch zoomShawn Rutledge2020-02-261-7/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you do the pinch on a trackpad, the mouse cursor doesn't move, and the same visible part of the page will remain under the cursor after the page is re-rendered. Likewise when doing the pinch on a touchscreen, the centroid (midpoint between the two fingers) is held in place, subject to the constraints that Flickable.returnToBounds() imposes. Similar to 29cb44ee471908ac7c4cac70e3defb8bd72a80cd. Also corrected the horizontal scrolling range according to rotation; added left and right margins so that the page edges are more visible when the page is wider than the view, and thus the horizontal scrolling range feels more accurate while the scrollbars are still shown. Change-Id: Ia2a15eee5bcd5c9e7f025634f02a5a546e6aab68 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * PdfScrollablePageView: move selections and links inside the imageShawn Rutledge2020-02-211-63/+57
| | | | | | | | | | | | | | | | | | Now that the Image is being rotated and the "paper" rectangle is not, we need to work in the right coordinate system for rendering of Shapes on top, and for handling drags to select text. Change-Id: I6bc1e2fe7997ffc4673720abdcd3b7e4d9bc9012 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * PdfScrollablePageView: retain position after pinch zoomShawn Rutledge2020-02-211-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | If you do the pinch on a trackpad, the mouse cursor doesn't move, and the same visible part of the page will remain under the cursor after the page is re-rendered. Likewise when doing the pinch on a touchscreen, the centroid (midpoint between the two fingers) is held in place. This is achieved by moving the scrollbars afterwards, subject to their constraints. Change-Id: I34caca4ebbb5c11007dd2462416a42c1a2d8e104 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Fix building dev with newer QtBaseAllan Sandfeld Jensen2020-04-241-2/+2
|/ | | | | Change-Id: I0d52e4f6684425cb15319760e0001bdb13846997 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* PdfScrollablePageView: improve positional navigationShawn Rutledge2020-02-201-7/+32
| | | | | | | | | | | Similar to f467edc97e66727be7fa3747913e4e01672d4b71: NavigationStack is kept up-to-date when the scroll position changes, and can go back to a previous position; and links can in theory jump to specific positions and zoom levels, scrolling such that a specific x coordinate is visible. Change-Id: I2add617914d89b0dc5389e7c3d12d11580a1f82f Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Add PdfScrollablePageView, use it in the pdfviewer exampleShawn Rutledge2020-02-205-1/+253
| | | | | | | | | PdfPageView might be useful in some cases, but we need to get feature parity with PdfMultiPageView as much as possible, including scrollbars. Including them in the view is convenient, but also less flexible. Change-Id: Ibbe6a090a5f5b1d340124986fe49672d682ddedb Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* PdfMultiPageView: use TableView; horz. scroll; control page positionShawn Rutledge2020-02-204-165/+280
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* QtPdf examples: use test.pdf from resources if no file givenShawn Rutledge2020-02-191-1/+4
| | | | | | | | | | | | | | | | | | 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>
* Fix PdfLinkModel's location y coordinate; add PdfMultiPageView tooltipShawn Rutledge2020-02-191-0/+10
| | | | | | | | | | | | As usual, coordinates are in the first quadrant, and we need to convert to 4th quadrant to get a y value that can be used to adjust contentY of a ListView or TableView. The tooltip when hovering over links provides a way to verify that the link really jumps where it's intended to. Change-Id: I9107639f15496a987c0fa7c3c2e2583c3839cc6b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Guard against crash in QQuickPdfSearchModel::setDocument()Shawn Rutledge2020-02-191-1/+1
| | | | | | | If the document is null, ignore it. Change-Id: I3cebd049fb5d16d0064dddf00183f231019ef03c Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Enable mouse wheel scrolling in single-page PdfPageViewShawn Rutledge2020-02-171-0/+10
| | | | | Change-Id: I20512187dcc872b2e0429968e9ad2a9899aee6c2 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Rearrange PdfPageView.qmlShawn Rutledge2020-02-171-56/+57
| | | | | | | | | | | | 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>
* PdfSearchModel: be QALM and find search results on all pagesShawn Rutledge2020-02-174-121/+234
| | | | | | | | | | | | | | 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>
* PDF multipage viewer: iterate search resultsShawn Rutledge2020-02-111-32/+68
| | | | | | | | | | | | | | | | | 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>
* PDF multipage view: track specific link and navigation destinationsShawn Rutledge2020-02-112-12/+39
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* PDF multipage view: add vertical scrollbarShawn Rutledge2020-02-111-0/+1
| | | | | | | | So far it does not update the spinbox with the current page to which the user has scrolled, because ListView.currentIndex doesn't change. Change-Id: I5dfa644401f77628c71ad1db7d64c5f0ac1e0c65 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Add QPdfDestination; NavigationStack stores page, location and zoomShawn Rutledge2020-02-114-52/+164
| | | | | | | | | | | | Push/back/forward behavior seems more correct now, but still no autotest yet. QPdfDestination might be useful to represent locations of search results, for link destinations and maybe named destinations too. Fixes: QTBUG-77512 Change-Id: I113b2c535a2cd302106e6546104c64e12985d387 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Add zoom and rotation to PdfMultiPageViewShawn Rutledge2020-02-041-13/+82
| | | | | | | | | | | | | 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>
* Temporarily use MouseArea for links in Pdf(Multi)PageViewShawn Rutledge2020-02-042-14/+16
| | | | | | | | | | HoverHandler.cursorShape is new API in 5.15, so we have to use MouseArea for 5.14. This patch can be reverted as soon as 5.14 is no longer supported. Change-Id: I1c830215729038095ec33ece36a1a83108cbd835 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Add PdfMultiPageViewShawn Rutledge2020-02-034-0/+183
| | | | | | | | 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>
* Add PdfNavigationStack for forward/back navigationShawn Rutledge2020-02-035-8/+280
| | | | | | | Works well enough to use, but needs autotests and at least one fix. Change-Id: I2114b9fb3b5ddf7cfe2106d4a4fbc7d74852c61d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* PdfPageView: Add zoom-to-fit and zoom-to-width featuresShawn Rutledge2020-02-031-1/+56
| | | | | Change-Id: I40b92000a4def105d22a3bd10d0544b0b0f0fe1e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Add PdfLinkModelShawn Rutledge2020-01-306-0/+250
| | | | | | | | | | | | Internal links and web links populate the QALM, which can then be used to drive a Repeater to position highlight rectangles with TapHandlers, which will handle a click by jumping to the link destination. Fixes: QTBUG-77511 Change-Id: I3b5b96d6e82bfd578f31f631f24279173036a080 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Add QPdfSelection and QQuickPdfSelectionShawn Rutledge2020-01-306-0/+425
| | | | | | | | So now you can select text by mouse-drag and copy it to the clipboard. Task-number: QTBUG-77509 Change-Id: I689ee4158974de8bc541c319a5a5cc2f8f3c2ae6 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* doc: rename QML type Document -> PdfDocumentShawn Rutledge2020-01-301-17/+17
| | | | | | | | | I would prefer to use the "import as" mechanism to allow the user to customize prefixes rather than hard-coding them, actually; but currently every QML type in the QtPDF module has a hard-coded Pdf prefix. Change-Id: I4c00e7891c58e028280599d6089a821b9e285c1a Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Add rotation actions to the QML pdf viewer exampleShawn Rutledge2020-01-231-1/+0
| | | | | | Task-number: QTBUG-77514 Change-Id: Ifa7515dae18b278e038c2e5fad46492ca158b044 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Add QPdfSearchModel, QML PdfSearchModel and PdfPageViewShawn Rutledge2020-01-238-2/+447
| | | | | | | | | | | | | | | | This enables searching a PDF for a text string and getting the boundaries of the areas where it is found. The boundaries are returned as polygons intended to be rendered with PathMultiline. PdfPageView is a QML component intended to be a drop-in viewer for use in applications that need the most common PDF viewing functionality. More advanced applications are free to use it as a starting point for customization. Task-number: QTBUG-77507 Task-number: QTBUG-77514 Change-Id: Id08ac30224e41b6cdfb9300cc4288d5750259f78 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>