summaryrefslogtreecommitdiffstats
path: root/src/printsupport
Commit message (Collapse)AuthorAgeFilesLines
* Initialize the picpainter State in the QAlphaPaintEngine.Michael BrĂ¼ning2014-03-211-0/+1
| | | | | | | | | | | | | | Patch by John Layt. Analog to how the print preview problems on windows were fixed, this is needed to correctly print e.g. web view contents. Task-number: QTBUG-36308 Task-number: QTBUG-37240 Change-Id: If4ecffde969ed221bbbeea80232f29f095fd71cd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: John Layt <jlayt@kde.org>
* QPrinter - Doc fixJohn Layt2014-03-171-16/+1
| | | | | | | Remove duplicated documentation. Change-Id: I53b6430b69b0e76a04cdc12b32a6bd59756acaa8 Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* Fix translation of QtPrintSupport and QPageSize.Friedemann Kleint2014-03-171-0/+6
| | | | | | | | | | Add translator comments, fix spelling, reduce repetitive messages. Change-Id: Id4cbbc3de8fa261cf8f125c5faf735dc608e2b15 Reviewed-by: Robert Loehning <robert.loehning@digia.com> Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: John Layt <jlayt@kde.org>
* QtPrintSupport - Fix QT_NO_PRINTER buildJohn Layt2014-03-177-4/+26
| | | | | | | | Fix the QT_NO_PRINTER build for issues that have accumulated over last few months, and in the new changes already approved. Change-Id: I9aed21dee861837fd1a68a96692c873a4f5be293 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QCupsSupport - Remove obsolete CUPS codeJohn Layt2014-03-172-545/+1
| | | | | | | | | All code directly using CUPS is now in the QPA plugin and QCupsSupport is no longer needed, other than the utilities for setting CUPS options which do not need direct access to CUPS. Delete all the obsolete code. Change-Id: I561ad8af2415a9b745e2d35fd0624a5acdf27648 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QPrintDialog - Remove CUPS specific codeJohn Layt2014-03-171-74/+74
| | | | | | | | | | | We no longer use QLibrary to load CUPS, so remove checks. Switch from using QCupsSupport and QPrinterInfo to QPlatformPrintDevice. The remaining use of QCupsSupport is only for utilities to set CUPS specific options which don't need to link to CUPS directly, these will be replaced later with generic cross-platform API. Change-Id: I6e3d9e9a59633c33af0555eb28443a9fc192b27c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QPageSetupDialog - Use QPageLayout and QPageSizeJohn Layt2014-03-174-409/+356
| | | | | | | | | | | Convert the Linux / CUPS version of the QPageSetupDialog to use QPageSize and QPageLayout internally. As this is an almost complete re-write of the internals the liberty has been taken of doing renames and code moves that would normally be done in separate commits, but in this case would have been mostly pointless done separately. Change-Id: I6eaa7c1fbf0a04cb3425f1d322fcae89239e83b7 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QPrinter - Fix winPageSize() on Mac and LinuxJohn Layt2014-03-173-15/+6
| | | | | | | | | Using QPageSize internally provides the Windows ID on all platforms so remove the conditional compile on the QPrinter api and add support to the print engines. Change-Id: I31e23d5090a9b6ceb087c29dead050b0ee1855a5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QPrinter - Use QPageSize and QPageLayoutJohn Layt2014-03-178-220/+415
| | | | | | | | | | | | | | | | | Use QPageSize and QPageMargins to get/set values in the print engines, add api to directly set the values, and rewrite the docs to make the paper-based api obsolete instead of the page-based api. Add new PPK keys to pass QPageSize, QPageMargins and QPageLayout to the print engines to ensure no level of detail is lost, e.g. for custom sizes passed to QPrinter. [ChangeLog][QtPrintSupport][QPrinter] QPrinter can now use QPageSize and QPageLayout in the public api to control the page layout for a print job. Change-Id: Iee39a4042bcd6141d29b0a82b49066d7a7a78120 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QPrintEngine - Switch Windows to QPageLayoutJohn Layt2014-03-173-309/+193
| | | | | | | Switch the Windows QPrintEngine to use QPageLayout. Change-Id: I2b617fe103980c4efbb0ed367547e436f2d8a5e2 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QPrintEngine - Switch Windows to QPlatformPrintDeviceJohn Layt2014-03-173-404/+170
| | | | | | | | | | Change the Windows QPrintEngine implementation to use the QPlatformPrintDevice to obtain device information, and use QPageSize to obtain page size conversions. A following change will use QPageLayout to store that page size. Change-Id: I990943e2b62ab6dab2c4d4a292c7ed7261beadf2 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QPrintEngine - Switch Mac to QPageLayoutJohn Layt2014-03-171-0/+3
| | | | | | | Use QPageLayout in the Mac QPaintEngine. Change-Id: I4c160e3875d69879160e289c371c10b1ac028748 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QPrintEngine - Switch Cups to QPlaformPrintDeviceJohn Layt2014-03-173-6/+4
| | | | | | | | Use QPlatformPrintDevice in the Cups print engine for all device specific code. Change-Id: Ic1f5f8b4010a9958c320f3c0c727cf1bd1a70c65 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QPdfPaintEngine - Use QPageLayout and QPageSizeJohn Layt2014-03-173-95/+43
| | | | | | | | | | 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>
* QPagedPaintDevice - Use QPageSize and QPageLayoutJohn Layt2014-03-172-54/+297
| | | | | | | | | | | | | | | | | | | | Use new QPageLayout and QPageSize class to store and convert page sizes and layouts consistently. Extend the PageSize enum to match QPage::PageSize. Note that public setters/getters cannot be added as virtuals would break BIC, but without virtuals the derived classes would break. Instead an internal api is provided and the derived classes will need to implement identical api to manipulate it. [ChangeLog][QtGui][QPagedPaintDevice] Paged paint devices such as QPrinter and QPdfWriter now support all Postscript standard page sizes. Task-number: QTBUG-27685 Task-number: QTBUG-25744 Change-Id: I62e96ab94194ab4ac8bed8fa804e0ce1c3233313 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QPrinterInfo - Switch to QPlatformPrintDeviceJohn Layt2014-03-177-225/+240
| | | | | | | | | | | | | | | | | | | Change the QPrinterInfo implementation to use QPlatformPrintDevice as the backend. Remove all the old QPrinterInfo related code from the QPA plugin. Add public api to QPrinterInfo to support some features from QPlatformPrintDevice. [ChangeLog][QtPrintSupport][QPrinterInfo] Added new public api for isRemote(), state(), defaultPageSize(), supportedPageSizes(), supportsCustomPageSizes(), minimumPhysicalPageSize(), maximumPhysicalPageSize(), supportedResolutions(), availablePrinterNames(), and defaultPrinterName(). The use of availablePrinters() is discouraged due to performance concerns. Task-number: QTBUG-35248 Change-Id: Ic38323a930549ad67bf04a1a6bb43d623dfe6a33 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QPlatformPrintDevice - New QPA base classJohn Layt2014-03-178-0/+1312
| | | | | | | | | | Add a new QPA class to abstract Print Devices. Each platform instance will encapsulate all required details about a print device instead of the code being distributed throughout the print engine and print plugin. Change-Id: I7f6a537ad55a6e7f599d83f461b1e2ee62b15094 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QPageSize - Add new QPageSize classJohn Layt2014-03-171-0/+1
| | | | | | | | | | | | | | | | | | New QPageSize class to encapsulate paper sizes and names to ensure all sizes and conversions are consistent and match the Postscript standard sizes. Subsequent changes will use this class in the paged paint devices, paint engines, print engines, and print plugins to replace multiple inconsistent local implementations. [ChangeLog][QtGui][QPageSize] Added new QPageSize class to implement Adobe Postscript PPD standard page sizes. This class supports the standard page sizes, names and keys from the PPD standard, and provides convenient size and rect conversion methods. Change-Id: Ie2c8be0c3df0d29ac5da4cd9877ad41d0982633c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QPrinter - Add page metric testsJohn Layt2014-03-171-2/+10
| | | | | | | | | | | | | Add more page metrics tests to expose the many bugs and inconsistencies in the page layout handling. No platform or pdf backend passes all these tests so they are skipped for now, but following commits will use the tests to ensure the re-write of the page layout handling fixes the many problems in a consistent way for all backends. Change-Id: Ic5b16aa08dfe2bd9a9191662fd2bbe6b913e15c9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* QPrintEngine - Improve devMode handlingJohn Layt2014-02-264-57/+49
| | | | | | | | | Improve the sharing of the devMode between the QPrintEngine and the print dialogs, in particular start to change the dialogs from directly accessing the QPrintEngine internals. Change-Id: Ieb4649c19b936433c85207297a0b6e59356c3880 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QPrintEngine - Remove Windows use of port and driverJohn Layt2014-02-263-37/+16
| | | | | | | | | | | | | | The use of the driver name and port name in the DEVNAMES structure is no longer required within the Windows print engine and dialogs. The CreateDC docs clearly state any driver value passed in for a printer is ignored. The PRINTDLGEX docs also state only the name is actually used. The use of the port name is not required as the DeviceCapabilities api works fine with just the printer name and the FILE: port can be manually handled. Change-Id: I7765d73d4a31b1a3c5dab55ee4cfd3580bcf9ad7 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-02-121-2/+6
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/gui/image/qimage.cpp src/gui/text/qtextengine.cpp src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp src/printsupport/kernel/qprintengine_win.cpp Change-Id: I09ce991a57f39bc7b1ad6978d0e0d858df0cd444
| * Fix printing with a custom paper specified.Andy Shaw2014-02-061-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | If DMPAPER_USER is set from the print dialog then it is expected that the specific member variables to get the custom width and length are used. The size returned by querying the DC_PAPERSIZE is some random default and is not the one actually requested by the user. Also ensure that when it is a custom paper size from the driver itself that we store the right paper size. Change-Id: I760b8429ca1b01f5e303f2111b8d7ca1795c8ab8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* | Automatically link printsupport plugins to static applications.Friedemann Kleint2014-02-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Add the required printsupport plugins to the QTPLUGIN variable as is done for the QPA plugin. [ChangeLog][QtPrintSupport] Made the Qt buildsystem automatically include the necessary plugins so that static applications can print. Task-number: QTBUG-29663 Change-Id: I0e2e3b0f25dd5714bd187711c85893926b0c4e85 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Fixed initialization of QPrintPreviewDialog's image resources for static builds.Friedemann Kleint2014-02-071-0/+11
| | | | | | | | | | | | | | | | | | [ChangeLog][QtPrintSupport][QPrintPreviewDialog] Fixed initialization of QPrintPreviewDialog's image resources for static builds. Task-number: QTBUG-36561 Change-Id: Ibb725e7d0cd647b904371db2601161c756b99f53 Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* | QPrinter - Enable changing of Orientation on MacJohn Layt2014-02-051-3/+1
| | | | | | | | | | | | | | | | | | | | Since OSX 10.4 it has been possible to change the page orientation during a print job. Task-number: QTBUG-27630 Change-Id: Ic3c69e83afebbb9267ef6f435f968aeef2b72963 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | QPrinter - Fix PaperSourcesJohn Layt2014-02-053-10/+4
| | | | | | | | | | | | | | | | | | | | | | An earlier commit add new PaperSources for First and Last, but after looking at wingdi.h it turns out these are just the first and last DMBIN values, and Upper is equal to OnlyOne. Remove First and Last, but keep the Upper and CustomSource for use later by PPD based printer systems. Change-Id: I298472a1f54efcc584e73dec944b96fc91426c1b Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | QPrinter - Fix Printer Selection option on WindowsJohn Layt2014-02-052-14/+10
| | | | | | | | | | | | | | | | | | Make the printer selection option api public on Windows to be consistent with Mac, and with the print program api which is already public. Change-Id: I3da9684288348eaa43276ca8534a1d5809f7027b Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | QPrintEngne - Fix PPK_CreatorJohn Layt2014-02-052-6/+9
| | | | | | | | | | | | | | | | Add support to the Mac and Windows print engines to preserve the creator name when switching between native and pdf format. Change-Id: Ie036af3140f24d8e34aa886f091384f93aa0157b Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | QPrintEngine - Fix PPK_CollateCopiesJohn Layt2014-02-052-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mac supports Collate Copies using native api, so add support. Note this is mostly only useful for setting the print dialog default, as Mac supports server-side multiple copies so the app will never need to collate the copies itself. Change PDF and Windows to default to collate true to match Mac as this is the behavior users expect. Task-number: QTBUG-27724 Task-number: QTBUG-35251 Task-number: QTBUG-22144 Change-Id: Ia43dbc260b3a71aa5b267cca54c168ffbea794fc Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | QPrintEngine - Fix PPK_DocumentNameJohn Layt2014-02-051-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support to the Mac print engine for set/get the Document Name using the Job Name setting. Our documentation states this is one use that the document name will be put to so is appropriate to be used. Change the Windows print engine to default to a blank Docuemnt Name consistent with the other print engines. If still blank when printing then use a default value. Task-number: QTBUG-27724 Task-number: QTBUG-22144 Change-Id: If590811b5720e6f759eabc290b578b94e221f9f4 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | QPrinter - Clean up Print Engine Key defaults and testsJohn Layt2014-02-053-24/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The PrintEngine keys are not consistently treated across the platforms and are not properly tested. Start the process of making the print engines behave consistently by documenting and testing the current behavior. Ensure all unsupported features return a consistent default value. The auto test for valuePreservation() has been flaky depending on the platform and installed printers so remove it and replace it with more complete testing. If no native printers available then don't test the native engines. Fixes for the individual inconsistent keys will follow. Task-number: QTBUG-26430 Change-Id: Iab914d7e0a5ae4a2cdc24c8645751f0910cf440c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | qprintengine_win.cpp: Fix assert when printing with custom page sizes.Friedemann Kleint2014-01-281-1/+1
| | | | | | | | | | | | | | | | Task-number: QTBUG-36348 Change-Id: I57c8905e007ccd9cf558af03f19f2969009b32c2 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: John Layt <jlayt@kde.org>
* | expand tabs and related whitespace fixes in *.{cpp,h,qdoc}Oswald Buddenhagen2014-01-131-2/+2
| | | | | | | | | | | | | | | | the diff -w for this commit is empty. Started-by: Thiago Macieira <thiago.macieira@intel.com> Change-Id: I77bb84e71c63ce75e0709e5b94bee18e3ce6ab9e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QPrinter - Add missing PaperSource valuesJohn Layt2014-01-133-2/+15
| | | | | | | | | | | | | | | | | | Add extra PaperSource values for all Windows DM_BINS values. Also add CustomSource for use on OSX and CUPS when the PPD defines an InputTray value that cannot be matched. Change-Id: I2dfd565288942705a9872ab1b7c4cd32722ba674 Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-01-104-40/+50
|\| | | | | | | Change-Id: I99af0bef7f1c931533a324ebcfb27c40ee871a5e
| * QPagedPaintDevice - Fix size of ISO B9 pageJohn Layt2014-01-061-2/+2
| | | | | | | | | | | | | | | | The ISO B9 page size is 44 x 62 mm, not 33 x 62 mm. Task-number: QTBUG-35966 Change-Id: Ieb2dcd120c51bd7a8997151f2470775ea0b89e08 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
| * QPageSetupWidget - Fix input of Custom paper sizeJohn Layt2014-01-062-37/+47
| | | | | | | | | | | | | | | | | | | | Currently if selecting the Custom paper size in the page setup widget the custom size inputs are not enabled to allow you to actually enter your custom size. Fix the handling of custom paper size to allow manual size entry and fix orientation change. Change-Id: I73b521976ca13c0164441a724bb277c19205d7c9 Reviewed-by: Andy Shaw <andy.shaw@digia.com>
| * QprintDialog - Fix loss of page settings.John Layt2014-01-061-1/+1
| | | | | | | | | | | | | | | | | | | | If you click on the properties button and change the page settings and click OK, then click properties a second time and click cancel, then your original changes are forgotten. Ensure the properties dialog is only deleted if the OK button has never been clicked. Change-Id: I81be8a2c941eeec36c03647d7fea8f498154930a Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-12-164-20/+8
|\| | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qplatformtheme.h tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp Change-Id: Iecd3343d6a050b8764f78d809c4a1532aeba69e5
| * Windows: Fix printing.Friedemann Kleint2013-12-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | Clear custom paper size flag in QWin32PrintEnginePrivate::updateCustomPaperSize(). Breakage introduced by 3396ba5612c1047d1b21a90c4996dff848c00114 . Task-number: QTBUG-35500 Change-Id: I7e7708444cd7201af35e0f5d9b16d6c73fee77f6 Reviewed-by: John Layt <jlayt@kde.org>
| * QPrintDialog - Fix Cups printer setup sequenceJohn Layt2013-12-091-2/+4
| | | | | | | | | | | | | | | | | | | | First set up the selected output format, printer and page size, and then setup the selected job options. This ensures all values are correctly setup for the requested format and printer as not all settings may be able to persist across the change in output format or printer. Change-Id: I67f261f4e3be479a9018139633886ee8e570f42a Reviewed-by: Andy Shaw <andy.shaw@digia.com>
| * Reinitialize the printer after changing the custom paper sizeAndy Shaw2013-12-081-0/+1
| | | | | | | | | | | | Task-number: QTBUG-34276 Change-Id: Ie382c39cb7b7b8307fcd1130702ca97e80e4a4f5 Reviewed-by: John Layt <jlayt@kde.org>
| * QPageSetupWidget - Fix copying of printer settingsJohn Layt2013-12-081-3/+0
| | | | | | | | | | | | | | | | | | Don't copy the dialog settings to the QPrinter before the Print button is pressed, in case the Cancel button is pressed instead. The settings already get copied in the right place. Change-Id: I84d0053b450cf5839bf1a879af013f305a8fd377 Reviewed-by: Andy Shaw <andy.shaw@digia.com>
| * QPrintDialog - Fix setting of PageOrderJohn Layt2013-12-082-14/+1
| | | | | | | | | | | | | | | | | | The print dialog was setting the PageOrder on the QPrinter as soon as the check box was toggled and not when the Print button was pressed, meaning the change is not forgotten when Cancel is pressed. Change-Id: I19637b7efacfb5388c70d2e7d9d05a05ecc5b2ea Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-12-052-121/+150
|\| | | | | | | | | | | | | Conflicts: src/sql/drivers/sqlite/qsql_sqlite.cpp Change-Id: Ia7cffd2c99ae3d5eea6b5740683c06e921336dcd
| * QPrinter - Simplify setting manual propertiesJohn Layt2013-11-292-59/+33
| | | | | | | | | | | | | | | | Change from a list to a set and define a utility method to both set the property and store that we have set it. Change-Id: I0cf13f1b0e90942424744316d0d3f699b9ead144 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
| * QPrinter - Fix OutputFormat when no printersJohn Layt2013-11-292-72/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the QPrinter constructor, setOutputFormat() and setPrinterName() make bad assumptions about the availability of printers when configuring NativeFormat which can lead to inconsistent print engine set-ups leading to crashes in the print dialog, especially on Windows where a valid DEVMODE is needed. This change cleans up the init and methods to ensure NativeFormat can only ever be set if we have both a valid plugin and a valid printer, if not the PdfFormat is used. One side-effect of this is that it is now impossible to set an invalid printer name via QPrinter (but still able to be done via QPrintEngine if really needed). Also if no default printer is set then use the first available one. This also fixes a bug where setting a new printer name on Windows reset all the saved settings. [ChangeLog][Important Behavior Changes] QPrinter no longer allows you to set an invalid printer name. Task-number: QTBUG-34345 Task-number: QTBUG-26008 Task-number: QTBUG-26430 Change-Id: I19737e4209d8c8df5817ea83246b3dd0c483ee85 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* | Cleanup some Windows printengine code to make it look more readableAndy Shaw2013-12-031-56/+39
| | | | | | | | | | Change-Id: I9e014a2a68b1502d20b88adccab39b7394b2ad86 Reviewed-by: John Layt <jlayt@kde.org>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-11-291-8/+0
|\| | | | | | | Change-Id: Ibb342cc5fc55ff9a3f4b3ecbd53936b57bc13e63