diff options
Diffstat (limited to 'examples/widgets/painting/fontsampler/mainwindow.cpp')
-rw-r--r-- | examples/widgets/painting/fontsampler/mainwindow.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/examples/widgets/painting/fontsampler/mainwindow.cpp b/examples/widgets/painting/fontsampler/mainwindow.cpp index 5aecea4968..192ffbd369 100644 --- a/examples/widgets/painting/fontsampler/mainwindow.cpp +++ b/examples/widgets/painting/fontsampler/mainwindow.cpp @@ -49,7 +49,9 @@ ****************************************************************************/ #include <QtWidgets> +#if defined(QT_PRINTSUPPORT_LIB) #include <QPrintPreviewDialog> +#endif #include "mainwindow.h" @@ -212,7 +214,7 @@ QMap<QString, StyleItems> MainWindow::currentPageMap() void MainWindow::on_printAction_triggered() { -#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG) +#if defined(QT_PRINTSUPPORT_LIB) && QT_CONFIG(printdialog) pageMap = currentPageMap(); if (pageMap.count() == 0) @@ -229,12 +231,12 @@ void MainWindow::on_printAction_triggered() printer.setFromTo(1, pageMap.keys().count()); printDocument(&printer); -#endif // QT_NO_PRINTER +#endif } void MainWindow::printDocument(QPrinter *printer) { -#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG) +#if defined(QT_PRINTSUPPORT_LIB) && QT_CONFIG(printdialog) printer->setFromTo(1, pageMap.count()); QProgressDialog progress(tr("Preparing font samples..."), tr("&Cancel"), @@ -263,12 +265,12 @@ void MainWindow::printDocument(QPrinter *printer) } painter.end(); -#endif // QT_NO_PRINTER +#endif } void MainWindow::on_printPreviewAction_triggered() { -#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG) +#if defined(QT_PRINTSUPPORT_LIB) && QT_CONFIG(printdialog) pageMap = currentPageMap(); if (pageMap.count() == 0) @@ -279,12 +281,12 @@ void MainWindow::on_printPreviewAction_triggered() connect(&preview, SIGNAL(paintRequested(QPrinter*)), this, SLOT(printDocument(QPrinter*))); preview.exec(); -#endif // QT_NO_PRINTER +#endif } void MainWindow::printPage(int index, QPainter *painter, QPrinter *printer) { -#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG) +#if defined(QT_PRINTSUPPORT_LIB) && QT_CONFIG(printdialog) QString family = pageMap.keys()[index]; StyleItems items = pageMap[family]; @@ -347,5 +349,5 @@ void MainWindow::printPage(int index, QPainter *painter, QPrinter *printer) } painter->restore(); -#endif // QT_NO_PRINTER +#endif } |