summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpdfwriter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix some qdoc warnings: printer API cleanupVolker Hilsheimer2020-09-221-107/+0
| | | | | | | | | | | | 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>
* Fix deprecation documentation about margin and orientation in QPrinterÖmer Fadıl USTA2020-09-171-3/+3
| | | | | | | | There were a small typos about those methods and fixed with correct ones. Fixes: QTBUG-86635 Change-Id: Ib853e502fdcdafdf3ddf7ef6d25d368ebc2a631f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove deprecated QPrinter and QPagedPaintDevice APIsVolker Hilsheimer2020-09-041-49/+0
| | | | | | | | | | | 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>
* Qpagedpaintdevice: Use marginsF instead of internal struct marginsPeng Wenhao2020-09-011-2/+2
| | | | | | | resolve remaining Qt6 TODOs Change-Id: Iad659a09ddfe136bdc545bc0635b4c695540c58b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Doc: Fix punctation in QPdfWriter::addFileAttachmentKai Koehne2020-02-281-1/+1
| | | | | Change-Id: Ic00ffd88ecbaa88409bf968f6794fad6f53a2f0e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* New features for QPdfWriterJordi Pujol Foyo2019-12-191-0/+44
| | | | | | | | | | | | | Added new API setDocumentXmpMetadata/documentXmpMetadata and addFileAttachment [ChangeLog][QtGui][QPdfWriter] New API to provide external document XMP metadata and attach files to PDF. Fixes: QTBUG-78651 Fixes: QTBUG-78764 Change-Id: Ic0b37e8d12899f907001db469080594c14c87655 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Tidy nullptr usageAllan Sandfeld Jensen2019-12-061-1/+1
| | | | | | | | | | | Move away from using 0 as pointer literal. Done using clang-tidy. This is not complete as run-clang-tidy can't handle all of qtbase in one go. Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QPdfWriter: replace a QHash with a static_castMarc Mutz2019-07-121-7/+1
| | | | | | | | | | | The QHash was mapping equivalent values of different enums to each other. The enums have the same enumerators, though, so if we take care to keep the two in sync in the future, we can just static_cast them into each other via int. Change-Id: Ie67978604f8c3b9477419bc6029bbb869061e938 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QPdfWriter: mark obsolete functions as deprecatedChristian Ehrlicher2019-02-191-0/+10
| | | | | | | | | | | | Mark obsolete functions in QPdfWriter as deprecated so they can be removed with Qt6: - setPageSize(PageSize size) - setPageSizeMM(const QSizeF &size) - setMargins(const Margins &m) Change-Id: Iba88528742e67c09f5dc61aea69d27e26f484c16 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-10-251-1/+7
|\ | | | | | | | | | | | | | | | | Conflicts: src/corelib/animation/qpropertyanimation.cpp src/gui/image/qicon.cpp tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp Change-Id: I3698172b7b44ebb487cb38f50fd2c4a9f8a35b21
| * Extend PDF engine to allow the generation of PDFs with huge pagesAndre de la Rocha2018-10-221-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt's PDF engine previously supported only the PDF v1.4 standard, which only allows pages of up to 200x200in (about 5x5m). This patch optionally enables the generation of PDF v1.6-compliant files that allow the redefinition of user space units, so that pages of up to 381x381km are now possible. By default, generated files are compliant to v1.4 spec. v1.6 compliance must be enabled by, e.g., calling QPrinter::setPdfVersion() with QPrinter::PdfVersion_1_6. PDF v1.6-compliant files require Adobe Reader 7.0 or newer (also worked with the built-in viewers in current versions of Chrome, Firefox and Edge). Task-number: QTBUG-69386 Change-Id: I21708e0d465d5d7d9e46ff06dd04acfe1dfb0858 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | Remove excess "virtual" keyword from destructors in Qt GuiAlessandro Portale2018-09-251-1/+1
|/ | | | | | | | | | Destructors whose base class have a virtual destructor are automatically virtual and do not need to be marked as such. Change-Id: I84c73ab965077bbb03f4213e53c241569213cae0 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QPagedPainterDevicePrivate: Remove m_pageLayoutAlbert Astals Cid2018-02-161-23/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Having it there is awkward since all the subclasses of QPagedPaintDevice, that is QPdfWriter and QPrinter, have their own m_pageLayout via their private engine classes so we ended up with code like pd->engine->setPageMargins(margins, units); // Set QPagedPaintDevice layout to match the current paint engine layout m_pageLayout = pd->engine->pageLayout(); Now we just use the subclass for it's page layout and all is simpler since we don't need to make sure the two variables are updated to have the same contents. Unfortunately this means that we have to implement a dummy subclass for QPagedPaintDevice(). That constructor doesn't make any sense since QPagedPaintDevice is not really a leaf you want to instantiate, it's there to provide common api for the subclasses and the QPagedPaintDevice(QPagedPaintDevicePrivate *dd) constructor should be used. Since it's a public class we can't remove that constructor and that's why we have that QDummyPagedPaintDevicePrivate. QPageLayout &QPagedPaintDevice::devicePageLayout() is also deprecated now since there's no "device" page layout anymore. Those functions were marked internal and as far as I can see unused outside QPdfWriter/QPrinter so it should be fine. [ChangeLog][QtGui] QPagedPaintDevice constructor has been deprecated since that class is not meant to be used standalone, its two public but internal devicePageLayout() methods are now deprecated. Change-Id: I054601b66afcb7dd662db6247c5ed7820fbee212 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* Replace Q_DECL_OVERRIDE with override where possibleKevin Funk2017-09-191-6/+6
| | | | | | | | | | | | | | | | Remaining uses of Q_DECL_OVERRIDE are in: src/corelib/global/qcompilerdetection.h src/corelib/global/qglobal.cpp doc/global/qt-cpp-defines.qdocconf (definition and documentation of Q_DECL_OVERRIDE) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: Ib9b05d829add69e98a86238274b6a1fcb19b49ba Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Improve PDF/A-1b support in QPdfWriterTobias Koenig2017-03-281-0/+31
| | | | | | | | | | | | | Add new enum QPrinter::PdfVersion to switch QPdfWriter into PDF/A-1b mode. In that mode - meta data are embedded in XMP format - a color profile for sRGB is embedded and an OutputIntent defined - the ID key is added to the document trailer dictionary - a CIDSet entry is added to the font descriptor - transparency is removed from pens, brushes and images Change-Id: Ia8a24d83609b239e716aefc1ba05f07320dbd290 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Fixed pageLayout, pageSize, pageOrientation, pageMargins for QPdfWriterOliver Wolff2015-09-221-1/+2
| | | | | | | Task-number: QTBUG-46887 Change-Id: I8f1497a8b7ff13213879de01fcdfcabfdd471874 Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* QPagedPaintDevice - Move QPageLayout methodsJohn Layt2014-04-051-57/+72
| | | | | | | | | | | | | | | | The new QPageLayout methods weren't originally added to QPagePaintDevice as no new virtuals can be added, instead static polymorphism was used to add the methods directly in the derived classes QPdfWriter and QPrinter. This however means that classes like QTextDocument with print() methods that take a QPagedPaintDevice are unable to access the QPageLayout methods. To fix this, instead make the QPagedPaintDevicePrivate a virtual class and have QPdfWriter and QPrinter implement derived private classes that are called by the non-virtual QPagedPaintDevice base methods. Change-Id: Ieb6e513b1fa05f5ae76ea1f9156b0b1a053089eb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QPdfWriter - Use QPageSize and QPageLayoutJohn Layt2014-03-171-19/+210
| | | | | | | | | | | Add support to QPdfWriter for QPageSize, QPageLayout, and resolution. [ChangeLog][QtGui][QPdfWriter] The QPdfWriter now supports setting the PDF orientation, layout and resolution by using QPageSize and QPageLayout. Change-Id: I9c269f997ec540dac1989f355c6a2e7488947966 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QPdfPaintEngine - Use QPageLayout and QPageSizeJohn Layt2014-03-171-6/+4
| | | | | | | | | | Switch internals of QPdfPageEngine and derived classes to use QPageLayout and QPageSize to make handling of page layout and size more consistent by removing multiple implementations. In particular remove all use of the QPdf namespace version of page size. Change-Id: Ie820340015e8812c8162bd1a257dd0f51f4f0b85 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QPdfWriter - Fix setting of marginsJohn Layt2014-01-091-0/+2
| | | | | | | | The setting of margins wasn't being passed to the base class, so calling margins() wouldn't return the new values. Change-Id: I86c30f28fb0430f4b9d6e180a59cad354b489289 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* QPdfWriter: Fix setting of paper size.Friedemann Kleint2013-07-101-2/+2
| | | | | | | | | Introduce setter for converting mm to Postscript points. Task-number: QTBUG-31443 Change-Id: I032118322657ae2a8b3b457010218d6ea3f3e720 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Make qtbase compile with QT_NO_TEMPORARYFILETasuku Suzuki2013-06-041-0/+5
| | | | | | | | Change-Id: Ida2f59bb245ef70bf65f7e8944c4c315d5bc2f81 Reviewed-by: David Faure (KDE) <faure@kde.org> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Doc: More fixes of qdoc-reported doc errorsaavit2012-08-311-2/+2
| | | | | Change-Id: I2dd815c471e56d2c239a63e7c7ad3496af2a585b Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
* Get started with patching up the Qt GUI docsGunnar Sletta2012-06-281-0/+1
| | | | | | | | Primary goal, make the front page of the Qt GUI module a bit more clarifying and avoid downstream references inside the Qt GUI docs. Change-Id: Icbcfbb64b93963add889bf83711daa9575885c02 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Make qtbase build with Qt-in-namespace againKent Hansen2011-09-281-0/+3
| | | | | | | Change-Id: I5faa8690a05d6ec352fc69c0b69848539f2ed216 Reviewed-on: http://codereview.qt-project.org/5460 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Restore feature compatibility with QPrinter in QTextDocument::printLars Knoll2011-08-191-0/+15
| | | | | | | | | | | | Add a margin method to QPagedPaintDevice. The other variables required are stored in QPagedPaintDevicePrivate without a public API for now. This needs cleaning up once we have a new printing system. Change-Id: Id3f2d7ac7f3cbce8619072a897d91f3a588add64 Reviewed-on: http://codereview.qt.nokia.com/3211 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Introduce a paged paintdevice and use itLars Knoll2011-08-191-4/+89
| | | | | | | | | | | Introduce a QPagedPaintDevice class that has a newPage() method and page dimensions. QPdfWriter and QPrinter inherit from it. Add a bit of API to QPdfWriter. Change-Id: Ibf23e7fe741f3a5ed854faf5d249a272acc75f35 Reviewed-on: http://codereview.qt.nokia.com/3206 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Move the remaining QPrinter dependencies out of qpf.*Lars Knoll2011-08-191-4/+4
| | | | | | Change-Id: I4fd0158d65afad1bc67c52eff17ce2e12ff60641 Reviewed-on: http://codereview.qt.nokia.com/3203 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Rename QPdf(Base)EngineLars Knoll2011-08-191-2/+2
| | | | | | | | | | Rename QPdfBaseEngine to QPdfEngine and QPdfEngine to QPdfPrintEngine. This fit's better with the use cases. Change-Id: Ic208b079581768a957f9fdcc333f0bf87f619d46 Reviewed-on: http://codereview.qt.nokia.com/3202 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* first version of a public API to generate PDFsLars Knoll2011-08-191-0/+112
The class is required to be able to move the printing subsystem out into a module of it's own. Change-Id: I80703b8a8725504c7e6884a34f76e0735efcf95a Reviewed-on: http://codereview.qt.nokia.com/3200 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>