summaryrefslogtreecommitdiffstats
path: root/src/printsupport
Commit message (Collapse)AuthorAgeFilesLines
* Add nullptr checkOliver Eftevaag2021-03-161-1/+2
| | | | | | | | | Adding a nullptr check before dereferencing in case q is null. Change-Id: Ia440e2ed41cbaf06a5919930c2e1615bb3916ff3 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 57f752b30a0f452e9cc079b5a4ede6134719a769) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Use explicit linkage with target_link_librariesKai Koehne2020-12-011-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 Change-Id: I12b80ee85be9f6916f1e4dea6b1c9cb29e03c20f Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 130b2090147e0d28e35fd736fbefcd588c0014f6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QWin32PrintEngine: fix compilationAlex Trotsenko2020-11-211-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' Change-Id: I8eb0e3c5b72f8542cd3bd11514b12d308481f250 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 27e08b0c40b73edc5354f9ad3cf7e5e660243553) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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>
* Fix some MSVC int conversion warningsFriedemann Kleint2020-07-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | kernel\qmetaobjectbuilder.cpp(1279): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data kernel\qmetaobjectbuilder.cpp(1432): warning C4267: '+=': conversion from 'size_t' to 'int', possible loss of data sax\qxml.cpp(1275): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data text\qfontsubset.cpp(920): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data text\qfontsubset.cpp(920): warning C4267: 'initializing': conversion from 'size_t' to 'const int', possible loss of data text\qtextengine.cpp(2664): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data text\qtextengine.cpp(2665): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data text\qtextengine.cpp(2706): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data text\qtextengine.cpp(2707): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data itemviews\qbsptree.cpp(60): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) kernel\qprintengine_win.cpp(1558): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data qsql_odbc.cpp(804): warning C4267: 'argument': conversion from 'size_t' to 'SQLINTEGER', possible loss of data qsql_odbc.cpp(822): warning C4267: 'argument': conversion from 'size_t' to 'SQLINTEGER', possible loss of data qsql_odbc.cpp(1585): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data qsql_odbc.cpp(1602): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data qwindowsmime.cpp(770): warning C4267: '+=': conversion from 'size_t' to 'int', possible loss of data windows\qwindowsmime.cpp(770): warning C4267: '+=': conversion from 'size_t' to 'int', possible loss of data Change-Id: I04fbe17b9782f4c2704933fc005449b1e992475e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Automatically register comparison operators in QMetaTypeFabian Kosmale2020-07-081-3/+0
| | | | | | | | | | | | | | | | | This removes the fully manual registration of comparison operators in QMetaType and replaces it with an automatic registration through Q_DECLARE_METATYPE(). [ChangeLog][QMetaType] The QMetaType::registerComparator() and QMetaType::registerEqualsComparator() have been removed. Q_DECLARE_METATYPE() now automatically registers any operator==() and/or operator<() for a type visible where it is used on that type, as part of declaring its meta-type. Change-Id: I3df451b652b735c093533838bf32f3cc785439f8 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Add ; to Q_UNUSEDLars Schmertmann2020-07-074-15/+15
| | | | | | | | This is required to remove the ; from the macro with Qt 6. Task-number: QTBUG-82978 Change-Id: I3f0b6717956ca8fa486bed9817b89dfa19f5e0e1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Use QList instead of QVector in printsupportJarek Kobus2020-07-068-32/+31
| | | | | | Task-number: QTBUG-84469 Change-Id: I540b5574e358b100a595eb1676b051dfe25cb640 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* CMake: Regenerate rest of projects under src/Alexandru Croitor2020-07-031-13/+13
| | | | | Change-Id: I7d7692306a80deb9e8d2a90454dad4b39320f380 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* macOS: Remove PPD deprecation warningTor Arne Vestbø2020-07-011-4/+1
| | | | | | | We're not going to replace these any time soon, so remove the warning. Change-Id: If020d2d3cf752e9a11558a55df5d05e2d2b3c567 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Doc: Update docs with cmake package informationNico Vertriest2020-06-301-0/+1
| | | | | | Task-number: QTBUG-85179 Change-Id: I70dda9b906ecd0b8d8f4d88b0562af8e6c428143 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Remove winrtOliver Wolff2020-06-065-13/+4
| | | | | | | | | Macros and the await helper function from qfunctions_winrt(_p).h are needed in other Qt modules which use UWP APIs on desktop windows. Task-number: QTBUG-84434 Change-Id: Ice09c11436ad151c17bdccd2c7defadd08c13925 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Build print support plugin directly into QtPrintSupportTor Arne Vestbø2020-06-044-1/+34
| | | | | | Task-number: QTBUG-83259 Change-Id: I74f60519fbccfa5f208397bf3d65f0a4f64cb6f0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Move macOS print support from platform plugin into QtPrintSupportTor Arne Vestbø2020-06-0413-14/+3440
| | | | | | Task-number: QTBUG-83256 Change-Id: I29044b6c3f952c259f501f94a175c8ef2cbaae55 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Document how to use CMake for Qt PrintSupportKai Koehne2020-05-267-73/+21
| | | | | | | | | | Move the details on how to build after the index page. Remove mentioning of the central include. Instead, mention the CMake functions to use. Task-number: QTBUG-73058 Change-Id: Ibf5952530c3b86915c9fb6562f7d9e0b010720ee Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Licenses: Remove reference to change in Qt 5.4Kai Koehne2020-05-221-3/+2
| | | | | | | Qt 5.4 is not documented anymore since quite some time. Change-Id: I6811ead502178f7acbed8cf450e42d7fd33ae29b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* CMake: Generate information about 3rdparty libs in module .pri filesJoerg Bornemann2020-05-191-1/+1
| | | | | | | | | | | | | For modules that are not yet ported to CMake and that use QMAKE_USE += libfoo we need to provide the information about libfoo in the qt_lib_XXX.pri files. Also, we now generate qt_ext_XXX.pri files for bundled 3rdparty libs. Task-number: QTBUG-75666 Change-Id: I9e4b057a197554ecb37c294c0bf09e2a2b3aa053 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Get rid of QTextCodec in the cups supportLars Knoll2020-05-142-12/+18
| | | | | | | | This should all be utf-8 anyway, but right now simply exchange the text codec with a string converter. Change-Id: If0a230776824598b6378bb402d692c941e371104 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Support multiple page ranges in QPrinterSzabolcs David2020-04-093-96/+28
| | | | | | | | | | | | | | | | Add a new QRangeCollection type to store and manage multiple page ranges. This moves out the parser and validator logic from the platform dependent (UNIX) dialog and makes it publicly available from QPrinter. This improves the usability of QPrinter in those applications which doesn't use print dialog to configure printer. (e.g.: QTextDocument, QWebEnginePage) Change-Id: I0be5a8a64781c411f83b96a24f216605a84958e5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Remove QGuiAction again and split QAction implementation up insteadVolker Hilsheimer2020-03-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | Duplicating the number of classes is a high price to pay to be able to have some QAction functionality behave differently, or be only available in widgets applications. Instead, declare the entire API in QtGui in QAction* classes, and delegate the implementation of QtWidgets specific functionality to the private. The creation of the private is then delegated to the Q(Gui)ApplicationPrivate instance through a virtual factory function. Change some public APIs that are primarily useful for specialized tools such as Designer to operate on QObject* rather than QWidget*. APIs that depend on QtWidgets types have been turned into inline template functions, so that they are instantiated only at the caller side, where we can expect the respective types to be fully defined. This way, we only need to forward declare a few classes in the header, and don't need to generate any additional code for e.g. language bindings. Change-Id: Id0b27f9187652ec531a2e8b1b9837e82dc81625c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove QRegExp usage from Qt PrintSupportLars Knoll2020-03-171-3/+10
| | | | | Change-Id: I32daae8e5028084dd12f0aba4da7920f995d919f Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
* cmake: Remove APPLE prefix from platform namesTor Arne Vestbø2020-03-162-2/+2
| | | | | | | None of the other platforms have it. Change-Id: Ib448c2c03ba03f711b507ef391977c0e6aa7c192 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Fix naming when referring to Apple macOSTor Arne Vestbø2020-03-161-1/+1
| | | | | Change-Id: Iafb5e448d0d65d42f788464fc600594a5666f9af Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>