summaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
...
* | Rename QWebEngineDownloadItem -> QWebEngineDownloadRequestMichal Klocek2020-08-185-26/+26
| | | | | | | | | | | | | | | | | | | | This fits better with other QWebEngine*Requests. [ChangeLog] QWebEngineDownloadItem is now QWebEngineDownloadRequest, also in qml. Change-Id: I506e9fac746b4f23ac0936c2fbe1c7472f4fda36 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* | Unify certificate error handlingMichal Klocek2020-08-142-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | Before we move the certificate error to core, unify error handling between qml and widgets. [ChangeLog] WebPage::certificateError does not return bool it is enough to call defer, ignoreCertificateError() or rejectCertificate(). Change-Id: I14be40f1ab6b4cbded550260d66152f51cf47de2 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Remove QT_VERSION from simplebrowserMichal Klocek2020-08-149-51/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since 468c2d9a6 it is possible to compile simplebrowser with older versions of webengine. Unfortunately it makes example code harder to read and follow. It affects user experience and does not provide any benefits for the user. Moreover, with Qt6 changes to api this would even look more ugly and complexity will grow over time. Keep example code simple and clean, remove all the QT_VERSION checks. Change-Id: I2b2ea1d11c1e59bdcbbc7351daae5308f23890d3 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Merge all webenginecontextmenudata wrappers into one classMichal Klocek2020-08-121-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce new class qwebenginecontextmenurequest in core which merges: * qquickwebenginecontextmenurequest * qwebenginecontextmenudata * implictly shared webenginecontextdata Unfortunately new class has to be QObject, since we want to reuse it qml. Q_GADGET can be used only as a value type, however we need to know if request is accepted or not in qml, therefore it must be passed as pointer. Since we use QObject now, class is no longer implicitly shared, however we only allocate request once and reuse the object for every new request (it is still copied in qml just to keep it aligned with other request handlers) [ChangleLog] QWebEngineContextMenuRequest is replacement for QWebEngineContextMenuData Change-Id: Ib387ec2065361a4bacc20675ca7352ab75a0e436 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* | Move QMenu handling from page to viewMichal Klocek2020-08-122-3/+3
| | | | | | | | | | | | | | | | [ChangeLog] createStandardContextMenu is moved from QWebEnginePage to QWebEngineView Change-Id: I08a7a1f7e55ca7396547006523cdec250a3ad117 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Use QList instead of QVectorJarek Kobus2020-07-153-6/+6
| | | | | | | | | | | | Task-number: QTBUG-84469 Change-Id: I666a060351f73783e15e3f96884c9393a5cd7e46 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Adapt to newer dependenciesAllan Sandfeld Jensen2020-07-061-1/+0
| | | | | | | | | | | | Change-Id: I495880f56fbc10d8f332f26101f8a25c2a1c5631 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io> Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devAllan Sandfeld Jensen2020-06-291-5/+21
|\| | | | | | | | | | | | | Conflicts: src/src.pro Change-Id: I03c260ba676296f93d8137e79b46f3978f5f41ef
| * Fix 'qmake -r' runMichal Klocek2020-05-291-5/+21
| | | | | | | | | | | | | | Use current configure instead of qtHaveModule(). Change-Id: Ifc4500ff5eee4b997a0c02fb387d8918f88d06d1 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.15' into dev"Allan Sandfeld Jensen2020-05-151-2/+2
|\ \
| * | Merge remote-tracking branch 'origin/5.15' into devAllan Sandfeld Jensen2020-05-151-2/+2
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/pdf/quick/qquickpdfselection_p.h Change-Id: I6eec37a01347c2d47cbfc1114326dfc6b58719ff
| | * Support text selection handles in PDF viewsShawn Rutledge2020-04-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Update 'dev' dependenciesAllan Sandfeld Jensen2020-05-144-6/+6
|/ / | | | | | | | | | | | | Including three compile fixes. Change-Id: I497ed359d229e869b67aa10e4114a37ceec4be97 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devAllan Sandfeld Jensen2020-04-276-4/+97
|\| | | | | | | | | | | | | | | Conflicts: configure.pri src/pdf/api/qpdfpagerenderer.h Change-Id: I7e68277080e29238bbfe8511539ea75b2db89489
| * Fix PgUp/PgDown navigation in the PDF multi-page exampleShawn Rutledge2020-04-161-2/+2
| | | | | | | | | | | | | | | | | | 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>
| * Workaround for failing import QtQml in PDF views on iOSShawn Rutledge2020-03-162-0/+2
| | | | | | | | | | | | | | | | | | 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>
| * Merge remote-tracking branch 'origin/wip/qtpdf' into 5.15Shawn Rutledge2020-03-116-2/+93
| |\ | | | | | | | | | Change-Id: Iacb9b45c2304ab123309f67c9b173ea39225898a
| | * PdfSelection: add selectAll() function; use in examplesShawn Rutledge2020-03-116-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | 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 single-page example: shift content right as the search drawer opensShawn Rutledge2020-02-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | This was done in 0b6a4d94945a975390b2574e6aff2568ebb7f061 for the multipage example. Change-Id: Ia5b51b9239521ab4d65e41aaebe52d178e75932d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| | * PdfSearchModel: provide ContextBefore and ContextAfterShawn Rutledge2020-02-262-2/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...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>
* | | Fix building dev with newer QtBaseAllan Sandfeld Jensen2020-04-242-4/+4
|/ / | | | | | | | | Change-Id: I0d52e4f6684425cb15319760e0001bdb13846997 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* | Merge remote-tracking branch 'origin/wip/qtpdf' into 5.15v5.15.0-beta1Shawn Rutledge2020-02-2131-51/+931
|\| | | | | | | | | | | | | | | The feature set is mostly in place (except for some known shortcomings) and we need the merge to build it on iOS. Task-number: QTBUG-69519 Change-Id: Ib1ac82a9a7e0830d98d1c4327a1b15d4d7f4d4c1
| * PDF single-page example: move search field to the footerShawn Rutledge2020-02-201-71/+71
| | | | | | | | | | | | | | | | As with a2be3a7a79dc4fabe8675ea80a6ba550e0e4deec, this makes the search feature more discoverable and touch-friendly. Change-Id: I47e37273c583121d60985cc27c22f56e6d655ab0 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * Add PdfScrollablePageView, use it in the pdfviewer exampleShawn Rutledge2020-02-201-45/+30
| | | | | | | | | | | | | | | | | | 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-201-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1910-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * PDF multipage example: move search field to the footerShawn Rutledge2020-02-191-76/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Enable mouse wheel scrolling in single-page PdfPageViewShawn Rutledge2020-02-171-0/+16
| | | | | | | | | | Change-Id: I20512187dcc872b2e0429968e9ad2a9899aee6c2 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * Rearrange PdfPageView.qmlShawn Rutledge2020-02-172-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | 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-175-66/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-114-24/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Add QPdfDestination; NavigationStack stores page, location and zoomShawn Rutledge2020-02-111-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Add multipage example to pdf.pro; work with 5.14; fix main.cppShawn Rutledge2020-02-044-8/+9
| | | | | | | | | | | | | | | | | | | | - build the multipage example by default - don't import anything that won't work with Qt 5.14 - set application attributes before creating an instance (to fix the warning about that) Change-Id: I265f49ca75cae1908d4c23848cba8c42e5e3824b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * Add PdfMultiPageViewShawn Rutledge2020-02-0316-0/+522
| | | | | | | | | | | | | | | | 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-031-4/+27
| | | | | | | | | | | | | | 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-034-1/+41
| | | | | | | | | | Change-Id: I40b92000a4def105d22a3bd10d0544b0b0f0fe1e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * Add QPdfSelection and QQuickPdfSelectionShawn Rutledge2020-01-303-0/+24
| | | | | | | | | | | | | | | | 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>
| * Use SpinBox for page navigation to get jump-to-page featureShawn Rutledge2020-01-301-13/+13
| | | | | | | | | | Change-Id: Ic4c7d1a7458995415452e899b3dc369c9fe574f4 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * Doc: Add docs for the Qt PDF Viewer exampleLeena Miettinen2020-01-281-0/+108
| | | | | | | | | | | | Task-number: QTBUG-81560 Change-Id: I159747a097a6a6a28c2355e8ff6b6c59a4f3a29a Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Allan Sandfeld Jensen2020-02-191-9/+22
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | Blacklisted one test requiring an update of qt5.git. Conflicts: .qmake.conf Change-Id: I75e55a1c5f8840cde55ddb60d632287b2affadeb
| * | Example 'quicknanobrowser' improvementsKirill Burtsev2020-02-081-9/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix TabView containing no tabs by using one method on close with tab's button, StandardKey and windowCloseRequested. * Prevent warning on invalid tab's icon * Set default title for new empty tab Change-Id: I1a8522b10fff8107e4ee213cb6760c637a4f6e9d Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* | | Merge remote-tracking branch 'origin/wip/qtpdf' into 5.15Michael Brüning2020-01-2734-0/+1376
|\ \ \ | |/ / |/| / | |/ | | | | | | Initial merge of QtPdf into QtWebEngine. Fixes: QTBUG-69519 Change-Id: I48dc25a59f2c161bb231bd0fa60392eb70fe4e7d
| * Add rotation actions to the QML pdf viewer exampleShawn Rutledge2020-01-234-0/+28
| | | | | | | | | | | | Task-number: QTBUG-77514 Change-Id: Ifa7515dae18b278e038c2e5fad46492ca158b044 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
| * Add QPdfSearchModel, QML PdfSearchModel and PdfPageViewShawn Rutledge2020-01-2313-0/+382
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Add QtPdf and QtPdfWidgets modulesMichal Klocek2019-11-252-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds two new modules to qtwebengine repository. New modules do not depend on webengine module, however webengine chromium source code and Chromium "gn" configuration is required to build QtPdf. Adding two unrelated modules to webengine might look crazy: however sharing gn build configuration and Chromium code base with necessary qt adaptations simplifies code maintenance and minimises required code checkouts. Back porting of security patches for Chromium also affects Pdfium. Moreover, Pdfium is no longer a separate project, but integrated into Chromium: therefore moving it out of Chromium source tree would require extra effort. Rename webengine-core feature to build-qtwebengine-core, this makes consistent feature naming with build-qtpdf At the moment two new modules have integrated build, with possible shortcuts: qmake -- --no-build-qtwebengine-core qmake -- --no-build-qtpdf Webengine build is disabled by default now. Change-Id: Iac3d9927d51f3ac316db0148d275eda843dcc19b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * Port pdfviewer example to QPdfView widgetTobias Koenig2019-11-2510-479/+311
| | | | | | | | | | Change-Id: Id651a2c179628506f0955751abda57cbae569ee9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Fix compilation with custom Qt namespaceTobias Koenig2019-11-253-0/+8
| | | | | | | | | | | | | | | | Fix the compilation of QtPdf examples when compiled against a Qt version that uses a custom namespace. Change-Id: I3bd8d89a3ad1e270ed1d54c2b0a458e967f21cca Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
| * Add support for render rotation and flagsTobias Koenig2019-11-251-1/+1
| | | | | | | | | | | | | | | | | | Extend the QPdfDocument::render() method with a parameter of new type QPdfDocumentRenderOptions to specify the rotation and additional render flags. Change-Id: I354acc7fad4d094a96cefcea4dfa3513f4955c47 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>