Changeset 846 for trunk/src/gui/painting/qprinter.cpp
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/painting/qprinter.cpp
r782 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 159 159 } 160 160 161 162 // returns the actual num copies set on a printer, not163 // the number that is documented in QPrinter::numCopies()164 int qt_printerRealNumCopies(QPaintEngine *engine)165 {166 int numCopies = 1;167 if (engine->type() == QPaintEngine::PostScript168 || engine->type() == QPaintEngine::Pdf)169 {170 QPdfBaseEngine *base = static_cast<QPdfBaseEngine *>(engine);171 numCopies = base->d_func()->copies;172 }173 #ifdef Q_WS_WIN174 else if (engine->type() == QPaintEngine::Windows) {175 QWin32PrintEngine *base = static_cast<QWin32PrintEngine *>(engine);176 numCopies = base->d_func()->num_copies;177 }178 #endif179 return numCopies;180 }181 182 161 void QPrinterPrivate::createDefaultEngines() 183 162 { … … 304 283 \i setFullPage() tells QPrinter whether you want to deal with the 305 284 full page or just with the part the printer can draw on. 306 \i set NumCopies() tells QPrinter how many copies of the document285 \i setCopyCount() tells QPrinter how many copies of the document 307 286 it should print. 308 287 \endlist … … 405 384 \value Selection Only the selection should be printed. 406 385 \value PageRange The specified page range should be printed. 386 \value CurrentPage Only the current page should be printed. 407 387 408 388 \sa QAbstractPrintDialog::PrintRange … … 594 574 \value Selection Only the selection should be printed. 595 575 \value PageRange Print according to the from page and to page options. 576 \value CurrentPage Only the current page should be printed. 596 577 597 578 \sa setPrintRange(), printRange() … … 609 590 \value PrintPageRange Describes if printing page ranges (from, to) should 610 591 be enabled 592 \value PrintCurrentPage if Print Current Page option should be enabled 611 593 612 594 \sa setOptionEnabled(), isOptionEnabled() … … 756 738 757 739 QPrintEngine *oldPrintEngine = d->printEngine; 758 QPaintEngine *oldPaintEngine = d->paintEngine; // same as the above - shouldn't be deleted759 740 const bool def_engine = d->use_default_engine; 760 741 d->printEngine = 0; … … 769 750 // will return 1, disregarding the actual value that was set 770 751 if (key == QPrintEngine::PPK_NumberOfCopies) 771 prop = QVariant( qt_printerRealNumCopies(oldPaintEngine));752 prop = QVariant(copyCount()); 772 753 else 773 754 prop = oldPrintEngine->property(key); … … 1277 1258 1278 1259 /*! 1260 \obsolete 1279 1261 Returns the number of copies to be printed. The default value is 1. 1280 1262 … … 1289 1271 explicit call to the print code for each copy. 1290 1272 1273 Use copyCount() in conjunction with supportsMultipleCopies() instead. 1274 1291 1275 \sa setNumCopies(), actualNumCopies() 1292 1276 */ … … 1300 1284 1301 1285 /*! 1286 \obsolete 1302 1287 \since 4.6 1303 1288 … … 1308 1293 dialog or using setNumCopies(). 1309 1294 1295 Use copyCount() instead. 1296 1310 1297 \sa setNumCopies(), numCopies() 1311 1298 */ 1312 1299 int QPrinter::actualNumCopies() const 1313 1300 { 1314 Q_D(const QPrinter);1315 return qt_printerRealNumCopies(d->paintEngine); 1316 } 1317 1318 1319 1320 /*! 1301 return copyCount(); 1302 } 1303 1304 1305 1306 /*! 1307 \obsolete 1321 1308 Sets the number of copies to be printed to \a numCopies. 1322 1309 1323 1310 The printer driver reads this setting and prints the specified 1324 1311 number of copies. 1312 1313 Use setCopyCount() instead. 1325 1314 1326 1315 \sa numCopies() … … 1335 1324 } 1336 1325 1326 /*! 1327 \since 4.7 1328 1329 Sets the number of copies to be printed to \a count. 1330 1331 The printer driver reads this setting and prints the specified number of 1332 copies. 1333 1334 \sa copyCount(), supportsMultipleCopies() 1335 */ 1336 1337 void QPrinter::setCopyCount(int count) 1338 { 1339 Q_D(QPrinter); 1340 ABORT_IF_ACTIVE("QPrinter::setCopyCount;"); 1341 d->printEngine->setProperty(QPrintEngine::PPK_CopyCount, count); 1342 d->addToManualSetList(QPrintEngine::PPK_CopyCount); 1343 } 1344 1345 /*! 1346 \since 4.7 1347 1348 Returns the number of copies that will be printed. The default value is 1. 1349 1350 \sa setCopyCount(), supportsMultipleCopies() 1351 */ 1352 1353 int QPrinter::copyCount() const 1354 { 1355 Q_D(const QPrinter); 1356 return d->printEngine->property(QPrintEngine::PPK_CopyCount).toInt(); 1357 } 1358 1359 /*! 1360 \since 4.7 1361 1362 Returns true if the printer supports printing multiple copies of the same 1363 document in one job; otherwise false is returned. 1364 1365 On most systems this function will return true. However, on X11 systems 1366 that do not support CUPS, this function will return false. That means the 1367 application has to handle the number of copies by printing the same 1368 document the required number of times. 1369 1370 \sa setCopyCount(), copyCount() 1371 */ 1372 1373 bool QPrinter::supportsMultipleCopies() const 1374 { 1375 Q_D(const QPrinter); 1376 return d->printEngine->property(QPrintEngine::PPK_SupportsMultipleCopies).toBool(); 1377 } 1337 1378 1338 1379 /*! … … 2276 2317 full page or not. 2277 2318 2278 \value PPK_NumberOfCopies An integer specifying the number of2279 copies 2319 \value PPK_NumberOfCopies Obsolete. An integer specifying the number of 2320 copies. Use PPK_CopyCount instead. 2280 2321 2281 2322 \value PPK_Orientation Specifies a QPrinter::Orientation value. … … 2323 2364 \value PPK_PageMargins A QList<QVariant> containing the left, top, 2324 2365 right and bottom margin values. 2366 2367 \value PPK_CopyCount An integer specifying the number of copies to print. 2368 2369 \value PPK_SupportsMultipleCopies A boolean value indicating whether or not 2370 the printer supports printing multiple copies in one job. 2325 2371 2326 2372 \value PPK_CustomBase Basis for extension.
Note:
See TracChangeset
for help on using the changeset viewer.