summaryrefslogtreecommitdiffstats
path: root/src/printsupport
Commit message (Collapse)AuthorAgeFilesLines
* Remove unused .qrc filesJoerg Bornemann2022-01-171-38/+0
| | | | | | | | Task-number: QTBUG-94446 Change-Id: I136d8b4ab070a832866aa50b5701fc6bd863df8a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Doc: Use find_package(Qt6 REQUIRED COMPONENTS ...) idiomKai Köhne2021-12-091-1/+1
| | | | | | | | | | Using REQUIRED as a prefix instead of suffix works better with OPTIONAL_COMPONENTS, and is also the order in the CMake manual. Task-number: QTBUG-98867 Pick-to: 6.2 Change-Id: I1ab68408b95d8edf06272a3b9fceccd8d8e597fc Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Link printer plugins into user projects when using a static QtJoerg Bornemann2021-11-193-4/+6
| | | | | | | | | | | | When building a user project against a static Qt on Windows or macOS the static printer support plugins were not linked. Move the Q_IMPORT_PLUGIN statements to qplatformprintplugin.cpp, which is a translation unit that is guaranteed to be linked into the user project. Pick-to: 6.2 Fixes: QTBUG-97490 Change-Id: Ic35c6483a664a06461304c7e8a2b7b06ce651ed6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Doc: Enable qdoc warning count limitVenugopal Shivashankar2021-10-211-0/+3
| | | | | | | | This should restrict changes that introduce new warnings. Change-Id: I7e4b5d9d5d84b7c336509c380bc7e6d86e360f4a Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: Remove unsupported customFiltersKai Köhne2021-09-031-4/+0
| | | | | | | | | | | customFilters defined in .qdocconf are not supported anymore by Qt Assistant since Qt 5.13. Therefore remove them from all .qdocconf files, also to avoid cargo-culting them to new help modules. Task-number: QTBUG-95987 Change-Id: I664391460637d2e859348da0338e1a4a3ee9f570 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix printing with unhinted fontsEskil Abrahamsen Blomfeldt2021-08-161-2/+36
| | | | | | | | | | | | | | | | | | On high-dpi displays or when you explicitly select an unhinted font, we pick a DirectWrite font engine. This hit an uncovered code path on Windows, because we relied on being able to get the HFONT from the font engine. To fix this, we introduce an alternative code path which gets the HFONT based on the DirectWrite font when this font engine is active. [ChangeLog][Windows] Fixed an issue where the characters in printed text would look too small. Pick-to: 6.1 6.2 Fixes: QTBUG-95720 Change-Id: Ifd609e92512e1f25f0ee2aace35cb5ccedf09030 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* CMake: Use QtBase_SOURCE_DIR instead of QT_SOURCE_TREEJoerg Bornemann2021-07-121-1/+1
| | | | | | | | | | | | | ...where applicable to use a known CMake-provided variable in favor of our own cooked up one. This affects four plugins that are not supposed to be built out of tree, meaning QtBase_SOURCE_DIR is available (and identical to QT_SOURCE_TREE). Task-number: QTBUG-88090 Change-Id: I27f012e6c5fd99c3239a1dd65c0811c819dbcfe9 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Migrate to autogenerated cpp exportsAlexey Edelev2021-06-252-14/+2
| | | | | | | | | Replace the hardcoded cpp exports with a generated one where it's applicable. Task-number: QTBUG-90492 Change-Id: Idc160b594987b2c765e75bd669aae851b4366282 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove old configure-related filesJoerg Bornemann2021-06-181-102/+0
| | | | | | | | | | | | | Remove the configure.json and configure.pri files that were used for the qmake-based configure. Remove the .prev_*.cmake files that were a by-product of configurejson2cmake.py. Pick-to: 6.2 Task-number: QTBUG-89536 Change-Id: Ie827562f7fd2513d59f69234d77b8b93124ea78e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Windows: Read page size and orientation from setup dialogVolker Hilsheimer2021-06-161-3/+28
| | | | | | | | | | | | | | | | | | PAGESETUPDLG's hDevMode reports the page size and orientation selection of the user, so read that data to get accurate results. Otherwise, the page size of a landscape page wouldn't match any known page format, and we'd end up with a custom size that would not be valid for the preview, breaking the preview UI's orientation state. Reuse the helper from QPageSize to map Windows page size ID to our own enum. Fixes: QTBUG-93764 Pick-to: 6.2 6.1 5.15 Change-Id: Ib9a848619e3ba8780264ad76ed43c4fffae6b07f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Doc: Add disclaimer about QtPrintSupport not being available on iOSPaul Wicking2021-06-092-0/+3
| | | | | | | Fixes: QTBUG-91025 Pick-to: 6.1 6.2 Change-Id: I9f206509a3f3e74e01ae76ae36e275dc79743d11 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Use icon themes in QPrintPreviewDialog [if they exist]Albert Astals Cid2021-06-0515-31/+31
| | | | | | | | | | | I've renamed a few of the qrc icons to the names most common icon themes use for similar actions (the action themselves are not part of the icon naming spec https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html since it's not been updated in a while). Task-number: QTBUG-85879 Change-Id: I23bb300dbf4e953517516c97b8af118859aeb6fa Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Make sure _q_printerChanged is called even if only pdf printer is availableAlbert Astals Cid2021-05-211-0/+2
| | | | | | | | Otherwise things like the pagesRadioButton don't get properly disabled Change-Id: Idc0693b6747f13da5afb22e2187af310a5b454f8 Pick-to: 6.1 5.15 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Fix BASE argument of qt_add_resourcesJoerg Bornemann2021-05-181-33/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The BASE argument of qt_add_resources now denotes the root point of the alias of the file. Before, BASE was merely prepended to every file that got passed to qt_add_resources. Old behavior: qt_add_resources(app "images" PREFIX "/" BASE "../shared" FILES "images/button.png") Alias is "../shared/images/button.png", and pro2cmake generated QT_RESOURCE_ALIAS assignments to fix this. New behavior: qt_add_resources(app "images" PREFIX "/" BASE "../shared" FILES "../shared/images/button.png") The alias is "images/button.png". No extra QT_RESOURCE_ALIAS assignment is needed. The new behavior is in effect for user projects and for Qt repositories that define QT_USE_FIXED_QT_ADD_RESOURCE_BASE. Qt repositories will be ported one by one to this new behavior. Then the old code path can be removed. Pick-to: 6.1 Task-number: QTBUG-86726 Change-Id: Ib895edd4df8e97b54badadd9a1c34408beff131f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QPrintEngineMac: code tidiesGiuseppe D'Angelo2021-05-041-4/+4
| | | | | | | | | | | In preparation for a change (operator&(enum, flags) producing a QFlags, not an int), just go through operator&(flags, flags). This removes the need for a cast to the _enum_ type (although it requires a enum->flag conversion, which however makes perfect sense.) Change-Id: I159ee14d894c10365f53ca378bcb18bcf3f89dff Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Silence warning in QPrintDialogSzabolcs David2021-05-013-8/+8
| | | | | | | | | | | | | | | | Selecting "Print all" at page range options and accepting the dialog prints a warning message: "QPageRanges::addRange: 'from' and 'to' must be greater than 0" This happens because QPrintDialog tries to clear the printer's range collection by setting 'from' and 'to' to zero - which is an invalid page number. Avoid the validation method by setting QPageRanges directly to a clean instance. Pick-to: 6.1 Change-Id: I23b66a97b36aa23506904e93688cb60a9d496bfb Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add nullptr checkOliver Eftevaag2021-03-161-1/+2
| | | | | | | | Adding a nullptr check before dereferencing in case q is null. Pick-to: 6.0 6.1 Change-Id: Ia440e2ed41cbaf06a5919930c2e1615bb3916ff3 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Doc: Fix warnings about wrong snippet path or missing .pro fileNico Vertriest2021-02-192-1/+4
| | | | | | Task-number: QTBUG-91147 Change-Id: I6a55b2b713dd70cf1cbb0b93a8d4152e175e2c4d Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Fix mingw compiler warningsMårten Nordheim2021-02-111-1/+1
| | | | | | | | Mark overridden functions with override. Remove unused static function. Change-Id: I06bd52c66ac7b970dfced0e553eac9c4a4d44d79 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Remove the qmake project filesJoerg Bornemann2021-01-077-148/+0
| | | | | | | | | | | | | | | | Remove the qmake project files for most of Qt. Leave the qmake project files for examples, because we still test those in the CI to ensure qmake does not regress. Also leave the qmake project files for utils and other minor parts that lack CMake project files. Task-number: QTBUG-88742 Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Doc: Use explicit linkage with target_link_librariesKai Koehne2020-11-301-1/+1
| | | | | | | | | | | | | | The Professional CMake book suggests always using explicit linkage with target_link_libraries, so let's use that. Whether to use PUBLIC or PRIVATE depends on the context. But let's be conservative and advise on using PRIVATE by default. Task-number: QTBUG-88935 Pick-to: 6.0 Change-Id: I12b80ee85be9f6916f1e4dea6b1c9cb29e03c20f Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QWin32PrintEngine: fix compilationAlex Trotsenko2020-11-201-2/+0
| | | | | | | | | | | On MinGW32 it fails with error: .../src/corelib/global/global.h: 1186:34: error: unused variable 'q' ...qprintengine_win.cpp: 753:5: note: in expansion of macro 'Q_Q' Pick-to: 6.0 6.0.0 Change-Id: I8eb0e3c5b72f8542cd3bd11514b12d308481f250 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Update landing pages and module pages in qtbaseJerome Pasion2020-11-172-26/+30
| | | | | | | | | | -Qt SQL, Qt D-BUS, Qt GUI, Qt OpenGL, Qt Widgets, Qt Test, Qt Concurrent, Qt XML, Qt Network, Qt Core -language edits for consistency, add links Task-number: QTBUG-87155 Change-Id: Ic61350c9fa15090c802a42d8e9116219591eba73 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Adjust code format, add space after 'if'Zhang Sheng2020-11-161-2/+2
| | | | | | Change-Id: Ice081c891ff7f4b766f49dd4bd5cf18c30237acf Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: hjk <hjk@qt.io>
* remove unused variables and parameters to fix compilation with g++-10.2Andreas Buhr2020-11-131-2/+0
| | | | | | | | | | | The changes in 94dd2cebdcb9446626cd32a00086431eb11ab2a4, "Remove Qt4Compatible painting" left some unused variables and parameters. This leads to warnings which are treted as errors and thus inhibit a successful build with g++-10.2. This patch removes them and thus enables building with g++-10.2 again. Change-Id: I5f83aa8ec8706c3e783540f5116f455ea8fe44c2 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Remove Qt4Compatible paintingAllan Sandfeld Jensen2020-11-123-3/+3
| | | | | Change-Id: Ie54206ca9b509875568f2158e229fca9cb1860a2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Rename "Porting" pages to "Changes"Jerome Pasion2020-11-092-3/+3
| | | | | | | | | | | | | | The content in the porting guides are closer to a changelog than a porting guide. At this point, it is easier for maintainers and contributors to write in a changelog than a guide. This change should help with readability and is closer to the usage of "Changes" in documentation. Part of a rename in other submodules. Task-number: QTBUG-87156 Change-Id: Ib59de7976fae19e7b39962e80161df6628e4070b Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Rename QRangeCollection to QPageRanges, make it a proper value typeVolker Hilsheimer2020-11-083-29/+14
| | | | | | | | | | | | | | | | | | | | | | | The type is specific about printing, so give it a name in line with QPageLayout and QPageSize. As per API review comment, it's not clear why this type should not be a regular, copyable and movable value type. It stores a list of intervals. Give it value-type semantics, as an implicitly shared class. Convert the parse method into a static factory function. Add a Range type and use it instead of the semantic-free QPair. Move QPrinter getter into QPagedPainteDevice, make it return a copy rather than a pointer, and add a setter. Extend test case to cover all members and more merge cases. Fix bugs found that way. Fixes: QTBUG-88113 Change-Id: If17ea4d410d49f16b097e88b7979db5d72add820 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Initial porting guide for QtGui and QtPrintSupportVolker Hilsheimer2020-11-041-1/+7
| | | | | | | | | Additional porting documentation for QtWidgets. Task-number: QTBUG-88149 Task-number: QTBUG-88151 Change-Id: Ia28f01a8d8d6eaee9d8f08af1a54b76e57620cab Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Prefer versioned CMake library targetsv6.0.0-beta3Kai Koehne2020-11-011-1/+1
| | | | | | | | The non-versioned one's do miss some properties. It's therefore best to not advocate using them. Change-Id: I53645e65ed4de4e0100e59905c024cdfe40be0c5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Doc: Fix documentation warnings for Qt Print SupportTopi Reinio2020-10-302-2/+2
| | | | | | Task-number: QTBUG-86295 Change-Id: I8121f7c127896e57ec2e7636828af36bb83acfe3 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Move QPolygonClipper to XCB native paintingAllan Sandfeld Jensen2020-10-291-1/+0
| | | | | | | It is the only code using it. Change-Id: I30060a63b6621ea94ae487ec93cd857117e12a46 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QFontEngine: get rid of userData() trickeryKonstantin Ritt2020-10-281-16/+7
| | | | | | | | it is only used by QWin32PrintEngine and we know for sure QWindowsFontEngine::handle() returns HFONT Change-Id: I7656801e4642caf7df612d2f686061dca92707e0 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* QWindowsPrintDevice: Fix signedness warningsFriedemann Kleint2020-09-241-7/+6
| | | | | | | | Remove the warnings suppression. Task-number: QTBUG-83259 Change-Id: I3d8852ce8f62bac9b8f6ca4e13892164fb6d4059 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QWindowsPrintDevice: Brush up the codeFriedemann Kleint2020-09-241-19/+22
| | | | | | | | | | - Replace C-style casts, use helper wcharId() for the printer id - Replace typedef by using - Replace NULL by nullptr Task-number: QTBUG-83259 Change-Id: I066ff65bf7c1e894a6c6bb19cf0334c0b83fb759 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Windows: Build print support plugin directly into QtPrintSupportFriedemann Kleint2020-09-2414-25/+1078
| | | | | | Task-number: QTBUG-83259 Change-Id: I23042e1eb89d407692a96bfb2d6c4efdddbfb50f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-09-231-14/+14
| | | | | | | | | | | Modify special case locations to use the new API as well. Clean up some stale .prev files that are not needed anymore. Clean up some project files that are not used anymore. Task-number: QTBUG-86815 Change-Id: I9947da921f98686023c6bb053dfcc101851276b5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix some qdoc warnings: printer API cleanupVolker Hilsheimer2020-09-221-5/+5
| | | | | | | | | | | | Puge references from removed QPrinter methods. QPdfWriter's setter API documentation only added the word "PDF" to the QPagedPaintDevice documentation. This was not useful - when the latter talks about "page", it's obvious what is meant in the context of PDF, so remove the duplication. Change-Id: I7b16cbc82de8d35b5224288c9e36deff4e01fb44 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Correct link errors qtbaseNico Vertriest2020-09-211-1/+1
| | | | | | Task-number: QTBUG-86295 Change-Id: I27f6bbdadffb08a8794520a14dfe0e2334979575 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Add links to Qt 6 changes files from module indexPaul Wicking2020-09-181-0/+4
| | | | | | Task-number: QTBUG-84051 Change-Id: Iac25df135c9d73a990b41243e08cd38ea78296a4 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Doc: Add porting guide documentsPaul Wicking2020-09-161-0/+46
| | | | | | | | Also add existing such docs to the new document group Task-number: QTBUG-84051 Change-Id: I76f033f0846e09943f249d2beeb1606869eef382 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Remove obsolete APIs and comments from QAbstractPrintDialogVolker Hilsheimer2020-09-104-89/+26
| | | | | | | | | | | | | Merging QAbstractPrintDialog with QPrintDialog, as proposed in the removed comment, seems to have little value, given that the platform specific implementations rely on the current abstraction. Adjust examples and tests; with the QAbstractPrintDialog test now testing the QPrintDialog::options API, the corresponding test function can be removed from the QPrinter test. Change-Id: Ia8906627898332e8590ea9b27e3d71dfcc6e8d71 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Remove deprecated QPrinter and QPagedPaintDevice APIsVolker Hilsheimer2020-09-046-693/+16
| | | | | | | | | | | Adjusting the QPrinter test case - some use cases no longer exist, or are already tested in QPageSize and QPageLayout tests. Adjust examples and manual tests. Change-Id: I01cbc65f3d8031aea2dac86dd942126ba708b111 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Mark obsolete QPrinter functions as deprecated from 5.15 onVolker Hilsheimer2020-09-033-5/+39
| | | | | | | | | | | Some of the methods are overrides of virtuals in QPagedPaintDevice, so document and mark those as obsolete as well. Adjust code that calls those APIs to use the recommended replacement. Change-Id: I3cd1980609ea20808d17379a5f97ca595e869875 Pick-to: 5.15 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Qpagedpaintdevice: Use marginsF instead of internal struct marginsPeng Wenhao2020-09-012-3/+3
| | | | | | | resolve remaining Qt6 TODOs Change-Id: Iad659a09ddfe136bdc545bc0635b4c695540c58b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QPrinterInfo: Remove deprecated methodsMarcel Krems2020-08-252-50/+0
| | | | | Change-Id: I5089bc23308a4348dc21122dfa000d5ca6e3938d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move QFileSystemModel into QtGuiVolker Hilsheimer2020-08-251-1/+1
| | | | | | | | | | | | | | This requires a QAbstractFileIconProvider in QtGui, as the standard QFileIconProvider depends on QStyle, and cannot be moved out of QtWidgets. QAbstractFileIconProvider returns strings for file types, but returns no icons yet. Support for a default icon set might be added in a follow-up commit. Change-Id: Ib9d095cd612fdcf04db62f2e40709fcffe3dc2b7 Fixes: QTBUG-66177 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Drop spurious const from parameterEdward Welbourne2020-08-231-1/+1
| | | | | | | | Quanifying a parameter passed by value (which is correct for QTime, there is no need to pass it by reference) as const is pointless. Change-Id: I86850f65dfac28ffcc4a8633dd6d212259bb33d0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* CMake: Re-implement configure/qmake's command line handling in CMakeJoerg Bornemann2020-08-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | We extend configurejson2cmake to read the "commandline" information from configure.json. This data is then translated to CMake function calls and written it into commandline.cmake files. We extend QtProcessConfigureArgs.cmake to pick up those commandline.cmake files to feed our command line handling code, which is a re-implementation of the command line handling in qt_configure.prf. The command line handler sets INPUT_xxx variables, similar to configure/qmake's config.input.xxx variables. The INPUT_xxx values are translated - to -DFEATURE_xxx=ON/OFF arguments if the input represents a feature, - to corresponding CMake variables if such a variable is known, - or to -DINPUT_xxx=yyy CMake arguments. Configure arguments that have an entry in cmake/configure-cmake-mapping.md are actually implemented. Other arguments are likely to need more work. Task-number: QTBUG-85373 Change-Id: Ia96baa673fc1fb88e73ba05a1afb473aa074b37d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix build with mingw gcc 9 and -Wsuggest-overrideKai Koehne2020-08-101-15/+15
| | | | | Change-Id: I780b0761a7f6b19022116b738efa7aca1378b715 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>