summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Fix use-after-free in CustomURLLoaderJüri Valdmann2020-02-261-13/+14
| | | | | Change-Id: I06e6622cc0e59674be975f43b82fafa2e7a05edd Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
* Fix changing profile settings with network serviceJüri Valdmann2020-02-264-20/+37
| | | | | | | Fixes: QTBUG-81558 Change-Id: I6f6d1b927d0f20d99477dce21697d4a03f61c059 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Merge remote-tracking branch 'origin/wip/qtpdf' into 5.15v5.15.0-beta1Shawn Rutledge2020-02-2142-159/+3859
|\ | | | | | | | | | | | | | | 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
| * 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-192-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-192-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Fix operators and includes in QPdfDestinationShawn Rutledge2020-02-172-12/+20
| | | | | | | | | | | | | | Amends 09a6eac4a63b32548ecc1ff5b16a5d8fc3ba1c04. Change-Id: Id321d016a758d4f58d82a32575d034df226e083e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * Use a timer to update PdfSearchModel in the backgroundShawn Rutledge2020-02-173-0/+21
| | | | | | | | | | Change-Id: I855150578c9127b175c5907500d057b704fe5e0e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * PdfSearchModel: be QALM and find search results on all pagesShawn Rutledge2020-02-1714-155/+729
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-119-52/+446
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * QPdfDocumentPrivate::load(): check the first two pagesShawn Rutledge2020-02-031-2/+3
| | | | | | | | | | | | | | | | | | | | This seems to make QPdfLinkModel happy for some reason; otherwise QPdfLinkModelPrivate::update() does not succeed in getting page numbers when it calls FPDFDest_GetDestPageIndex(). Amends 9231d3444555945297857ee4aae05919083ea479 Change-Id: Iaed3301a1ab304ac9813c3b605b2f9c7465bf8e7 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * QPdfDocument::pageSize(): add checkPageComplete()Shawn Rutledge2020-02-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | checkPageComplete() calls FPDFAvail_IsPageAvail(), which does some initialization that is necessary before PDFium is able to provide any information about that page. The static readImage() function in qquickpixmapcache.cpp calls QImageReader::size() before rendering, to determine the size of the image that will be read, and that ends up calling QPdfDocument::pageSize(); so it's important to "go to" that page before attempting to read its size. In summary, checkPageComplete() is the "go to page" function that must be called before any other page-specific function. Amends 9231d3444555945297857ee4aae05919083ea479 Change-Id: Idf5ba9d013b62395c284d055fbfe835fe949df79 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * doc: add QPdfDocumentRenderOptions::scaledClipRect and scaledSizeShawn Rutledge2020-02-031-0/+34
| | | | | | | | | | | | | | Amends 4f5f0705bc161ff95899fdb2c5fcdb4581bf15bb. Change-Id: I62563f5be367e8139dc4cdf12866c65f55a576b5 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * Doc: Add information about building the module with CMakeLeena Miettinen2020-02-033-2/+10
| | | | | | | | | | | | | | | | Task-number: QTBUG-81560 Change-Id: I9d75606634da4c604f34913908f97a91797d1813 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * Add PdfLinkModelShawn Rutledge2020-01-3011-0/+702
| | | | | | | | | | | | | | | | | | | | | | | | 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-3012-0/+758
| | | | | | | | | | | | | | | | 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>
| * QPdfDocument and QPdfIOHandler: add scale and clip featuresShawn Rutledge2020-01-303-5/+51
| | | | | | | | | | | | | | | | Like some other image plugins, the PDF plugin now supports ImageOption::ScaledClipRect and ScaledSize. Change-Id: Ie7278752e49c885cc4580f30af1ec5e6310f8334 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>
| * Doc: Add dependency to the Qt Quick module to fix QDoc warningsLeena Miettinen2020-01-281-1/+2
| | | | | | | | | | Change-Id: Ia56a07bc2d53bd4a2166566a9c95126a5d2f9154 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
| * Doc: Add docs for the Qt PDF Viewer exampleLeena Miettinen2020-01-283-1/+45
| | | | | | | | | | | | Task-number: QTBUG-81560 Change-Id: I159747a097a6a6a28c2355e8ff6b6c59a4f3a29a Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * QPdfDocument: check first page in load(), current page in render()Shawn Rutledge2020-01-272-2/+48
| | | | | | | | | | | | | | | | | | | | | | | | When a viewer application is opened with a book-sized PDF, there's no need to check hundreds of pages before we can render the first page. Using it in QPdfIOHandler is even worse because this check needs to be repeated each time we advance from one page to the next. But we do need to ensure that the page we want to render is available. Amends 945840bd067d9ca3179a667f48b451cc2087931b Change-Id: Ib6576b1b91c63c2b57893d14b05632eff8cc4a15 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* | Fix not working proxy_pac test with network serviceMichal Klocek2020-02-211-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | Due to sandboxing we can no longer pass pac file. Pass it as data url instead by reading the pac file and encoding into base64. Fix failing proxypac url on windows. Fixes: QTBUG-81557 Change-Id: I3dc3da4fbd3cce4e903c75022b8e9fe5faf71604 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Fix CustomURLLoader not supporting responses over 64k bytesJüri Valdmann2020-02-211-33/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | Mojo data pipes are non-blocking, meaning we have to wait until there's room in a buffer before we can transfer data from the QIODevice to the pipe. Use mojo::SimpleWatcher to monitor the pipe for readiness and use the two-phase BeginWriteData/EndWriteData API to let the QIODevice write directly into the pipe's internal buffer, avoiding a copy. Fixes: QTBUG-82244 Change-Id: I65e69ce72d0e99bc047c57b5a22531c0891c553a Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* | Do not build webengine on iosMichal Klocek2020-02-211-1/+2
| | | | | | | | | | Change-Id: I21391ef9f5ea9c93227c1a8a64bcd1e5a5e20ad4 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Allan Sandfeld Jensen2020-02-196-9/+102
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | Blacklisted one test requiring an update of qt5.git. Conflicts: .qmake.conf Change-Id: I75e55a1c5f8840cde55ddb60d632287b2affadeb
| * | Fix quick accessibility on macOSPeter Varga2020-02-174-8/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Same as the widget fix: ffdf7ece Fix widget accessibility on macOS This patch depends on a focusChild() fix in qtdeclarative: 6420ad91d3 Fix QAccessibleQuickWindow::focusChild() to return focused descendant Task-number: QTBUG-78284 Task-number: QTBUG-81539 Change-Id: If0da937d2c778a158ce02e1433b28ca0888692d8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| * | Fix name filters of GTK file pickerSzabolcs David2020-02-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Setting an empty string instead of "()" fixes that case where the file input doesn't have "accept" attribute. Task-number: QTBUG-82109 Change-Id: I8a72f819fa6d8bbab4e5f1067b38ad75ff11e118 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Michal Klocek <michal.klocek@qt.io>
| * | Emit title change event asynchronouslyKirill Burtsev2020-02-141-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ammends 445235bc01. Preserve some previous assumptions on order of change events for url and title. Fixes flaky failures in previously written tests like WebEngineViewSource::test_viewSource. Fixes: QTBUG-81855 Change-Id: I487d27d594d5a0d74d39b7b58e815e5c75a73fb3 Reviewed-by: Michal Klocek <michal.klocek@qt.io> Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* | | Move disabling of features we used to not support to non-viz onlyAllan Sandfeld Jensen2020-02-171-14/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | These features all failed to work with our old compositing implementation, but works with viz compositor, and due to being default in Chrome, might work more reliable being on, than off. Change-Id: Ifab1913fd4bc20f295dc7c2ccffa510610b23796 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* | | Fix missing webenginview in designer pluginMichal Klocek2020-02-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The feature name is 'webengine-widgets', but module name is 'webenginewidgets'. Fixes: QTBUG-82123 Change-Id: I501815dc74ca96527a888a708121c656447bf7a5 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | Fix typo in error reporting for winMichal Klocek2020-02-121-1/+1
| | | | | | | | | | | | | | | Change-Id: I5097aa17617738b4db8c0fe7717b32be2a0efd8f Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | Update ChromiumJüri Valdmann2020-02-121-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This pulls in the following changes: 458aa4294db Fix generation of attribution documentation a370b2f7a7e Don't force gpu process launch on macOS with vizdc and no GL 5b79320c013 Expose StoragePartitionImpl::InitNetworkContext Change-Id: I3f7c78fd4f1342a109ee6f8a2842ec2b60e1b83b Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | Add missing pdf dependency for image pluginv5.15.0-alpha1Michal Klocek2020-02-101-0/+1
| | | | | | | | | | | | | | | Change-Id: Iae77cc585257387b401e14b0958d18851ee1eb6b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Fix build log, qtpdf build clutters logMichal Klocek2020-02-101-0/+1
| | | | | | | | | | | | | | | | | | | | | Do pdf build after core. Change-Id: I1cb750d6f32cdbc7eb3ff377498391bc015faf94 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | Solve FIXME in CustomURLLoaderAllan Sandfeld Jensen2020-02-051-1/+3
| | | | | | | | | | | | | | | | | | | | | Update the headers as asked for in FollowRedirect. Change-Id: I86d241d52abe8bd9d082b7ad49e921a955dc1403 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* | | Merge "Merge remote-tracking branch 'origin/5.14' into 5.15"Jüri Valdmann2020-02-0410-24/+129
|\ \ \
| * | | Merge remote-tracking branch 'origin/5.14' into 5.15Jüri Valdmann2020-02-0310-24/+129
| |\| | | | | | | | | | | | | | Change-Id: I349a4ecbbd9d3d121ca6564db77e417872246554