summaryrefslogtreecommitdiffstats
path: root/src/printsupport
Commit message (Collapse)AuthorAgeFilesLines
...
* | 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>
* | Validate printer duplex modeRenato Araujo Oliveira Filho2018-01-091-1/+7
| | | | | | | | | | | | | | | | Disable unavailable duplex options Remove redundant option on advanced tab Change-Id: Ie09c9ffd637b521210e3d7d4f15300792f910996 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* | Fix build due to missing QDebug includeSérgio Martins2018-01-091-0/+1
| | | | | | | | | | | | | | The build just passes on Qt CI by chance. Change-Id: I3bfef12b48df22fa64d92af9cd345bfc984c9923 Reviewed-by: David Faure <david.faure@kdab.com>
* | CUPS: Fix conflict handlingAlbert Astals Cid2018-01-052-10/+156
| | | | | | | | | | | | | | | | | | | | | | The previous code assumed that ppdMarkOption returning non zero (i.e. it has conflicts) also meant that the option wasn't applied at the ppd level, but it actually is. What we need to do is after calling ppdMarkOption parse the tree again looking to see if any option is conflicting and mark it as such in the UI. Change-Id: I836f1902d14dc8c176bb06776471cbf4ed11786f Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | QtPrintSupport: Raise minimum supported MSVC version to 2015Friedemann Kleint2018-01-051-1/+1
| | | | | | | | | | | | | | | | Remove code for older versions and streamline #ifdefs. Task-number: QTBUG-51673 Change-Id: Ib87b2559d0d04fcfa70cabd134ac6936a3c2a261 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | CUPS: Fix advanced options cancel of the print properties dialogAlbert Astals Cid2018-01-041-0/+36
| | | | | | | | | | | | | | | | | | | | | | When the user changes the advanced settings we call setProperty PDPK_PpdOption so if the user cancels we need to set them back to what they were originally Change-Id: Idd0cb413fb1e68dd28cf66f7f66f7e0afb38393e Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | Refactor QPPDOptionsModel a bitAlbert Astals Cid2018-01-041-36/+59
| | | | | | | | | | | | | | | | | | | | Make the members private and add getters Make some other functions also private Move setCupsOptionsFromItems from QPrintPropertiesDialog to QPPDOptionsModel Change-Id: Ibb555a6e6be53550f30c159c3ad611d55e2a767a Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | Merge remote-tracking branch 'origin/5.10' into devLars Knoll2018-01-0215-41/+42
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf sc/corelib/io/qfsfileengine_p.h src/corelib/io/qstorageinfo_unix.cpp src/platformsupport/eglconvenience/qeglpbuffer_p.h src/platformsupport/input/libinput/qlibinputkeyboard.cpp src/platformsupport/input/libinput/qlibinputpointer.cpp src/plugins/platforms/cocoa/qcocoamenu.mm src/plugins/platforms/ios/qiosscreen.h src/plugins/platforms/ios/qioswindow.h src/plugins/platforms/ios/quiview.mm src/printsupport/dialogs/qpagesetupdialog_unix_p.h src/printsupport/dialogs/qprintpreviewdialog.cpp src/printsupport/widgets/qcupsjobwidget_p.h src/widgets/widgets/qmenu.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp Change-Id: Iecb4883122efe97ef0ed850271e6c51bab568e9c
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Lars Knoll2017-12-301-1/+1
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf mkspecs/win32-g++/qmake.conf src/corelib/global/qglobal_p.h src/corelib/global/qoperatingsystemversion_p.h src/corelib/io/qfilesystemengine_win.cpp src/network/bearer/qbearerengine.cpp src/platformsupport/input/libinput/qlibinputpointer.cpp src/sql/doc/snippets/code/doc_src_sql-driver.cpp src/widgets/kernel/qwidget_p.h src/widgets/kernel/qwidgetwindow.cpp src/widgets/styles/qfusionstyle.cpp tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp Change-Id: I80e2722f481b12fff5d967c28f89208c0e9a1dd8
| | * qprintengine_win.cpp: Fix -Wclazy-range-loopFriedemann Kleint2017-11-301-1/+1
| | | | | | | | | | | | | | | | | | | | | qprintengine_win.cpp:1502: warning: Missing reference in range-for with non trivial type (QPrint::InputSlot) [-Wclazy-range-loop] Change-Id: If6e55c1748e05e32aaa32a16063ba491fe242952 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-12-051-1/+3
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/ios/quiview.mm Change-Id: I88384c70047391c75d9ff166c8d9881ff6751dbf
| | * Fix unix QPrintDialog initially selected printerJoni Poikelin2017-11-291-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unix QPrintDialog always set default printer as selected printer even though something was explicitly requested. [ChangeLog][QtPrintSupport][QPrintDialog] Properly pre-select explicitly requested printer on Unix. Task-number: QTBUG-63933 Change-Id: I6289f759d480b4891f4ddd7ff5aad3ae9ab4bc75 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * | PrintSupport: modernize connection signal/slotLaurent Montel2017-11-304-15/+15
| | | | | | | | | | | | | | | Change-Id: I6e482cd9503e96cc43ead21122d3690cdb18151c Reviewed-by: David Faure <david.faure@kdab.com>
| * | Printsupport: not necessary to check pointer before to delete itLaurent Montel2017-11-301-2/+1
| | | | | | | | | | | | | | | Change-Id: Ib2a7823224c45b6e9110016b2f5756e1b2fd8f3c Reviewed-by: David Faure <david.faure@kdab.com>
| * | PrintSupport: convert 0 with nullptr (c++11)Laurent Montel2017-11-3019-34/+34
| | | | | | | | | | | | | | | Change-Id: I35a8022c78427c9b4d4a9d9941770d22c36c3be8 Reviewed-by: David Faure <david.faure@kdab.com>
* | | CUPS: Refactor the code a bitAlbert Astals Cid2017-12-271-16/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the selected and selDescription members to a subclass of QOptionTreeItem since it's only ever used for Option type nodes of the tree Change-Id: Ic99841c4e04a3afcff0950f72abf12977850f6d3 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Reviewed-by: Renato Araujo Oliveira Filho <renato.araujo@kdab.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | QPageSetupWidget::setPrinter: Use printdevice default paper sizeAlbert Astals Cid2017-12-193-4/+11
| | | | | | | | | | | | | | | | | | | | | This means that actually the paper size set on system settings (or lpoptions) is used instead of A4 Change-Id: I2dd86fd9ba210a335773430328b0ba2d3343395f Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | CUPS: Use printer job-hold-until as default instead of the noholdAlbert Astals Cid2017-12-193-7/+52
| | | | | | | | | | | | | | | | | | | | | This also reads the job-hold-until from lpoptions if set there for the particular printer Change-Id: Ic60fef675ab9f4760cd99ee9ac417b0478459681 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | CUPS: Use printer job-billing as default instead of the empty stringAlbert Astals Cid2017-12-182-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | This also reads the job-billing from lpoptions if set there for the particular printer Change-Id: Ia4a6961de504005b8dcd9209da0624e9ae9ef7e4 Reviewed-by: Laurent Montel <laurent.montel@kdab.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | CUPS: Use printer job-sheets as default instead of none,noneAlbert Astals Cid2017-12-183-2/+43
| | | | | | | | | | | | | | | | | | | | | | | | This also reads the job-sheets from lpoptions if set there for the particular printer Change-Id: I35aff103261ef58492779071d866e8a15ac78607 Reviewed-by: Laurent Montel <laurent.montel@kdab.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | Remove declared but undefined QPageSetupWidget constructorAlbert Astals Cid2017-12-181-1/+0
| | | | | | | | | | | | | | | | | | Change-Id: I54022d00d246c83489ccd171170feec1a1a46673 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | CUPS: Use default cups job-priority instead of 50Albert Astals Cid2017-12-184-7/+24
| | | | | | | | | | | | | | | | | | | | | | | | This also reads the job-priority from lpoptions if set there for the particular printer Change-Id: I75d983c377d2135a0b0d3e028829a7384a5e1897 Reviewed-by: Laurent Montel <laurent.montel@kdab.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | QtPrintSupport: Fix buildFriedemann Kleint2017-12-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dialogs/qprintdialog_unix.cpp:1104:21: error: incomplete type 'QTextCodec' used in nested name specifier Amends b4330bc391bbb08898f192ea3469b73aed09134c. Task-number: QTBUG-54464 Change-Id: I555431d11a5c3f247d4f055d94255d2708c92374 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com> Reviewed-by: David Faure <david.faure@kdab.com>
* | | Reintroduce the Advanced tab in the QPrintPropertiesDialogAlbert Astals Cid2017-12-152-6/+409
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is mostly a revert of 69de6177615de3c4c31dea529172389e92f490b0 adapted to the new code. The commit that removed this code said: a) there's duplicate settings in the advanced tabs and in the rest of the ui: this easily solved with a blacklist b) you can set these options in the system settings: probably true, but it is very cumbersome to go to the printer settings every time i print to select from which tray the paper should be used Task Number: QTBUG-54464 Change-Id: I7b1cacf51006dadb10aa6e00fe6dd2ff748fe576 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | QPlatformPrintDevice: use QVector, not QList in the APIMarc Mutz2017-12-146-29/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QPlaformPrintDevice uses QVector to store, but QList in the getters to retrieve these data. Port API from QList to QVector to avoid conversion between the two containers on every access. Saves almost 4KiB in text size (another 0.9% of QtPrintSupport). Change-Id: If33df141b87753803c45d9f4dae501a68abe49af Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | QPlatformPrintDevice: store QPageSize/QMimeType/int in QList, not QVectorMarc Mutz2017-12-142-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit pains me, because we want Qt to migrate away from QList, but the QtPrint API stack (all the way to public API, for QPageSize, and int) is formulated in terms of QList, not QVector, so it makes zero sense to store data in QVectors just to convert to QList on every opportunity. Store QMimeType in QList, too, since that's what QtCore uses. Saves 3KiB in text size (0.7% of QtPrintSupport). Change-Id: I71249f60be517cc06973b38d9ccad7a31f348be3 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Allow access to ppd file and ppdMarkOption via ↵Albert Astals Cid2017-12-132-0/+4
| | | | | | | | | | | | | | | | | | | | | QPpdPrintDevice::property/setProperty Change-Id: I47b49b52121950fa8e3ea7a056974d9f3033490f Reviewed-by: Liang Qi <liang.qi@qt.io>
* | | Introduce QPrintDevice::property/setPropertyAlbert Astals Cid2017-12-134-0/+38
| | | | | | | | | | | | | | | | | | | | | So we can access QPlatformPrintDevice internals if needed Change-Id: Ib37c5717713f37262ef12d7b61793d80f05baf4a Reviewed-by: Liang Qi <liang.qi@qt.io>
* | | Update usage of QFontMetrics::width() to new APIEskil Abrahamsen Blomfeldt2017-12-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QFontMetrics(F)::width() has been deprecated and is replaced by horizontalAdvance(). This updates all usage of it in tests and documentation. It is worth noting that many or most of the usages of QFontMetrics::width() probably intended to use boundingRect().width(), but since it currently works, I have not looked into that, just replaced the function name mechanically. Change-Id: Iec382e5bad0b50f37a6cfff841bfb46ed4d4555f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | QAlphaPaintEngine: port away from QRegion::rects()Marc Mutz2017-12-061-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use begin()/end() instead. The old code extracted the rects from the region, then checked for a 'complex' region (by comparing the number of rectangles against 10), and replacing the region with the bounding rect if it was too complex. It then went on to adjust the rectangle list it had gotten from the original region to match the new. Simply delay getting the rectangles until after we have modified the region. Since there are many member function calls in-between, take a copy of the region to iterate over later, rather than relying on the region to be left untouched by all the code in-between. Change-Id: I49ddf4d545520ab435ab6b89eec3d24cf371823e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Remove QPageSetupWidget::selectPrinterAlbert Astals Cid2017-12-063-14/+4
| | | | | | | | | | | | | | | | | | | | | t's only ever called after setPrinter so merge the code Change-Id: I4b5d593edbe62b64354e81c19112fa87b0555fdc Reviewed-by: Andy Shaw <andy.shaw@qt.io>