Changeset 516 for trunk/examples


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.

Location:
trunk/examples
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/dialogs/licensewizard/licensewizard.cpp

    r2 r516  
    352352void ConclusionPage::printButtonClicked()
    353353{
     354#ifndef QT_NO_PRINTER
    354355    QPrinter printer;
    355356    QPrintDialog dialog(&printer, this);
     
    358359                             tr("As an environmentally friendly measure, the "
    359360                                "license text will not actually be printed."));
    360 }
     361#endif
     362}
  • trunk/examples/painting/fontsampler/mainwindow.cpp

    r2 r516  
    221221void MainWindow::on_printAction_triggered()
    222222{
     223#if !defined(QT_NO_PRINTER)
    223224    pageMap = currentPageMap();
    224225
     
    237238
    238239    printDocument(&printer);
     240#endif
    239241}
    240242
    241243void MainWindow::printDocument(QPrinter *printer)
    242244{
     245#if !defined(QT_NO_PRINTER)
    243246    printer->setFromTo(1, pageMap.count());
    244247
     
    269272
    270273    painter.end();
     274#endif
    271275}
    272276
    273277void MainWindow::on_printPreviewAction_triggered()
    274278{
     279#if !defined(QT_NO_PRINTER)
    275280    pageMap = currentPageMap();
    276281
     
    283288            this, SLOT(printDocument(QPrinter *)));
    284289    preview.exec();
     290#endif   
    285291}
    286292
     
    310316void MainWindow::printPage(int index, QPainter *painter, QPrinter *printer)
    311317{
     318#if !defined(QT_NO_PRINTER)
    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.