diff options
author | Liang Qi <liang.qi@qt.io> | 2016-12-16 15:21:35 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2016-12-16 16:38:33 +0100 |
commit | b13150336174083962d90922761fd96f07e173b4 (patch) | |
tree | 1655e9009efba21b008d7d2f810aacbde3e2c2d8 /examples/widgets/painting/fontsampler/mainwindow.cpp | |
parent | ff19ebcc2d9c9668af24fe8add9f70c160776367 (diff) | |
parent | 9bfe3ab71e5291445e66be96d6cd1f63934a2d83 (diff) |
Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
configure
configure.pri
examples/widgets/painting/fontsampler/mainwindow.cpp
examples/widgets/painting/fontsampler/mainwindow.h
mkspecs/features/moc.prf
src/corelib/global/qglobal.h
src/gui/text/qtextdocument.cpp
Change-Id: Ica65512e00871695190a14ccea5c275b0165f787
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 } |