summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/widgets/painting/fontsampler/mainwindow.cpp6
-rw-r--r--examples/widgets/painting/fontsampler/mainwindow.h10
2 files changed, 10 insertions, 6 deletions
diff --git a/examples/widgets/painting/fontsampler/mainwindow.cpp b/examples/widgets/painting/fontsampler/mainwindow.cpp
index 06ffac3728..88b23d5cfb 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"
@@ -210,7 +212,7 @@ QMap<QString, StyleItems> MainWindow::currentPageMap()
return pageMap;
}
-#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG)
+#if defined(QT_PRINTSUPPORT_LIB) && QT_CONFIG(printdialog)
void MainWindow::on_printAction_triggered()
{
pageMap = currentPageMap();
@@ -342,4 +344,4 @@ void MainWindow::printPage(int index, QPainter *painter, QPrinter *printer)
painter->restore();
}
-#endif // QT_NO_PRINTER
+#endif
diff --git a/examples/widgets/painting/fontsampler/mainwindow.h b/examples/widgets/painting/fontsampler/mainwindow.h
index ada0d47354..21e76f1a62 100644
--- a/examples/widgets/painting/fontsampler/mainwindow.h
+++ b/examples/widgets/painting/fontsampler/mainwindow.h
@@ -55,6 +55,9 @@
#include <QPrinter>
#include <QPrintDialog>
+#if defined(QT_PRINTSUPPORT_LIB)
+#include <QtPrintSupport/qtprintsupportglobal.h>
+#endif
QT_BEGIN_NAMESPACE
class QPrinter;
class QTextEdit;
@@ -74,12 +77,11 @@ public:
public slots:
void on_clearAction_triggered();
void on_markAction_triggered();
-#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG)
+ void on_unmarkAction_triggered();
+
+#if defined(QT_PRINTSUPPORT_LIB) && QT_CONFIG(printdialog)
void on_printAction_triggered();
void on_printPreviewAction_triggered();
-#endif
- void on_unmarkAction_triggered();
-#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG)
void printDocument(QPrinter *printer);
void printPage(int index, QPainter *painter, QPrinter *printer);
#endif