Changeset 561 for trunk/src/gui/painting/qprinter.cpp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/gui/painting/qprinter.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 269 269 \brief The QPrinter class is a paint device that paints on a printer. 270 270 271 \ingroup multimedia272 \mainclass 271 \ingroup printing 272 273 273 274 274 This device represents a series of pages of printed output, and is … … 285 285 the printProgram() function can be used to specify the command or utility 286 286 to use instead of the system default. 287 288 Note that setting parameters like paper size and resolution on an 287 288 Note that setting parameters like paper size and resolution on an 289 289 invalid printer is undefined. You can use QPrinter::isValid() to 290 290 verify this before changing any parameters. … … 481 481 \value A8 52 x 74 mm 482 482 \value A9 37 x 52 mm 483 \value B0 10 30 x 1456mm484 \value B1 7 28 x 1030 mm485 \value B 10 32 x 45mm486 \value B 2 515 x 728mm487 \value B 3 364 x 515mm488 \value B 4 257 x 364 mm489 \value B 5 182 x 257 mm, 7.17 x 10.13 inches490 \value B 6 128 x 182mm491 \value B 7 91 x 128 mm492 \value B 8 64 x 91mm493 \value B 9 45 x 64 mm483 \value B0 1000 x 1414 mm 484 \value B1 707 x 1000 mm 485 \value B2 500 x 707 mm 486 \value B3 353 x 500 mm 487 \value B4 250 x 353 mm 488 \value B5 176 x 250 mm, 6.93 x 9.84 inches 489 \value B6 125 x 176 mm 490 \value B7 88 x 125 mm 491 \value B8 62 x 88 mm 492 \value B9 33 x 62 mm 493 \value B10 31 x 44 mm 494 494 \value C5E 163 x 229 mm 495 495 \value Comm10E 105 x 241 mm, U.S. Common 10 Envelope 496 496 \value DLE 110 x 220 mm 497 \value Executive 7.5 x 10 inches, 19 1x 254 mm497 \value Executive 7.5 x 10 inches, 190.5 x 254 mm 498 498 \value Folio 210 x 330 mm 499 \value Ledger 43 2 x 279mm500 \value Legal 8.5 x 14 inches, 21 6 x 356 mm501 \value Letter 8.5 x 11 inches, 21 6 x 279mm502 \value Tabloid 279 x 432mm499 \value Ledger 431.8 x 279.4 mm 500 \value Legal 8.5 x 14 inches, 215.9 x 355.6 mm 501 \value Letter 8.5 x 11 inches, 215.9 x 279.4 mm 502 \value Tabloid 279.4 x 431.8 mm 503 503 \value Custom Unknown, or a user defined size. 504 504 … … 713 713 delete d->previewEngine; 714 714 #endif 715 delete d;716 715 } 717 716 … … 745 744 #ifndef QT_NO_PDF 746 745 Q_D(QPrinter); 747 if (d-> outputFormat == format)746 if (d->validPrinter && d->outputFormat == format) 748 747 return; 749 748 d->outputFormat = format; … … 774 773 delete oldPrintEngine; 775 774 776 d->validPrinter = d->outputFormat == QPrinter::PdfFormat || d->outputFormat == QPrinter::PostScriptFormat;777 775 if (d->outputFormat == QPrinter::PdfFormat || d->outputFormat == QPrinter::PostScriptFormat) 776 d->validPrinter = true; 778 777 #else 779 778 Q_UNUSED(format); … … 794 793 795 794 796 /*! \reimp */ 795 /*! \internal 796 */ 797 797 int QPrinter::devType() const 798 798 { … … 835 835 836 836 QList<QPrinterInfo> prnList = QPrinterInfo::availablePrinters(); 837 d->validPrinter = false; 838 for (int i = 0; i < prnList.size(); ++i) { 839 if (prnList[i].printerName() == name) { 840 d->validPrinter = true; 841 break; 837 if (name.isEmpty()) { 838 d->validPrinter = d->outputFormat == QPrinter::PdfFormat || d->outputFormat == QPrinter::PostScriptFormat; 839 } else { 840 d->validPrinter = false; 841 for (int i = 0; i < prnList.size(); ++i) { 842 if (prnList[i].printerName() == name) { 843 d->validPrinter = true; 844 break; 845 } 842 846 } 843 847 } … … 1272 1276 explicit call to the print code for each copy. 1273 1277 1274 \sa setNumCopies() 1278 \sa setNumCopies(), actualNumCopies() 1275 1279 */ 1276 1280 … … 1280 1284 return d->printEngine->property(QPrintEngine::PPK_NumberOfCopies).toInt(); 1281 1285 } 1286 1287 1288 /*! 1289 \since 4.6 1290 1291 Returns the number of copies that will be printed. The default 1292 value is 1. 1293 1294 This function always returns the actual value specified in the print 1295 dialog or using setNumCopies(). 1296 1297 \sa setNumCopies(), numCopies() 1298 */ 1299 int QPrinter::actualNumCopies() const 1300 { 1301 Q_D(const QPrinter); 1302 return qt_printerRealNumCopies(d->paintEngine); 1303 } 1304 1282 1305 1283 1306 … … 1305 1328 Returns true if collation is turned on when multiple copies is selected. 1306 1329 Returns false if it is turned off when multiple copies is selected. 1330 When collating is turned off the printing of each individual page will be repeated 1331 the numCopies() amount before the next page is started. With collating turned on 1332 all pages are printed before the next copy of those pages is started. 1307 1333 1308 1334 \sa setCollateCopies() … … 1658 1684 const qreal multiplier = qt_multiplierForUnit(unit, resolution()); 1659 1685 QList<QVariant> margins(d->printEngine->property(QPrintEngine::PPK_PageMargins).toList()); 1660 *left = margins.at(0).to Double() / multiplier;1661 *top = margins.at(1).to Double() / multiplier;1662 *right = margins.at(2).to Double() / multiplier;1663 *bottom = margins.at(3).to Double() / multiplier;1686 *left = margins.at(0).toReal() / multiplier; 1687 *top = margins.at(1).toReal() / multiplier; 1688 *right = margins.at(2).toReal() / multiplier; 1689 *bottom = margins.at(3).toReal() / multiplier; 1664 1690 } 1665 1691 … … 2155 2181 2156 2182 /*! 2157 Use QPrintDialog:: addEnabledOption(QPrintDialog::PrintCollateCopies)2158 or QPrintDialog::set EnabledOptions(QPrintDialog::enabledOptions()2183 Use QPrintDialog::setOption(QPrintDialog::PrintCollateCopies) 2184 or QPrintDialog::setOptions(QPrintDialog::options() 2159 2185 & ~QPrintDialog::PrintCollateCopies) instead, depending on \a 2160 2186 enable. … … 2197 2223 \reentrant 2198 2224 2199 \ingroup multimedia2225 \ingroup printing 2200 2226 2201 2227 \brief The QPrintEngine class defines an interface for how QPrinter
Note:
See TracChangeset
for help on using the changeset viewer.