summaryrefslogtreecommitdiffstats
path: root/src/pdf
Commit message (Collapse)AuthorAgeFilesLines
* Add QtPdf iOS build cmake changesMichal Klocek2022-02-071-1/+2
| | | | | | | | | | | Keeps cmake files in sync across branches, iOS build is not supported since ios changes are not backported from 94-based to 90-based. Task-number: QTBUG-88614 Change-Id: I7775c8b4d1554df497eb61fa6187f12c00b9032d (cherry picked from commit 8998563677e3f308083ba1c4c28efd6fe3d850f7) Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Introduce gn complete static lib target for qtpdfMichal Klocek2022-02-072-2/+5
| | | | | | | | | | | | | | | | | | | | | | | With 6.x we have gn-cmake integration which allows now in case of static builds to switch gn target output to static_library with 'complete static' option instead of shared_library. This way we can avoid installing dependencies in form of internal static Chromium archives as it was done in 5.15 in case of static builds. Unfortunately 'complete static' option can not be used with QtWebEngineCore build as it will exceed 4Gb static archive limitation on Windows, however it will work fine with QtPdf. Note the qtbase 3rdparty static libs have to be still installed in case of qt static build, this patch only eliminates need for Chromium specific ones. Task-number: QTBUG-88614 Change-Id: I6fc4ce48c79a1631b013d0b29c190c62280f7304 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> (cherry picked from commit 8e549e6e0ccd6078b3bd2e38b87337fd367dec55) Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Doc: Fix find_package() call for Qt PDFKai Köhne2022-01-171-2/+2
| | | | | | | Change-Id: Id19aa463db605c861a1bd3502eb964c8f9340e4d Reviewed-by: Michal Klocek <michal.klocek@qt.io> (cherry picked from commit 4f592dbbb1069ef03595e083e34ee6cdbf7c0fec) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove the rest of qmake based configurationMichal Klocek2021-10-1510-487/+0
| | | | | | | | | | | The only not cover part in cmake port are: * ios builds for qtpdf * qt static dependecies for qpdf Change-Id: Iefe624c35d847b4a9c3cd970192487340b1657f9 Reviewed-by: Michael Brüning <michael.bruning@qt.io> (cherry picked from commit d155f3da5d6e8ad08fab040d8f748d3bbdb69039) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix "We mean it." warningsPeter Varga2021-09-271-0/+11
| | | | | | | Change-Id: I70a491617faff31901162cb382b388a7594816fa Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 8cce9081f6bf670c97a674a0eaa18e6b6a354f73) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Support more module flags for 'configure' scriptKirill Burtsev2021-09-141-0/+1
| | | | | | | | | | | | Support flags passed to main 'configure' and separate 'qt-configure-module' scripts with flags like '-no-build-qtpdf', '-webengine-full-debug-info', '-no-webengine-jumbo-build', etc. Fixes: QTBUG-95717 Change-Id: Ia12602e9a9b31f4f2256f983f6c1e3fbe50cb9e3 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Michal Klocek <michal.klocek@qt.io> (cherry picked from commit 518d4f10dadf0dcf812a6b949c8febdb0bb93a58)
* Use generator expression to get moc pathMichal Klocek2021-09-011-5/+1
| | | | | | | | | | | | | | | | | | | We used IMPORTED_LOCATION for getting moc path, however this will not work in case of top level builds, since moc is not "imported", we can not use LOCATION due to https://cmake.org/cmake/help/latest/policy/CMP0026.html Use generator expression to set the moc path for gn. Clean up RSP_PREFIX leftover from previous gn version. Note QtPdf does not even need moc setup since we just need pdfium library. Task-number: QTBUG-95590 Change-Id: Ief3dca96f65e198e9693293316b1a90007c56355 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 53e99bd479f74c5399664d26e35e392875da8fb5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Rewrite gn-cmake integrationMichal Klocek2021-08-302-125/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous gn-cmake integration was driven towards having the complete cmake build tree which included gn build artifacts. These were marked as IMPORTED in cmake build files, this way cmake "knew" all object files and static libs coming from gn. To achieve that we needed to run the cmake configure twice. First to feed gn with the build information from cmake and then the second run to import all the build information to cmake based on gn run. As a side effect of this the first run cmake was creating incomplete targets, so we could use generator expressions to gather all the data needed for gn run. The second run of cmake was able to create fully initialized targets. We used 'external project' to run cmake the second time. This approach worked well when doing "module" builds and having two targets, one in the main project and one in external was not an issue. Moreover, this approach could be integrated nicely since CI does only "module" builds. Unfortunately "top level" builds are implemented to import all qt targets into one build tree. This created issue for qtwebengine since fully initialized targets were 'hidden' by 'external project' and including half baked (dummy) targets from the main project resulted in bunch of issues related to the dependency tracking and build race conditions. Also using 'external project' complicated installation rules and in the end installation worked differently than in other modules. With current approach we use response files, so we hide all build artifacts coming from gn and feed cmake with those response files. This way we run the cmake configure once and we create all the targets once. Using rsp files hacks linker options in cmake, so this approach is sub-optimal, however allows to have working "top level" builds. It is worth mentioning here that the final module linking has to take place with cmake's part of build since doing one static lib in gn is not possible due to the toolchain limitation (msvc is not able to process static libs over 4Gb and has no support for thin archives, so only a shared lib is doable at time of writing) Following changes are made: * remove 'external project' for qtwebengine target, we keep it however for ninja ,gn and a host project * call gn from cmake in a scripting mode during build and not configure run, this way BUILD.gn is assembled as a build step so after generator expressions are executed * BUILD.gn is assembled now from 4 files: - root template BUILD.root.gn.in - compiler data gn_config_c.cmake, gn_config_cxx.cmake - sources data gn_cofnig_target.cmake * since we use gn wrapper script use gn.args file to pass arguments instead of a command line, so this file can be now easily modified when running gn and ninja 'manually' * since a script mode does not support handling of properties with TARGET as such, use the DIRECTORY scope in some of our functions which handle GN_TARGET * use qt_build_repo() in main CMakeFile and remove all coin and top level build hacks * remove 'external project' for examples and tests, this is no longer required as all qt targets are not hidden by external project * remove leftovers from gn feedback call used for GN_TARGET * improve installation rules, WebEgineCore target is not by default installed during build, therefore we need to copy resources and translations to root so tests and examples still can be built without a module being installed first * adjust GN lookup paths, we look for gn in main configure and during scripting mode when gn is executed Fixes: QTBUG-94349 Fixes: QTBUG-94709 Fixes: QTBUG-94922 Fixes: QTBUG-94997 Fixes: QTBUG-95051 Fixes: QTBUG-95152 Fixes: QTBUG-95158 Fixes: QTBUG-95972 Task-number: QTBUG-95231 Task-number: QTBUG-95590 Change-Id: I5e7a34287ee59d904103fe310fc7c6a36a8dfbc9 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit bd75c51f2a7f7384d3303e86764211cb3e32f03d)
* Use rsp files directly from gnMichal Klocek2021-08-302-3/+5
| | | | | | | | | | | | | | | | | | | Do not use gn created cmake files since this requires cmake configuration step, which currently ends up in duplicated targets in main and qtwebengine external project. Use response files instead, so we can remove duplicated targets in follow up patches. This approach unfortunately has downside of cmake not being aware of gn build artifacts and hacks directly linker command. For universal builds remove not needed rsp template, since we can now use rsp files directly generated by gn. Task-number: QTBUG-95590 Change-Id: I83282ba68fa171cada7236d0587be27122315dec Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 96e47e1c9b6ce5c71e2560bb95f6e59ce062c8ba) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add QtPdf to cmake buildMichal Klocek2021-08-1848-3582/+544
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Task-number: QTBUG-95353 Change-Id: I4dd9f3934bdd478fb6d2fa686074a24d91f09953 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 79d04aa9e3e9aa84d7378260519f9e9a6759dc41) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove outdated QT_VERSION_CHECKsAllan Sandfeld Jensen2021-07-091-115/+0
| | | | | | | Change-Id: I4c4b78af0bd7da5912b5e0136f9cfdb3c4268a7e Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io> (cherry picked from commit e62dde53f093dd2c404a65cf99e854081396632b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Merge remote-tracking branch 'origin/5.15' into devAllan Sandfeld Jensen2021-04-133-7/+16
|\ | | | | | | Change-Id: Ia01415e5a44b1df9ed8b3966ff3b39a414b1563c
| * Fix prl files on iosMichal Klocek2021-04-061-4/+4
| | | | | | | | | | | | | | | | | | | | | | Since 42b5da qtbase supports an installation of 3rdpaty in case of static builds. Depend on 'public' qtbase 3rdparty installed libs. This fixes prl generation by not including build paths. Task-number: QTBUG-91385 Change-Id: Ib0609b2b92d6759aad639154617b45fc2fe96916 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| * Fix qtpdf static builds on windowsMichal Klocek2021-04-061-1/+10
| | | | | | | | | | | | | | | | | | | | | | Use correct qt zlib lib in case of windows. Passing qtzlib is actually just done in shake of clarity and proper dependency tracking since qtCore is most likely always a dependency for any user app. Fixes: QTBUG-91476 Change-Id: I20816ebf926472c642847e2611797a6decdeecee Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
| * 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>
* | Merge remote-tracking branch 'origin/5.15' into devAllan Sandfeld Jensen2021-03-161-0/+2
|\| | | | | | | Change-Id: I0dd7c64669f4b130047a4a3836f62f7ee5b5f8d9
| * Remove QtPdf dependency on nss at build-timeAllan Sandfeld Jensen2021-02-171-0/+2
| | | | | | | | | | Change-Id: I653dee03adcad422d1210fda48bdd5b701382b00 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devAllan Sandfeld Jensen2021-01-251-1/+1
|\| | | | | | | | | | | Including update to 87-based Change-Id: I36b6054e00de97ab055d0bc800cff08d0408fac6
| * Adaptations for Chromium 87Allan Sandfeld Jensen2021-01-131-1/+1
| | | | | | | | | | Change-Id: Ic4ffd98e02f986dbaf986405360e727c813e696e Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* | Merge remote-tracking branch 'origin/5.15' into devAllan Sandfeld Jensen2020-12-114-1/+38
|\| | | | | | | Change-Id: Id1a1f4ca84697ba18e2604090e3154295fe1858b
| * Fix building against 5.12 on most CIsAllan Sandfeld Jensen2020-12-082-1/+2
| | | | | | | | | | Change-Id: I4c4bbc75b9f6346a446f8094f669d142f76c164a Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
| * Add QtZlib as static dependencyMichal Klocek2020-12-082-0/+10
| | | | | | | | | | | | | | | | | | | | | | QtZlib is a semi private module, headers are installed as Qt5Zlib, however all object are in QtCore. Add support to compile against Qt5Zlib when doing static build. Task-number: QTBUG-87154 Change-Id: I74d1b217725b37781808a54902f9acbee41c50c4 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| * Add qt static deps when doing static buildMichal Klocek2020-12-082-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add qtfreetype, qthurfbuzz, qtlibpng, qtlibpng static 3rdparty libs. If qtbase has some 3rdaprty libs, which are also present in chromium. This leads to duplicated symbols and can lead to unexpected issues with application. Currently we do only static builds for qtpdf, therefore this changes only affects qtpdf builds. If qtfreetype is used, hurfbuzz dependency is not used, qtlibpng is only used when pdf compiled with xfa. Task-number: QTBUG-87154 Change-Id: Ibba528268d9c989a2c63c1a7881ba0c95c325437 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@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>
* | Update dependencies on 'dev' in qt/qtwebengineAllan Sandfeld Jensen2020-11-022-9/+4
| | | | | | | | | | Change-Id: I74c7293ebf5ace5bd07e3bf5455dd90bf4ed6380 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* | Fix memory management in QPdfDocument functionsNicolas Deherly2020-09-281-5/+26
| | | | | | | | | | | | | | | | All pages that are opened have to be closed, in order to avoid a memory leak. Pick-to: 5.15 Change-Id: I15c12b2f1b389638d5fe0a58599d9c410a033652 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Update dependencies on 'dev' in qt/qtwebengineAllan Sandfeld Jensen2020-09-231-3/+0
| | | | | | | | | | | | | | | | Work-around a QtNetwork bug, and QList::resize(0), doing some weird illegal stuff. Change-Id: I1eb178b121b9dcdd0a9f6d71d121956ddb5eb2a3 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* | Remove usage of QObjectPrivate from pdf apisMichal Klocek2020-09-024-109/+67
| | | | | | | | | | | | | | | | | | QtPdf is still in tech preview, remove QObjectPrivate dependency from api. Change-Id: I83ad2e8ef62d5b701f1e9fa2221b27e76984ca4e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Update dependencies on 'dev' in qtwebengineAllan Sandfeld Jensen2020-08-181-1/+1
| | | | | | | | | | | | | | | | | | Temporarily disable qttools and qtwebchannel dependencies as qtquickcontrols2 is 3 commits ahead in its qtdeclarative dependency. Change-Id: Ic2a1b472300e1fa1545f5d553e4b909c07c88ba9 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* | Fix almost all deprecation warningsJüri Valdmann2020-08-134-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace QString::fromUtf16({const ushort * -> const char16_t}) QMap::{unite -> insert} Q{Hover,DragEnter,DragMove,Drop}Event::{posF() -> position()} Q{Hover,DragEnter,DragMove,Drop}Event::{pos() -> position().toPoint()} Q{DragEnter,Drop}Event::{mouseButtons -> buttons} Q{DragEnter,Drop}Event::{keyboardModifiers -> modifiers} QMouseEvent::{localPos -> position} QMouseEvent::{windowPos -> scenePosition} QMouseEvent::{screenPos -> globalPosition} These should all be just renames without any change in behavior (save for some floating point conversions). The one remaining issue concerns the deprecation of binary JSON in qtbase, which is recommended to be replaced with CBOR. Change-Id: I8f3b533242fe9a58c08c2b09ff5d0bdbbfa6dd17 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devMichael Brüning2020-07-245-32/+47
|\| | | | | | | | | | | | | | | | | Conflicts: src/core/compositor/delegated_frame_node.cpp src/core/core_chromium.pri src/core/render_widget_host_view_qt.cpp Change-Id: I9387151e9647c87fc387095e7b6d8d66560cdf71
| * Share linking config between webenginecore and pdfMichal Klocek2020-07-231-28/+1
| | | | | | | | | | Change-Id: Ib06a0a1ec3372d483008cc0ac0ec211ec8316e0e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| * Fix prl generation in sub modules of webengine repoMichal Klocek2020-07-234-13/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Fix platform support for qtpdf on iosMichal Klocek2020-07-211-1/+0
| | | | | | | | | | | | | | | | Add missing check for ios. Change-Id: I7fce6addb154ea83b8308094d5a6c4275d050d9b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| * Fix incorrect paths in prl files when doing a static buildMichal Klocek2020-07-211-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During chromium build we get some static libs, these are dependencies to QtPdf static lib. Generated prl files will contain paths to those libs. Unfortunately, these are the internal paths to the libs within the build directory. There are two solutions, merging all dependencies into final lib or simply installing static dependencies. Since doing a merge of static libs would require platform specific code and on mac requires special libtool (we use ar by default) and lipo hassle to get fat archives, we rather simply install those libs. This way seems to be a common pattern for static builds. Fixes: QTBUG-85616 Change-Id: I0cb1a0ae1ad3b8fa8af562951af4de1e9c7a8ba8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Use QList instead of QVectorJarek Kobus2020-07-1520-50/+50
| | | | | | | | | | | | 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-06-295-10/+125
|\| | | | | | | | | | | | | Conflicts: src/src.pro Change-Id: I03c260ba676296f93d8137e79b46f3978f5f41ef
| * Add some info when project is misconfiguredMichal Klocek2020-06-121-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We support calling make on not configured properly qtwebengine and qtpdf. This avoids issues when there is no make file for top level build and user does not understand why. To do that we 'share' error messages between configure and make calls. However to avoid duplicating tests and error messages 'configure test conditions' have to match 'error messages' in support.pri. In case we miss some error message just ask for reporting the bug, instead of still trying to build the thing. Change-Id: I23320afa5174b5f33871c8cd8739ceea8e3a169d Reviewed-by: Michael Brüning <michael.bruning@qt.io>
| * Split errorChecks for webengine and pdfMichal Klocek2020-06-031-6/+15
| | | | | | | | | | | | | | Separate error checks, so qtpdf can have own dependencies. Change-Id: I9e538b875fe67448497f10dcd45c83782d98da2d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| * Add static linking for qpdf for all platformsMichal Klocek2020-05-291-1/+1
| | | | | | | | | | Change-Id: Ie222d56c52f5ca474809b2bc864618e5b3e9a1f2 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| * Split gn args for pdf and webengineMichal Klocek2020-05-283-3/+105
| | | | | | | | | | | | | | | | | | Currently we run gn with same sets of arguments for pdf and webengine. Split those so we can make fine grain configuration and drop some requirements. Change-Id: I40890b5475dddadd0798ea091ca5e7143fd952b3 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Add ; to Q_UNUSEDLars Schmertmann2020-06-272-2/+2
| | | | | | | | | | | | | | | | This is required to remove the ; from the macro with Qt 6. Task-number: QTBUG-82978 Change-Id: Id948c173695923a1ea83a2098bafc10cfd4dc22b Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Add compatibility for Qt 6's QRecursiveMutex classThiago Macieira2020-05-201-1/+7
| | | | | | | | | | Change-Id: I95cbf65aab73453688b6fffd160e1091d7713d85 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devAllan Sandfeld Jensen2020-05-1522-130/+958
|\| | | | | | | | | | | | | 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>
| * QPdfDocument::getSelection(): fix off-by-one character selectionShawn Rutledge2020-04-301-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When mouse-dragging to select text, the selection always contained one more character than the geometry (set of polygons) was showing. Conversely, it was not actually possible to select a single character: you'd always get at least two, even though only one looked like it was selected. Applied a similar fix as the one in hitTest() (in 8d13facbd88d821cc89b21f43708cc1a81ac79f3): check the bounding box of the last character, and if the given end position (where the mouse is being dragged to) is closer to the right edge than to the left, increment the ending character index, to point to the character after (which is probably an invisible newline or other terminator). This fix might not be so great if the text doesn't run left-to-right, but it works for Western text in normal orientation at least. Fixes: QTBUG-83685 Change-Id: I099424cd334fa38986445c134c82580a0307c2fe 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-307-53/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>