Ignore:
Timestamp:
Feb 4, 2010, 8:08:50 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

examples: Added #ifndef QT_NO_PRINTER around QPrinter-related parts to some examples to make them build on platforms with no printer support.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/painting/fontsampler/mainwindow.cpp

    r2 r516  
    221221void MainWindow::on_printAction_triggered()
    222222{
     223
    223224    pageMap = currentPageMap();
    224225
     
    237238
    238239    printDocument(&printer);
     240
    239241}
    240242
    241243void MainWindow::printDocument(QPrinter *printer)
    242244{
     245
    243246    printer->setFromTo(1, pageMap.count());
    244247
     
    269272
    270273    painter.end();
     274
    271275}
    272276
    273277void MainWindow::on_printPreviewAction_triggered()
    274278{
     279
    275280    pageMap = currentPageMap();
    276281
     
    283288            this, SLOT(printDocument(QPrinter *)));
    284289    preview.exec();
     290
    285291}
    286292
     
    310316void MainWindow::printPage(int index, QPainter *painter, QPrinter *printer)
    311317{
     318
    312319    QString family = pageMap.keys()[index];
    313320    StyleItems items = pageMap[family];
     
    371378
    372379    painter->restore();
    373 }
     380#endif   
     381}
Note: See TracChangeset for help on using the changeset viewer.