summaryrefslogtreecommitdiffstats
path: root/src/printsupport
Commit message (Collapse)AuthorAgeFilesLines
* printsupport: Fix clang-cl warningKai Koehne2019-04-091-4/+4
| | | | | | | | qprintengine_win.cpp(1117,14): warning: comparison of two values with different enumeration types in switch statement ('QPrint::DuplexMode' and 'QPrinter::DuplexMode') [-Wenum-compare-switch] case QPrinter::DuplexShortSide: Change-Id: Ib5028d80ecf7f6bb9eb0562e5c137acfeb709a14 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix license header for qprinterinfo.cppKai Koehne2019-01-221-9/+21
| | | | | | | Fixes: QTBUG-72598 Change-Id: I1fb9f384509726276ff32ceb5709e7b0fb98d729 Reviewed-by: Kai Pastor <dg0yt@darc.de> Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Windows: Use the ptPaperSize information to set the paper sizeAndy Shaw2018-12-181-0/+2
| | | | | | | | | | In some cases the DEVMODE structure is not updated with the selected paper size, whereas the ptPaperSize structure is always set to the right paper size. Therefore we set the page size on the printer to this after the page dialog is shown. Change-Id: Ieafd486232aca6e930f73a8131b7196ddecea305 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* configure: verify header presence against sourcesOswald Buddenhagen2018-12-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | in addition to the actual library resolution, also resolve the headers belonging to the library, to validate the include path, and possibly ensure that the right version of the library is present. the "include" entries were moved out of the "test" objects, and renamed to "headers". this cleanly permits libraries without compile tests. the headers were not put into the sources, because the variance among the includes is generally orthogonal to the variance among the libraries. note that this - like the library resolution - provides no support for darwin frameworks. consequently, the opengl libraries are excluded from the conversion on darwin. similarly, wasm is excluded (centrally), because emcc is magic and would need advanced wizardry to be dealt with. Change-Id: Ib390c75371efa2badcfec9b74274047ce67c3e5a Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Extend PDF engine to allow the generation of PDFs with huge pagesAndre de la Rocha2018-10-221-1/+6
| | | | | | | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-10-174-11/+15
|\ | | | | | | | | | | | | | | Conflicts: src/plugins/platformthemes/platformthemes.pro src/printsupport/kernel/qplatformprintdevice.cpp Change-Id: Iac01729ad954bb1c7af5867d982eb243b2139ee6
| * Modernize the "mimetype" featureLiang Qi2018-10-124-12/+16
| | | | | | | | | | | | Change-Id: I9b67c2cbc0891a38ece18d521c86fbc7344dce7a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into 5.12Qt Forward Merge Bot2018-09-071-0/+2
|\| | | | | | | Change-Id: I66c7f18a2abd13601da0947919436f7da3549ae9
| * Doc: Check before including the \snippet from a .pro fileVenugopal Shivashankar2018-08-301-0/+2
| | | | | | | | | | | | Change-Id: Icc7552b46a2657c81958e40f33596ddeee045172 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | Windows code: Fix clang-tidy warnings about C-style castsFriedemann Kleint2018-08-301-6/+8
| | | | | | | | | | | | | | | | | | | | | | Replace by reinterpret_cast or const_cast, respectively. Use auto when initializing a variable to fix Clang warnings about repeating the type name, do minor tidying along the way, and a few conversions of 0 or NULL to nullptr. Change-Id: Ieb271a87ddcf064f536e1ff05d23b1e688b1b56a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Remove dead code in QWin32PrintEngineFriedemann Kleint2018-08-281-28/+15
| | | | | | | | | | | | | | | | | | | | | | | | The functions checks for _glyphs.isEmpty() and returns in that case, so, there is no point in having another code branch for _glyphs.size() == 0 below. Unindent branch for _glyphs.size() > 0 and brush it up a bit to silence clang-tidy (warnings about using isEmpty(), nullptr). Change-Id: I78e86583bb30c7bea1357e7a45f61b07d5a4d139 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Modernize the "thread" featureUlf Hermann2018-08-171-1/+4
| | | | | | | | | | | | | | | | | | | | Add it to configure.json and replace all occurrences of QT_NO_THREAD with QT_CONFIG(thread). Add conditions for other features that depend on thread support. Remove conditions where we can use the QMutex and QThreadStorage stubs. Change-Id: I284e5d794fda9a4c6f4a1ab29e55aa686272a0eb Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Windows: Cache the printer capability information the first timeAndy Shaw2018-07-201-5/+6
| | | | | | | | | | | | | | | | | | | | As remote based printers can be slow to query, meaning that it will take time to check all the capabilities, especially if the QPrinter is recreated on need. Then the information should be cached and reused if the printer is deemed to be the same. Change-Id: If8f9626c0d44113c698b4f61bbd197157932ccbe Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Fix clang develop buildAllan Sandfeld Jensen2018-05-311-1/+1
| | | | | | | | | | | | | | | | A mismatch of enums after a rename. Change-Id: Ib28e4607f20583afcb9210fdef7f52d95c63e3dd Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-05-242-8/+6
|\| | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/qt_common.prf src/corelib/tools/qstring.cpp src/plugins/platforms/windows/qwindowsmousehandler.cpp src/widgets/widgets/qmainwindowlayout_p.h Change-Id: I5df613008f6336f69b257d08e49a133d033a9d65
| * QWin32PrintEngine: Fix crash in drawPixmap(), drawImage()Friedemann Kleint2018-05-231-8/+2
| | | | | | | | | | | | | | | | | | | | | | Use the printer's HDC instead of the screen HDC for StretchBlt(). Patch as contributed via bug report. Task-number: QTBUG-59689 Task-number: QTBUG-66325 Change-Id: I9b5d6ddd3f0e9e68f2a003ca9ed20ece20dccef8 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
| * Fix build for Android with android-clangLiang Qi2018-05-161-0/+4
| | | | | | | | | | | | | | | | | | | | dialogs/qprintdialog_unix.cpp:149:15: error: private field 'm_printer' is not used [-Werror,-Wunused-private-field] QPrinter *m_printer; ^ Change-Id: Idce515a3e66019756b6ad2d305072e0a89bb823b Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com> Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* | cups: Fix UI mismatch when a default printer option choice is not availableAlbert Astals Cid2018-05-091-14/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It can happen that the user sets a default printer option choice, using lpoptions or similar, and that is a mistake since that choice is not available because it needs an installable option that is not in the printer. We need to check that and set the internal ppd option not to the value the user gave to lpoptions but to something sane Also rename foundMarkedOption to foundMarkedChoice since we're going through all the choices of a given option in that loop Change-Id: Ic9362d9b4fba33025c4d45eed8ddd203c95836bf Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-05-031-1/+4
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/widgets/graphicsview/elasticnodes/graphwidget.cpp examples/widgets/graphicsview/elasticnodes/node.cpp examples/widgets/graphicsview/elasticnodes/node.h src/plugins/platforms/cocoa/qnsview.mm src/plugins/platforms/cocoa/qnsview_drawing.mm src/widgets/kernel/qmacgesturerecognizer_p.h Change-Id: I13cf06bac75d48d779d8ee7b5c91bfc976f2a32c
| * If the page size is not valid on the new printer, set a custom sizeAndy Shaw2018-05-021-1/+4
| | | | | | | | | | | | | | | | | | | | | | When the page size was not valid on the new printer, it would end up having the wrong page size name on the new printer. What should happen in this case is that it should set the originally set page size as a custom page size on the printer instead. Task-number: QTBUG-62221 Change-Id: Iaca34ae262f5d0685ca60e4ca4b38229a2283289 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* | Merge "Merge remote-tracking branch 'origin/5.11' into dev" into ↵Liang Qi2018-05-022-14/+10
|\ \ | | | | | | | | | refs/staging/dev
| * | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-05-022-14/+10
| |\| | | | | | | | | | Change-Id: Ia082e20e2eb4b76afd4c1a1584ff4e5514655d7a
| | * Remove hack that violates ODRThiago Macieira2018-04-261-11/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC with LTO sees through our hack: qprintdialog_unix.cpp:212:7: warning: type ‘struct QPrintDialogPrivate’ violates the C++ One Definition Rule [-Wodr] qabstractprintdialog.cpp:49:7: note: a different type is defined in another translation unit This hack was there so that the QPrintDialog functions in qabstractprintdialog.cpp could use the d pointer. So instead of hacking around the issue, just use the class that this file has access to: QAbstractPrintDialogPrivate. Change-Id: I3840d727dee443318644fffd1528e2e8b814e983 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * Improve padding hole issues in QAbstractPrintDialogPrivateThiago Macieira2018-04-261-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Placing a boolean between two pointers means we'll have a 7-byte padding hole (64-bit). So move it to the bottom of the class, consuming the tail padding that needs to be there anyway on 64-bit systems. On 32-bit Unix systems, the better place would be at the top, as the parent class (QDialogPrivate) has a 3-byte tail padding. But that's fragile, as QDialogPrivate can change, doesn't apply to MSVC's ABI and doesn't gain us anything on 64-bit. Change-Id: I3840d727dee443318644fffd1528e4f05f4142bd Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Unix print dialog: Properly initialize duplexMichael Weghorn2018-05-021-5/+26
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case the user has explicitly selected a value for the duplex mode in the print dialog before, select this one when another printer is selected and the newly selected printer supports it. Otherwise, always set to the default value of the respective device that was selected. This way, default values that the user (or admin) has set for a CUPS printer (or printer instance) are honored, but an explicit user choice made in the dialog takes precedence. Previously, the duplex values was always reset to "None" every time the printer was changed. Change-Id: Id9683a05b10cf7a4b842f8b6c8452e80cdc6ff91 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | cups: Support raw printersAlbert Astals Cid2018-04-041-0/+6
| | | | | | | | | | | | | | | | They don't have a ppd but we don't *really* need a ppd to just print Change-Id: Idf6b6dafc19420a511b057194488e2170cae4d70 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | cups: Take conflicts for duplex and page size into accountAlbert Astals Cid2018-03-277-53/+244
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Duplex and Page Size are not shown in the "Advanced" options tag since they are more important options, this means we were not taking them into account for ppd conflicts since we never set their values in the ppd, we do use the new-style cups options for them when printing With this patch we add m_pageSizePpdOption and m_duplexPpdOption to set the values to the ppd struct behind the scenes. Change-Id: I48bd9fe93d0c08b7b8dd9620a07c56fc79cce13b Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Initialize m_cupsCodecJesus Fernandez2018-03-261-1/+1
| | | | | | | | | | | | | | | | | | | | Ensure initialization of m_cupsCodec to nullptr. The codec is checking the value of m_cupsCodec; but the initialization was conditional before this patch. Change-Id: I81751b7743e9956f31f17cead01dc05e268db7eb Coverity-Id: 188700 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Unify QPlatformPrintDevice constructorsAlbert Astals Cid2018-03-232-19/+1
| | | | | | | | | | Change-Id: I01714a626e204c73456ebed987055662331d6a3a Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | Linux/cups: Better advanced options UIAlbert Astals Cid2018-03-192-564/+224
| | | | | | | | | | | | | | | | | | | | Previously we were using a treeview that wasn't very clear it was editable, now we simply use QComboBoxes that are much more clear the user can change the values Change-Id: Ied9bca195f4cb275115213631e21cd6a15544311 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | Clean up our Objective-C usageJake Petroules2018-02-202-17/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Move ivars into @implementation - Use instancetype where applicable - Use dot notation for property access - Use subscript operator for dictionaries and arrays - Format selectors consistently - Use proper style for init methods - Use generics instead of void pointers where possible - Use "range for" loops instead of indexing - Replace or replace IBAction/IBOutlet with void Change-Id: I1667812a51d4dfe44ae80fe337cb1f4bc9699d92 Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Move duplex member from QPdfPrintEnginePrivate to QCupsPrintEnginePrivateAlbert Astals Cid2018-02-202-8/+3
| | | | | | | | | | | | | | | | Duplex doesn't really make sense in the context of printing to pdf, and the variable was only being used in QCupsPrintEnginePrivate anyway Change-Id: I801634c56759572825b5c9549d7a1dc92e5697a0 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Fix QPlatformPrintDevice::supportedPageSizeMatchAlbert Astals Cid2018-02-201-0/+4
| | | | | | | | | | | | | | | | | | | | First check if the pagesize is one of the known ones before comparing the page sizes. It's veeeery similar but without it when running the qprinter tests i get a failure since we set "Index Card 3x5in" but get back "Photo 3x5in" Change-Id: I72671231c2abec39e036de829d226784f06e1b41 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | QPagedPainterDevicePrivate: Remove m_pageLayoutAlbert Astals Cid2018-02-162-28/+19
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.9' into 5.11Liang Qi2018-02-141-1/+14
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/corelib/animation/qvariantanimation.cpp src/corelib/global/qglobal.cpp src/corelib/global/qlogging.cpp src/corelib/io/qprocess_win.cpp src/corelib/json/qjsonarray.cpp src/corelib/tools/qsimd_p.h src/corelib/tools/qtimezoneprivate_p.h src/corelib/xml/qxmlstream_p.h src/gui/kernel/qsimpledrag.cpp src/gui/kernel/qsimpledrag_p.h src/plugins/generic/generic.pro src/plugins/platforms/cocoa/qcocoamenu.mm src/widgets/styles/qmacstyle_mac.mm tests/auto/concurrent/qtconcurrentmap/BLACKLIST tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp tests/auto/gui/kernel/qwindow/BLACKLIST tests/auto/widgets/dialogs/qmessagebox/BLACKLIST Change-Id: I508d686cf20f7f8cc6a7119b9bc7c3bbb505c58e
| * Document licenses for all Qt modulesKai Koehne2018-01-241-1/+14
| | | | | | | | | | | | | | | | | | | | Follow the example of the other modules and explicitly mention the valid licenses on each module landing page, optionally combining it with trademark information. Change-Id: I9f1fea0f002e0ab607da89a0cbfe7c53060582d7 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | Remove QPlatformPrinterSupport::createDefaultPrintDeviceAlbert Astals Cid2018-02-052-6/+0
| | | | | | | | | | | | | | no one uses it Change-Id: I03d0350a44a19545d57b47d1b21d85f1a2059f4d Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | cups: Clear cups options at the start of QPrintPropertiesDialog::setupPrinterAlbert Astals Cid2018-01-243-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For some reason the cups options are kept globally instead of per printer at QCupsPrintEnginePrivate so when setting the printer options on accepting the print dialog, we first need to clear them and then call the other functions that set them, otherwise, we will "reuse" cups option set on the previous print. How to reproduce: * Open print dialog, set some advanced option to a non default value, easiest one is print in grayscale * Print * Check it prints in grayscale * Open print dialog, check the advanced options are all on default values * Print * Check it incorrectly prints in grayscale Change-Id: I59aacaf30db844ad40887d6b771f9354557852b6 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Unix: Fix page size margins when changing page sizeAlbert Astals Cid2018-01-172-5/+9
| | | | | | | | | | | | Change-Id: I55435cf500c656eeec61e6c61bbf195df356ffeb Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Unix: Fix default printer page size marginsAlbert Astals Cid2018-01-171-2/+7
| | | | | | | | | | | | | | | | | | | | | | Regressed with ff67dedaaff2dc68571ca9c8c6c6eeaaf084eae4 Before ff67dedaaff2dc68571ca9c8c6c6eeaaf084eae4 the print dialog would not let you select less margin than the minimum printer supported margin, this brings back the old behavior Change-Id: I22f4e8ebf8ffa7c1653d61b7073a9ee582cf453b Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Cups Print Dialog: Change the message box titles to CapsFriedemann Kleint2018-01-171-2/+2
| | | | | | | | | | | | | | | | | | Amends 608301d4c81ce65804a088aaebbd5433a56d69d7. Task-number: QTBUG-1311 Change-Id: I01cd60f0676f4e0501d411151492b4f867653053 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | QPrintDialog/Unix: compile with gcc 4.8Christian Ehrlicher2018-01-171-1/+2
| | | | | | | | | | | | | | | | | | Passing parameters via auto to a lambda function is a c++14 extension which is not supported by gcc4.8. Change-Id: I335b2a2f5ba02f5440c2e7ccc81d4156e8b29484 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Move color/grayscale option to cups advanced panelRenato Araujo Oliveira Filho2018-01-161-1/+18
| | | | | | | | | | | | | | | | | | | | | | CUPS has a complex way to configure colors for printers, and this can not be represented only by radio buttons. Because of that all colors related options will be available only in the advanced panel. The color/grayscale option will still be available when printing to a file. Change-Id: I1592e779009bd80b6dfc18dde760db4154e46439 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | CUPS: Don't show choices that conflict with the printer installed optionsAlbert Astals Cid2018-01-126-16/+46
| | | | | | | | | | | | | | | | | | | | Some options only make sense if the printer has installed some extensions, e.g. we should not shown "Staple" options if the Stapler addon is not installed, so with this change we use ppdInstallableConflict to know whether an option should be shown to the user or not. Change-Id: I5733e1ac8b667c26b292aeafc90a10c155b751a4 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | CUPS: Rework set/clearCupsOption APIAlbert Astals Cid2018-01-123-34/+20
| | | | | | | | | | | | | | | | | | | | | | | | Previously it was a bit awkward to use, you had to do QStringList cupsOptions = QCUPSSupport::cupsOptionsList(printer); QCUPSSupport::setCupsOption(cupsOptions, option, value); QCUPSSupport::setCupsOptions(printer, cupsOptions); now you simply have to do QCUPSSupport::setCupsOption(printer, option, value); Change-Id: Id31583f1ec72644791d82776debbae5583a2be54 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | CUPS: Enable printing arbitrary pages and page rangesAlbert Astals Cid2018-01-124-14/+188
| | | | | | | | | | | | Task-number: QTBUG-1311 Change-Id: I8e09def0e0d8c1404d3ee86845d98a30c23b6485 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | cups: Don't show InstallableOptions in the advanced propertiesAlbert Astals Cid2018-01-121-8/+17
| | | | | | | | | | | | | | | | | | | | According to CUPS maintainer it is recommended to not show them[1]. GTK and Libreoffice behave like that. [1] https://lists.cups.org/pipermail/cups/2015-September/027124.html Change-Id: I82614003490554d41e38a125d44e3a599c2e7342 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Unix: Fix usability of the print properties dialogAlbert Astals Cid2018-01-126-44/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previous behavior: * Open, change setting, cancel, open again, setting was as originally (i.e. unchanged) * Open, change setting, accept, open, change setting, cancel, open again, the setting would be as before pressing cancel * Open, change setting, accept, open, press cancel without changing anything, print, the initially changed setting is not applied New behavior: * Pressing cancel just cancels the changes since you opened the dialog, everything you accepted previously stays correctly selected Change-Id: I483647504682f26d3d21c5229cc6530bf14fe519 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | Fix custom page size handling in the Unix print dialogAlbert Astals Cid2018-01-092-11/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were several problems that i've fixed in a single commit since they are very interwinded * The dialog used QPageSize::Custom for two things, the custom sizes coming from the printer and the "user can write whatever size they want" size. Now only the printer custom sizes use QPageSize::Custom and we use m_realCustomPageSizeIndex for the "user can write whatever size they want" one. * The dialog stored the QPageSize id as the combo userData, that doesn't work when the printer has multiple custom sizes since they all share QPageSize::Custom so now it stores the QPageSize itself Task-number: QTBUG-58733 Change-Id: Ie640a07bb5e24b753db83c091c836e8af4ff126c Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | QUnixPrintWidgetPrivate::_q_printerChanged: Update state correctlyAlbert Astals Cid2018-01-091-0/+6
| | | | | | | | | | | | | | | | | | We need to update the printer output format and the current print device when changing the printer so that if the user opens the properties dialog for that printer it reflects correctly the selected printer. Change-Id: Ib6767a74b74b8eebe43ff17006b6105c483a08b6 Reviewed-by: Andy Shaw <andy.shaw@qt.io>