summaryrefslogtreecommitdiffstats
path: root/src/printsupport
Commit message (Collapse)AuthorAgeFilesLines
* 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
| * QPrinter - Make PDF support required for QPrinterJohn Layt2013-11-271-8/+0
| | | | | | | | | | | | | | | | | | | | Most of QPrinter assumes that QPdf is available as the fall back engine in case either the plugin fails to load or there are no real printers configured. Make this assumption explicit in the feature configure and remove the two places where QT_NO_PDF is actually checked. Change-Id: Ibb1bdf3bafa5809fbc844c84d7127911a1685506 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-11-2610-78/+138
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the conflicts in msvc_nmake.cpp the ifdefs are extended since we need to support windows phone in the target branch while it is not there in the current stable branch (as of Qt 5.2). Conflicts: configure qmake/generators/win32/msvc_nmake.cpp src/3rdparty/angle/src/libEGL/Surface.cpp src/angle/src/common/common.pri src/corelib/global/qglobal.h src/corelib/io/qstandardpaths.cpp src/plugins/platforms/qnx/qqnxintegration.cpp src/plugins/platforms/qnx/qqnxscreeneventhandler.h src/plugins/platforms/xcb/qglxintegration.h src/widgets/kernel/win.pri tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp tools/configure/configureapp.cpp Change-Id: I00b579eefebaf61d26ab9b00046d2b5bd5958812
| * QPrinterInfo - Fix isNull() by fixing constructorsJohn Layt2013-11-262-20/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The QPrinterInfo copy and QPrinter constructors and the assignment operator were not taking the shared_null into account, and so any use of them resulted in a new null QPrinterInfo different to shared_null, which lead to isNull() always returning true in anything other than the simplest use case. While fixing this also make the shared_null a Q_GLOBAL_STATIC. Task-number: QTBUG-21087 Change-Id: I0beb24088208e9ed58d21ca26b0c8d00b02e5b8f Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
| * QPrintDialog - Fix casting print engineJohn Layt2013-11-261-2/+2
| | | | | | | | | | | | | | We want to cast the print engine, not the paint engine. Change-Id: Ia8f11f0215fa066417118fbfbcc921a60282d713 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
| * Match up the specified paper size to an existing one if possibleAndy Shaw2013-11-141-46/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When EnumForms was used then the dmPaperSize was not always correct for the custom paper sizes available on some printers. By using DeviceCapabilities we can be sure that the information is correct in this respect. This also fixes respecting of the custom paper size if one is given and there is no corresponding existing paper size for it. Task-number: QTBUG-34276 Change-Id: I9924d5be8527027fc434261e37f6c7aae66210c3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
| * Add missing Q_INIT_RESOURCETor Arne Vestbø2013-11-071-0/+6
| | | | | | | | | | | | | | | | | | | | | | The library needs to do Q_INIT_RESOURCE for all resources it uses internally, otherwise static linking will fail, and the user has no idea how to rectify it as the name of the missing resource is not known. The Q_INIT_RESOURCE needs to happen outside of any namespace, hence the use of static initResources() functions. Change-Id: I8f7d36b440b05809d97dd489cf8789f345633cec Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Doc: Updated url variable in qdocconf files.Jerome Pasion2013-11-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In 5.2, the HTML output is in a flatter structure and when they are hosted in qt-project.org/doc, the documentation will be found at http://qt-project.org/doc/qt-$QT_VER The url variable is used by projects outside of Qt 5 which need to link to Qt 5 documentation, such as Qt Creator. Task-number: QTBUG-34584 Change-Id: Ifa55fcd9e402b0e184a41e316340e46aeb7101de Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
| * Make error messages a bit better.Stephen Kelly2013-11-051-1/+1
| | | | | | | | | | | | Change-Id: I83b5852abfbb3437c03516bc4b36eff385ddb983 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
| * QPrintDialog - Fix Windows Current Page option selectionunknown2013-11-041-2/+4
| | | | | | | | | | | | | | | | | | | | | | In the Windows print dialog default the print range radio button selection to the QPrinter set value, but only if the option is enabled in the dialog. Task-number: QTBUG-32965 Change-Id: Ic64d86d263a2f8e31c8b32608b569499d0f24d63 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
| * use private linkage where possibleOswald Buddenhagen2013-10-312-2/+2
| | | | | | | | | | | | Change-Id: Ie8eaa71bee87654c21218a23efd7e9d65b71f022 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Remove compiler warning when QT_NO_PRINTER is definedPaul Olav Tvete2013-10-311-0/+2
| | | | | | | | | | | | | | This broke the build on Android with warnings-are-errors. Change-Id: I9edb9539c4a6f7286ff46cbaa53bcfef4cf5280f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
| * Clean up QPlatformPrinterSupport via post routine.Friedemann Kleint2013-10-311-4/+16
| | | | | | | | | | Change-Id: I5aff587f0186f15c9fa65d236e5ebe9a7901dd86 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | QPrintPreviewWidget: use QSignalBlockerMarc Mutz2013-10-301-3/+4
|/ | | | | Change-Id: Ic2d48c8e2c9c3c6f06e67ebf7e12bd4899b421aa Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Set currently selected printer to QCUPSSupport in PageSetupWidgetMartin Klapetek2013-10-183-0/+13
| | | | | | | | Also adds new method to allows setting a printer in QCUPSSupport by printer name. Change-Id: Iff7a88d95eab9de2c96872c45b12e708207bda16 Reviewed-by: John Layt <jlayt@kde.org>
* If CUPS has no default printer, set up the first one in listMartin Klapetek2013-10-181-1/+3
| | | | | | | | Otherwise QCUPSSupport is instantiated without any printer being set up, which leads to bugs and/or crashes in other parts using QCUPSSupport. Change-Id: I1f4ddde5a28d6448d78aed856104ce8448e213c7 Reviewed-by: John Layt <jlayt@kde.org>
* Doc: Adding mark-up to boolean default values.Jerome Pasion2013-10-082-16/+16
| | | | | | | | | | | | | | | | | Default values should have mark-up to denote that they are code. This commit changes: -"property is true" to "property is \c true". -"Returns true" to "Returns \c true". -"property is false" to "property is \c false". -"returns true" to "returns \c true". -"returns false" to "returns \c false". src/3rdparty and non-documentation instances were ignored. Task-number: QTBUG-33360 Change-Id: Ie87eaa57af947caa1230602b61c5c46292a4cf4e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Doc: remove duplicate \externalpage definitionsTopi Reinio2013-09-261-31/+0
| | | | | | | | Delete all duplicate \externalpage definitions from corelib, printsupport and testlib sources. Change-Id: I7dc5358861f4dad3e8ce080619b61ca3da64ec85 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Fix QT_NO_PRINTER build on MacVitalii Shastun2013-09-262-3/+4
| | | | | | | | On Mac the QT_NO_PRINTER build was not implemented. Task-number: QTBUG-33565 Change-Id: I118472f9400aa0a0d0e192ae39a11ea38a66f340 Reviewed-by: John Layt <jlayt@kde.org>
* When calling setPageSizeMM then the size needs to be passed as MMAndy Shaw2013-09-231-3/+23
| | | | | | | | This simplifies the code a bit and ensures that it is respecting what the relevant function expects the size to be as. Change-Id: Iec88fab84c27a33d6f1a9e9413ea6beb0a39c68d Reviewed-by: John Layt <jlayt@kde.org>