summaryrefslogtreecommitdiffstats
path: root/src/plugins/printsupport
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2019-10-141-3/+1
|\ | | | | | | Change-Id: I4a78428a8ea273b6960792e3b8043f816fa37fcf
| * Merge remote-tracking branch 'origin/5.13' into 5.14Liang Qi2019-09-041-3/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/codecs/qicucodec.cpp src/dbus/qdbusserver.cpp src/gui/painting/qbezier.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp src/plugins/printsupport/cups/qppdprintdevice.cpp Change-Id: I2703128bb64baf5580fbc2c2061b55b0f0611d2a
| | * Fix -no-feature-mimetype buildAllan Sandfeld Jensen2019-08-191-3/+3
| | | | | | | | | | | | | | | Change-Id: I282f630d6e8a0b2b10fd1286d7a185a068abc9f1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | | Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-10-111-0/+2
|\| | | | | | | | | | | Change-Id: I3a1d7673c3c20019ab12a2ea0a60f1619920a34c
| * | Fix build without features.mimetypeTasuku Suzuki2019-08-201-0/+2
| | | | | | | | | | | | | | | Change-Id: I9d3c20845b9ddecbafd6dfd756c5d17ae0c6b5fc Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | Regenerate printsupport pluginsAlexandru Croitor2019-10-084-12/+58
| | | | | | | | | | | | | | | | | | Change-Id: I3820d86bf4a36dd8ea53e5847c8d4de4b1ea9c61 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* | | cmake: Add missing CLASS_NAMEAlbert Astals Cid2019-10-031-0/+1
| | | | | | | | | | | | | | | | | | Change-Id: I5853578f427ae1d1b32ee5405694c216e2dd17cf Reviewed-by: Qt CMake Build Bot Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | Add CMakeLists.txt for cocoa printsupport plug-inJean-Michaël Celerier2019-09-242-1/+26
| | | | | | | | | | | | | | | | | | | | | Change-Id: I0cc8b2827e0986d9ef486f327e7d84362e7d99c4 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2019-06-031-1/+2
|\| | | | | | | | | | | | | | | | | Take 5. Change-Id: Ifb2d20e95ba824e45e667fba6c2ba45389991cc3
| * | Migrate Windows system libs to external dependenciesJoerg Bornemann2019-05-081-1/+2
| |/ | | | | | | | | | | Started-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Change-Id: I211ce3252b836894aeeac1c85eb316d9596bca57 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | Write find_dependency() calls in Qt Module config filesAlexandru Croitor2019-05-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change introduces a new function called qt_find_package() which can take an extra option called PROVIDED_TARGETS, which associates targets with the package that defines those targets. This is done by setting the INTERFACE_QT_PACKAGE_NAME and INTERFACE_QT_PACKAGE_VERSION properties on the imported targets. This information allows us to generate appropriate find_dependency() calls in a module's Config file for third party libraries. For example when an application links against QtCore, it should also link against zlib and atomic libraries. In order to do that, the library locations first have to be found by CMake. This is achieved by embedding find_dependency(ZLIB) and find_dependency(Atomic) in Qt5CoreDependencies.cmake which is included by Qt5CoreConfig.cmake. The latter is picked up when an application project contains find_package(Qt5Core), and thus all linking dependencies are resolved. The information 'which package provides which targets' is contained in the python json2cmake conversion script. The generated output of the script contains qt_find_package() calls that represent that information. The Qt5CoreDependencies.cmake file and which which dependencies it contains is generated at the QtPostProcess stop. Note that for non-static Qt builds, we only need to propagate public 3rd party libraries. For static builds, we need all third party libraries. In order for the INTERFACE_QT_PACKAGE_NAME property to be read in any scope, the targets on which the property is set, have to be GLOBAL. Also for applications and other modules to find all required third party libraries, we have to install all our custom Find modules, and make sure they define INTERFACE IMPORTED libraries, and not just IMPORTED libraries. Change-Id: I694d6e32d05b96d5e241df0156fc79d0029426aa Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* | Merge commit 'dev' into 'wip/cmake-merge'Tobias Hunger2019-04-166-6/+20
|\| | | | | | | Change-Id: I176c40d031be26a1dd1cf08843e448a660598783
| * Use Q_DISABLE_COPY_MOVE for private classesFriedemann Kleint2018-12-122-3/+3
| | | | | | | | | | Change-Id: I3cfcfba892ff4a0ab4e31f308620b445162bb17b Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
| * Fix QPpdPrintDevice::isDefaultAlbert Astals Cid2018-11-293-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | How to test: * Have two printers * Use lpoptions -d to set the default printer to be one and then the other * Use lpstat -d to check setting the default printer worked * Use this simple test program and check the resulting values make sense qDebug() << "DefaultPrinter" << QPrinterInfo::defaultPrinter().printerName(); const QList<QPrinterInfo> list = QPrinterInfo::availablePrinters(); for(const QPrinterInfo &pi : list) { qDebug() << pi.printerName() << pi.isDefault(); } Fixes: QTBUG-70317 Change-Id: I535d11451c568630a374f5c37d8cac32cbb6d3ab Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
| * Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-10-172-2/+2
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platformthemes/platformthemes.pro src/printsupport/kernel/qplatformprintdevice.cpp Change-Id: Iac01729ad954bb1c7af5867d982eb243b2139ee6
| | * Modernize the "mimetype" featureLiang Qi2018-10-122-2/+2
| | | | | | | | | | | | | | | | | | Change-Id: I9b67c2cbc0891a38ece18d521c86fbc7344dce7a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | | cmake: Find Cups and enable its pluginAlbert Astals Cid2019-02-122-0/+39
|/ / | | | | | | | | Change-Id: I44bf176587331d86eb147d106f28deb0a6618ab4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Remove some misplaced sizeof() scalings on array sizes for new[]Edward Welbourne2018-09-031-2/+2
| | | | | | | | | | | | | | | | | | | | Noticed during review of clang-tidy warnings. I have searched the source tree (using grep) and only this one file contains examples of this mistake. Change-Id: I3bbcec736e5a184db7251962fd3671a21ab5d238 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Windows code: Fix clang-tidy warnings about (private) class definitionsFriedemann Kleint2018-09-021-1/+2
| | | | | | | | | | | | | | | | | | | | | | Add override, disable copies where appropriate and use = default for trivial functions. Change-Id: Ia5bc7419b1aa053c5503ea7dfaf11cb6dfafd2e2 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Windows code: Fix clang-tidy warnings about C-style castsFriedemann Kleint2018-08-302-9/+14
| | | | | | | | | | | | | | | | | | | | | | 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>
* | cups: Add a QT_CONFIG(dialogbuttonbox) guardTamas Zakor2018-08-231-0/+6
| | | | | | | | | | | | | | | | | | | | This fixes build with -no-feature-action configuration. The corresponding dialog is added by: 6c5c1a562c cups: Show a dialog when asked for password Change-Id: Ic88bdd62c756749959e66252427b5edc2c3ce7cc Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Windows: Cache the printer capability information the first timeAndy Shaw2018-07-202-10/+167
| | | | | | | | | | | | | | | | | | | | 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>
* | Merge "Merge remote-tracking branch 'origin/5.11' into dev" into ↵Liang Qi2018-05-031-1/+4
|\ \ | | | | | | | | | refs/staging/dev
| * | 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>
* | | cups: Show a dialog when asked for passwordAlbert Astals Cid2018-05-031-0/+72
|/ / | | | | | | | | | | | | | | | | Otherwise the default cups implementation is used, that is, asking for the password on the command line, which is probably not what our users expect. Change-Id: Ib563d542fee71c13ed23b1a99fbe06a7d4d4eadf Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | q{cocoa,ppd}printdevice: Fix string comparisonMichael Weghorn2018-04-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'QPrint::Color' should be returned in case 'ColorModel' is NOT set to 'Gray'. However, the logic was inverted before, since 'qstrcmp()' returns 0 if the two strings match. Also, eliminate a redundant condition: The left-hand side of the '||' already makes sure that 'colorModel' is non-null, so there's no need to check again. (Corresponding cppcheck warning: "Redundant condition: colorModel. '!A || (A && B)' is equivalent to '!A || B'") Change-Id: I965c29e8c020bc9c47a53678e23d94f05be3fd53 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | cups: Support raw printersAlbert Astals Cid2018-04-042-13/+12
| | | | | | | | | | | | | | | | 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>
* | QPpdPrintDevice: Move loadPrinter code to the constructorAlbert Astals Cid2018-04-042-34/+19
| | | | | | | | | | | | | | It was only called from it and makes the code simpler by not having to have the code to free the ppd, etc Change-Id: I4351f9906757b666255b7c31b4c1d8aecf6e873b Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | cups: Honor installable options for DuplexAlbert Astals Cid2018-03-271-3/+7
| | | | | | | | | | | | | | | | | | | | | | i.e. don't show the duplex options if you don't have the duplexer hardware installed, otherwise you just get a conflict warning selecting any duplex option which doesn't make any sense since it's not something you can fix by other means than going out and buying the missing hardware Change-Id: Ief3fea5b86ab65b18765887b1c5d6d279ee337fa Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Remove unused QPpdPrintDevice constructorAlbert Astals Cid2018-03-232-8/+0
| | | | | | | | | | Change-Id: I19a6cddebfbd1b72f01feae8873a634348cdc926 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | Move duplex member from QPdfPrintEnginePrivate to QCupsPrintEnginePrivateAlbert Astals Cid2018-02-202-1/+7
|/ | | | | | | | 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>
* Remove QCupsPrintEnginePrivate::setupDefaultPrinterAlbert Astals Cid2018-02-052-33/+0
| | | | | | | it was declared but never used Change-Id: Iededb2943759cd2d66de95bcc1758dbcc4283ee3 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* CUPS: Don't show choices that conflict with the printer installed optionsAlbert Astals Cid2018-01-122-2/+14
| | | | | | | | | | 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>
* Fix custom page size handling in the Unix print dialogAlbert Astals Cid2018-01-091-3/+2
| | | | | | | | | | | | | | | | | 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>
* CUPS: Fix conflict handlingAlbert Astals Cid2018-01-051-2/+4
| | | | | | | | | | | 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>
* Fix print to a printer instanceRenato Araujo Oliveira Filho2017-12-191-2/+5
| | | | | | | | | | | | | | Make sure to use the printer original name as 'cupsPrintFile' function argument Testing: - Create a instance of your print with lpoptions - Try print a document using the new instance of the printer - Check if the instance properties was respected Change-Id: I884b641d1871fe04c7b119c82d4edb4aa41db2f5 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* Add i18n support for cups advance optionsRenato Araujo Oliveira Filho2017-12-191-0/+1
| | | | | | | | Used 'ppdLocalize' to translate cups options Change-Id: I7fea7c26194fd6c6ee62a17d3e35d7c2c5be6d3c Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* CUPS: Use printer job-hold-until as default instead of the noholdAlbert Astals Cid2017-12-191-0/+2
| | | | | | | 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-181-0/+2
| | | | | | | | 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-181-0/+2
| | | | | | | | 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>
* CUPS: Use default cups job-priority instead of 50Albert Astals Cid2017-12-181-0/+2
| | | | | | | | 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>
* CUPS: Fix lpoptions file not being taken into accountAlbert Astals Cid2017-12-181-1/+2
| | | | | | | | | | | This is actually two fixes. * We need to call cupsMarkOptions * CUPS differentiates between the "" and the nullptr instance, so we need to change the call to cupsGetNamedDest accordingly Change-Id: If2692e405b6b71f8ee91362e6e72eabd9202d704 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* Allow access to ppd file and ppdMarkOption via ↵Albert Astals Cid2017-12-132-0/+24
| | | | | | | QPpdPrintDevice::property/setProperty Change-Id: I47b49b52121950fa8e3ea7a056974d9f3033490f Reviewed-by: Liang Qi <liang.qi@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devAllan Sandfeld Jensen2017-10-241-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/windows/qwindowsmousehandler.cpp src/plugins/platforms/xcb/qxcbimage.cpp tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp tests/manual/qtabletevent/regular_widgets/main.cpp Done-with: Friedemann Kleint<Friedemann.Kleint@qt.io> Done-with: Mårten Nordheim<marten.nordheim@qt.io> Change-Id: I5b2499513a92c590ed0756f7d2e93c35a64b7f30
| * Cups: Check the created QPrintDevice is valid before using itAndy Shaw2017-09-261-1/+1
| | | | | | | | | | | | Task-number: QTBUG-63293 Change-Id: Ibde0e8db955f6f3647b31cef8561d0744754cec1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Replace Q_NULLPTR with nullptr where possibleKevin Funk2017-09-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Remaining uses of Q_NULLPTR are in: src/corelib/global/qcompilerdetection.h (definition and documentation of Q_NULLPTR) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: If6b074d91486e9b784138f4514f5c6d072acda9a Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Replace Q_DECL_OVERRIDE with override where possibleKevin Funk2017-09-196-47/+47
|/ | | | | | | | | | | | | | | | Remaining uses of Q_DECL_OVERRIDE are in: src/corelib/global/qcompilerdetection.h src/corelib/global/qglobal.cpp doc/global/qt-cpp-defines.qdocconf (definition and documentation of Q_DECL_OVERRIDE) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: Ib9b05d829add69e98a86238274b6a1fcb19b49ba Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Initialize the print engine with the given printer nameAndy Shaw2017-08-256-9/+9
| | | | | | | | | | | Originally when the QPrinter was created it would create the engine with the default printer and then change it afterwards even though the desired printer may already be known here. So by passing the printer name we ensure that it is initialized with the desired one right away. Task-number: QTBUG-62221 Change-Id: Iaa90243708b57bf89354a527a982ac45c991f603 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Windows Printer: Handle no default printer caseDaniel Teske2017-07-191-1/+3
| | | | | | | | | GetDefaultPrinter can return ERROR_FILE_NOT_FOUND. In that case just return a empty string. Task-number: QTBUG-53290 Change-Id: Ib0e28b3425d100bc185d1d8827dc6b7fd90cbbeb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>