summaryrefslogtreecommitdiffstats
path: root/tests/auto/printsupport
Commit message (Collapse)AuthorAgeFilesLines
* Remove the remaining usages of deprecated APIs of qtbaseSona Kurazyan2019-08-011-0/+4
| | | | | | | | | This change removes the leftovers form other cleanup commits. Task-number: QTBUG-76491 Change-Id: I61440f87c5a280f9666b78e19aac4d8ac603767e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* test: migrate QPrinterInfo test to QRegularExpressionSamuel Gaist2019-06-111-11/+12
| | | | | | | | | | | | | | | | This is part of the migration of qtbase from QRexExp to QRegularExpression. Task-number: QTBUG-72587 Change-Id: I949479066e114af0af85b6e62d90fd56b9c80077 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Tests: Fix some warnings about deprecated functions not under testFriedemann Kleint2019-05-272-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix warnings like: baselineserver/shared/baselineprotocol.cpp:295:72: warning: ‘int QImage::byteCount() const’ is deprecated: Use sizeInBytes [-Wdeprecated-declarations] tst_qnetworkreply.cpp:1560:17: warning: ‘static QList<QSslCertificate> QSslSocket::defaultCaCertificates()’ is deprecated [-Wdeprecated-declarations] tst_qnetworkreply.cpp:1560:39: warning: ‘static QList<QSslCertificate> QSslSocket::defaultCaCertificates()’ is deprecated [-Wdeprecated-declarations] tst_qnetworkreply.cpp:8153:60: warning: ‘T* QWeakPointer<T>::data() const [with T = const QNetworkSession]’ is deprecated: Use toStrongRef() instead, and data() on the returned QSharedPointer [-Wdeprecated-declarations]. ... st_qprinter.cpp:1318:74: warning: ‘QList<QPagedPaintDevice::PageSize> QPrinterInfo::supportedPaperSizes() const’ is deprecated [-Wdeprecated-declarations] tst_qprinter.cpp:1362:74: warning: ‘QList<QPagedPaintDevice::PageSize> QPrinterInfo::supportedPaperSizes() const’ is deprecated [-Wdeprecated-declarations] tst_largefile.cpp:492:85: warning: ‘bool qEqual(InputIterator1, InputIterator1, InputIterator2) [with InputIterator1 = char*; InputIterator2 = char*]’ is deprecated: Use std::equal [-Wdeprecated-declarations] tst_largefile.cpp:498:91: warning: ‘bool qEqual(InputIterator1, InputIterator1, InputIterator2) [with InputIterator1 = char*; InputIterator2 = char*]’ is deprecated: Use std::equal [-Wdeprecated-declarations] tst_qabstractitemmodel.cpp:312:25: warning: ‘void QAbstractItemModel::reset()’ is deprecated [-Wdeprecated-declarations] ... tst_qabstractitemmodel.cpp:1793:28: warning: ‘void QAbstractItemModel::setRoleNames(const QHash<int, QByteArray>&)’ is deprecated [-Wdeprecated-declarations] ... tst_qcolor.cpp:1425:33: warning: ‘QColor QColor::light(int) const’ is deprecated: Use QColor::lighter() instead [-Wdeprecated-declarations] tst_qcolor.cpp:1432:31: warning: ‘QColor QColor::dark(int) const’ is deprecated: Use QColor::darker() instead [-Wdeprecated-declarations] tst_qprinterinfo.cpp:303:61: warning: 'QList<QPagedPaintDevice::PageSize> QPrinterInfo::supportedPaperSizes() const' is deprecated [-Wdeprecated-declarations] tst_qprinterinfo.cpp:304:65: warning: 'QList<QPair<QString, QSizeF> > QPrinterInfo::supportedSizesWithNames() const' is deprecated [-Wdeprecated-declarations] tst_qtextdocumentfragment.cpp:947:52: warning: ‘QString QTextCharFormat::anchorName() const’ is deprecated: Use anchorNames() instead [-Wdeprecated-declarations] tst_qtextlayout.cpp:2261:61: warning: ‘void QTextLayout::setAdditionalFormats(const QList<QTextLayout::FormatRange>&)’ is deprecated: Use setFormats() [-Wdeprecated-declarations] tst_qtextlayout.cpp:2330:42: warning: ‘int QFontMetrics::width(const QString&, int) const’ is deprecated: Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations] tst_qitemselectionmodel.cpp:2214:37: warning: ‘QModelIndex QModelIndex::child(int, int) const’ is deprecated: Use QAbstractItemModel::index [-Wdeprecated-declarations] ... tst_qtextlist.cpp:317:68: warning: 'bool QTextList::isEmpty() const' is deprecated: Use count() instead [-Wdeprecated-declarations] tst_qpainter.cpp:373:32: warning: ‘void QPainter::setMatrixEnabled(bool)’ is deprecated: Use setWorldMatrixEnabled() instead [-Wdeprecated-declarations] tst_qpainter.cpp:374:40: warning: ‘bool QPainter::matrixEnabled() const’ is deprecated: Use worldMatrixEnabled() instead [-Wdeprecated-declarations] tst_qpainter.cpp:702:45: warning: ‘const QBrush& QPalette::background() const’ is deprecated: Use QPalette::window() instead [-Wdeprecated-declarations] tst_qpainter.cpp:1573:29: warning: ‘void QPainter::drawRoundRect(const QRect&, int, int)’ is deprecated: Use drawRoundedRect(..., Qt::RelativeSize) instead [-Wdeprecated-declarations] tst_qpdfwriter.cpp:76:38: warning: ‘virtual void QPdfWriter::setPageSize(QPagedPaintDevice::PageSize)’ is deprecated: Use setPageSize(QPageSize(id)) instead [-Wdeprecated-declarations] tst_qpdfwriter.cpp:81:41: warning: ‘virtual void QPdfWriter::setPageSizeMM(const QSizeF&)’ is deprecated: Use setPageSize(QPageSize(size, QPageSize::Millimeter)) instead [-Wdeprecated-declarations] tst_qpdfwriter.cpp:105:30: warning: ‘virtual void QPdfWriter::setMargins(const QPagedPaintDevice::Margins&)’ is deprecated: Use setPageMargins(QMarginsF(l, t, r, b), QPageLayout::Millimeter) instead [-Wdeprecated-declarations] tst_qpdfwriter.cpp:172:37: warning: ‘virtual void QPdfWriter::setPageSizeMM(const QSizeF&)’ is deprecated: Use setPageSize(QPageSize(size, QPageSize::Millimeter)) instead [-Wdeprecated-declarations] tst_qpdfwriter.cpp:258:38: warning: ‘virtual void QPdfWriter::setPageSize(QPagedPaintDevice::PageSize)’ is deprecated: Use setPageSize(QPageSize(id)) instead [-Wdeprecated-declarations] qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp:3980:54: warning: ‘QModelIndex QModelIndex::child(int, int) const’ is deprecated: Use QAbstractItemModel::index [-Wdeprecated-declarations] tst_qlocale.cpp:434:26: warning: 'QString::null' is deprecated: use QString() [-Wdeprecated-declarations] ... Change-Id: I77c1a934b27119eedeb26a77c913686314a2a5c7 Reviewed-by: David Faure <david.faure@kdab.com>
* tst_QPrinter: stabilize qprinter testChristian Ehrlicher2019-01-201-1/+1
| | | | | | | | | | | The CreationDate entry in the two PDF files can potentially be different depending on when the test is run. 97b4c5a5746a33a27076d72ceb3533fbd54b9642 already accounts for it but the current tag for creation date is '/CreationDate'. Therefore check if the line contains 'CreationDate' instead. Change-Id: I1fc069cf935bba07084ac4a0743ff05312374d10 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-05-031-0/+45
|\ | | | | | | | | | | | | | | | | | | | | | | 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-0/+45
| | | | | | | | | | | | | | | | | | | | | | 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 remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-04-101-1/+5
|\| | | | | | | Change-Id: I0120f804522c0c652e9537b6e9fe08189f071ed2
| * tst_QPrinter: Use qWaitForWindowActive() to wait for dialogKari Oikarinen2018-04-091-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of an unconditional wait. The QSKIP is necessary because the PDF format is non-native and the Windows implementation of QPrintDialog doesn't work then. The macOS implementation has the same warning, so add the check for that OS as well. The test has previously passed, since it hasn't seen not actually opening the dialog as an issue. Change-Id: Ib53e378b232580358f13e0c5206404412f9e6ee2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Fix tst_QAbstractPrintDialog::setMinMaxAlbert Astals Cid2018-03-191-2/+1
| | | | | | | | | | | | Task-number: QTBUG-22637 Change-Id: I954988909f3ecaaf510653bf061096dd61d14fdf Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Move duplex member from QPdfPrintEnginePrivate to QCupsPrintEnginePrivateAlbert Astals Cid2018-02-201-2/+2
|/ | | | | | | | 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>
* Convert features.completer to QT_[REQUIRE_]CONFIGStephan Binner2017-09-041-2/+2
| | | | | Change-Id: If45a46c08b37d245229a39f3d6ffbb34154934f2 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* tst_QPrinter: Share printers in testPageRectAndPaperRect/testMarginFriedemann Kleint2017-08-231-64/+68
| | | | | | | | Speeds up testing by a factor of 2. Task-number: QTBUG-61827 Change-Id: I9d6c9d9786d35af3083bc7e98beb9a79dbcc7e11 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Fix the test for non-English based setupsAndy Shaw2017-08-231-1/+11
| | | | | | | | | Unsetting the SOFTWARE environment variable will force lpstat to use English for the output, so we can ensure that the test will pass regardless of the language used for the machine. Change-Id: Iddf5e8aadaa546ae3e0dd172df84e4e43ee02c2a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* tst_QPrinter: Disambiguate all file namesFriedemann Kleint2017-08-231-38/+25
| | | | | | | | | | | Introduce helper function which uses a number to build unique names. Remove helper for deleting files since it now uses a temporary directory. Add a few cases that were overlooked in 88c68f4d9ed649f444bb22c52595da71ce4aac4e. Task-number: QTBUG-61827 Change-Id: I53355f99ffc3bfe6ad6994a5439710c9fa8cdad5 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* tst_QPrinter: Run in temporary directoryFriedemann Kleint2017-07-031-27/+32
| | | | | Change-Id: I299b740a43926e4af31c70aadda882f87ba9c362 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Require printer config for printsupport auto testsOliver Wolff2017-07-031-0/+2
| | | | | Change-Id: I171c5d642e41480b4feec102dc0095af5f500098 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Convert features.filedialog to QT_[REQUIRE_]CONFIGStephan Binner2017-06-291-2/+2
| | | | | Change-Id: I9bc229b0d1430b81eeb2cfca2b24474736d5d561 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Convert features.printdialog to QT_[REQUIRE_]CONFIGStephan Binner2017-05-301-2/+5
| | | | | Change-Id: Ifb016ae2a0986b436f788b34513c81ea91f3804a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Drop unnecessary dependencies from some testsUlf Hermann2017-01-102-2/+2
| | | | | | | | | The future tests don't need QtConcurrent as QFuture and friends are in QtCore. The printdevice test doesn't use QtNetwork and the lancelot as well as the testlib tests don't use QtXml. Change-Id: I150ac99b36682aa23ad22ba943266eb0f0952838 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-02-291-1/+18
|\ | | | | | | | | | | | | Conflicts: tests/auto/corelib/io/qprocess/tst_qprocess.cpp Change-Id: Ib6955eb874b516b185b45d6c38cec646fbaa95f4
| * QMacPrintEngine: Really set the printer resolutionKai Pastor2016-02-251-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | As already reported in 2009 (Qt 4.6) QPrinter never actually set the printer resolution. This change adds the necessary call to PMPrinterSetOutputResolution (available since OS X 10.5). [ChangeLog][QtPrintSupport][OS X] QMacPrintEngine now really sets the printer resolution. Task-number: QTBUG-7000 Change-Id: I3e851b62e1a7ed78564a8a6fd576b0a18d7eff63 Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-214-67/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I42a473ddc97101492a60b9287d90979d9eb35ae1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-11-182-7/+4
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qprocess.cpp src/corelib/io/qprocess_unix.cpp src/network/kernel/qnetworkinterface_winrt.cpp tools/configure/configureapp.cpp Change-Id: I47df00a01597d2e63b334b492b3b4221b29f58ea
| * Fix tst_QPrinter::doubleSidedPrinting() test and remove from blacklistAndy Shaw2015-11-062-7/+4
| | | | | | | | | | Change-Id: If96471ed3324795086c5ff951d9332a0e82870ea Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-11-041-0/+3
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/unix/ptrsize.test configure src/corelib/global/qnamespace.h src/network/socket/qabstractsocket.cpp tests/auto/other/networkselftest/networkselftest.pro Change-Id: Ic78abb4a34f9068567cea876861d4220f5a07672
| * Blacklist tst_QPrinter::doubleSidedPrinting for msvc 2013Frederik Gladhorn2015-11-031-0/+3
| | | | | | | | | | | | | | | | This test keeps on failing on Windows 8 with 32 bit. Let's add the platform despite this one test failing. Change-Id: Id6a2b3e0b587d3cff29d1f616d5edacfcf68746d Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* | Tests: Remove CONFIG += parallel_test.Friedemann Kleint2015-09-053-3/+0
| | | | | | | | | | | | | | The keyword no longer has a meaning for the new CI. Change-Id: Ibcea4c7a82fb7f982cf4569fdff19f82066543d1 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Remove QT_DISABLE_DEPRECATED_BEFORE=0 from tests not using deprecated API.Friedemann Kleint2015-09-013-3/+0
|/ | | | | Change-Id: I1955320e7639760b4383a53f37a506c8055933ef Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* Various tests: Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b).Friedemann Kleint2015-07-281-3/+3
| | | | | | | | | | | | | | - Replace Q[TRY]_VERIFY(pointer == 0) by Q[TRY]_VERIFY(!pointer). - Replace Q[TRY]_VERIFY(smartPointer == 0) by Q[TRY]_VERIFY(smartPointer.isNull()). - Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b) and add casts where necessary. The values will then be logged should a test fail. in tests/auto/other, tests/auto/printsupport and tests/auto/xml. Change-Id: I28cbdc89d36791f179425f17f90b697c60660938 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* tst_qprintdevice: Extend output.Friedemann Kleint2015-07-171-2/+3
| | | | | | | | | | | | | Show the printer parameters using the new QDebug operator for QPrintDevice for better error analysis in the CI. Produces output: Created printer *HP_Color_LaserJet_CM6030_MFP*: QPrintDevice(id="HP_Color_LaserJet_CM6030_MFP", state=0, name="HP Color LaserJet CM6030 MFP", makeAndModel="HP Color LaserJet CM6030 MFP Postscript (recommended)", default, defaultPageSize=QPageSize("Letter", "Letter", 612x792pt, 2), supportsCustomPageSizes, physicalPageSize=(278, 396)..(907, 1296), defaultResolution=600, defaultDuplexMode=0, defaultColorMode=1, supportedMimeTypes=( "application/pdf" "application/postscript" "image/gif" "image/png" "image/jpeg" "image/tiff" "text/html" "text/plain")) Task-number: QTBUG-47246 Change-Id: I5245d19ecf958a730a0288d5eff2d24fc3064a55 Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-114-27/+27
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Fix QPrinter::setPaperSize regression when using QPrinter::DevicePixelDavid Faure2015-01-191-1/+11
| | | | | | | | | | | The QPageSize-based refactoring led to casting DevicePixel to a QPageSize::Unit value of 6 (out of bounds). And then the switch in qt_nameForCustomSize would leave the string empty, leading to "QString::arg: Argument missing: , 672" warnings. Change-Id: I85e97174cc8ead9beccaaa3ded6edfad80f8e360 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* Change bugreports.qt-project.org -> bugreports.qt.ioAlex Blasche2014-12-181-1/+1
| | | | | | | The Qt bug tracker URL changes as part of the qt.io transition Change-Id: Icb4ab198943b93639b5e3a8d99262303785c6459 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Make it possible to disable font embeddingEskil Abrahamsen Blomfeldt2014-11-151-15/+5
| | | | | | | | | | | | | | | | When font embedding is explicitly disabled, fall back to painter paths as we would if the font prohibits embedding. Note that this flag was never respected on any platform in any version of Qt, as far as I've been able to tell, because the handling of it in the X11 print engine was removed shortly after it was introduced in 2005. [ChangeLog][Printing] Disabling font embedding is now possible using the QPrinter::setFontEmbedding() function. Task-number: QTBUG-41943 Change-Id: Ice5e893f9893c5243310ae7892bec7497dd55c4a Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QPrinter - Fix DuplexMode on all platformsJohn Layt2014-10-242-20/+34
| | | | | | | | | | | | | Add support to get/set the DuplexMode on Windows and Mac, improve the CUPS duplex handling, ensure support is the same on all platforms. [ChangeLog][QtPrintSupport][QPrinter] Added duplex support for Windows and OS X. Task-number: QTBUG-11332 Change-Id: I9d61d63233d828c3b1fd6df54072c6049f3c6298 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Update license headers and add new license filesMatti Paaso2014-09-244-75/+43
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* QPrinter - Expect failure of QPrinter page size testJohn Layt2014-03-171-1/+4
| | | | | | | | | | The page size test can get confused when two printer papers have the same size, but the code being tested is actaully correct. Put a temp QEXPECT_FAIL on the test and some debug statements so we can see why it fails and fix the test as required. Change-Id: I160ba2ed7344500d89bdcb9bb416863713fef84b Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QtPrintSupport - Fix QT_NO_PRINTER buildJohn Layt2014-03-171-0/+2
| | | | | | | | Fix the QT_NO_PRINTER build for issues that have accumulated over last few months, and in the new changes already approved. Change-Id: I9aed21dee861837fd1a68a96692c873a4f5be293 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QPrinter - Fix winPageSize() on Mac and LinuxJohn Layt2014-03-171-13/+17
| | | | | | | | | Using QPageSize internally provides the Windows ID on all platforms so remove the conditional compile on the QPrinter api and add support to the print engines. Change-Id: I31e23d5090a9b6ceb087c29dead050b0ee1855a5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QPrinter - Use QPageSize and QPageLayoutJohn Layt2014-03-171-104/+54
| | | | | | | | | | | | | | | | | Use QPageSize and QPageMargins to get/set values in the print engines, add api to directly set the values, and rewrite the docs to make the paper-based api obsolete instead of the page-based api. Add new PPK keys to pass QPageSize, QPageMargins and QPageLayout to the print engines to ensure no level of detail is lost, e.g. for custom sizes passed to QPrinter. [ChangeLog][QtPrintSupport][QPrinter] QPrinter can now use QPageSize and QPageLayout in the public api to control the page layout for a print job. Change-Id: Iee39a4042bcd6141d29b0a82b49066d7a7a78120 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QPrintEngine - Switch Windows to QPlatformPrintDeviceJohn Layt2014-03-171-39/+8
| | | | | | | | | | Change the Windows QPrintEngine implementation to use the QPlatformPrintDevice to obtain device information, and use QPageSize to obtain page size conversions. A following change will use QPageLayout to store that page size. Change-Id: I990943e2b62ab6dab2c4d4a292c7ed7261beadf2 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QPrinterInfo - Switch to QPlatformPrintDeviceJohn Layt2014-03-172-30/+72
| | | | | | | | | | | | | | | | | | | Change the QPrinterInfo implementation to use QPlatformPrintDevice as the backend. Remove all the old QPrinterInfo related code from the QPA plugin. Add public api to QPrinterInfo to support some features from QPlatformPrintDevice. [ChangeLog][QtPrintSupport][QPrinterInfo] Added new public api for isRemote(), state(), defaultPageSize(), supportedPageSizes(), supportsCustomPageSizes(), minimumPhysicalPageSize(), maximumPhysicalPageSize(), supportedResolutions(), availablePrinterNames(), and defaultPrinterName(). The use of availablePrinters() is discouraged due to performance concerns. Task-number: QTBUG-35248 Change-Id: Ic38323a930549ad67bf04a1a6bb43d623dfe6a33 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QPlatformPrintDevice - New QPA base classJohn Layt2014-03-174-0/+120
| | | | | | | | | | Add a new QPA class to abstract Print Devices. Each platform instance will encapsulate all required details about a print device instead of the code being distributed throughout the print engine and print plugin. Change-Id: I7f6a537ad55a6e7f599d83f461b1e2ee62b15094 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QPrinter - Add page metric testsJohn Layt2014-03-171-64/+220
| | | | | | | | | | | | | Add more page metrics tests to expose the many bugs and inconsistencies in the page layout handling. No platform or pdf backend passes all these tests so they are skipped for now, but following commits will use the tests to ensure the re-write of the page layout handling fixes the many problems in a consistent way for all backends. Change-Id: Ic5b16aa08dfe2bd9a9191662fd2bbe6b913e15c9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* QPrinter - Add more testsJohn Layt2014-02-261-6/+25
| | | | | | | Add more missing tests. Change-Id: I801c5c67731075ccb3e62377c0eccc420e708365 Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* Remove qSort usages from testsSergio Ahumada2014-02-201-2/+4
| | | | | | | | | QtAlgorithms is getting deprecated, see http://www.mail-archive.com/development@qt-project.org/msg01603.html Change-Id: I4c48db80533802e37771d3967fa10bfb7000cb9a Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* QPrinter - Fix Printer Selection option on WindowsJohn Layt2014-02-051-5/+3
| | | | | | | | | 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-051-5/+2
| | | | | | | | 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-051-17/+14
| | | | | | | | | | | | | | | | | 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-9/+2
| | | | | | | | | | | | | | | | 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>