From dbeb748de30bcc0e0615d21c593b761408404950 Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Mon, 29 May 2017 17:35:58 +0200 Subject: Convert features.printdialog to QT_[REQUIRE_]CONFIG Change-Id: Ifb016ae2a0986b436f788b34513c81ea91f3804a Reviewed-by: Oswald Buddenhagen --- examples/widgets/richtext/orderform/mainwindow.cpp | 7 +++++-- examples/widgets/richtext/textedit/textedit.cpp | 13 ++++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'examples/widgets/richtext') diff --git a/examples/widgets/richtext/orderform/mainwindow.cpp b/examples/widgets/richtext/orderform/mainwindow.cpp index 35934bee72..030072978e 100644 --- a/examples/widgets/richtext/orderform/mainwindow.cpp +++ b/examples/widgets/richtext/orderform/mainwindow.cpp @@ -49,10 +49,13 @@ ****************************************************************************/ #include -#ifndef QT_NO_PRINTER +#if defined(QT_PRINTSUPPORT_LIB) +#include +#if QT_CONFIG(printdialog) #include #include #endif +#endif #include "detailsdialog.h" #include "mainwindow.h" @@ -245,7 +248,7 @@ void MainWindow::openDialog() //! [17] void MainWindow::printFile() { -#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG) +#if QT_CONFIG(printdialog) QTextEdit *editor = static_cast(letters->currentWidget()); //! [18] QPrinter printer; diff --git a/examples/widgets/richtext/textedit/textedit.cpp b/examples/widgets/richtext/textedit/textedit.cpp index 140ae478ff..fe4ee4f499 100644 --- a/examples/widgets/richtext/textedit/textedit.cpp +++ b/examples/widgets/richtext/textedit/textedit.cpp @@ -71,11 +71,18 @@ #include #include #include -#ifndef QT_NO_PRINTER +#if defined(QT_PRINTSUPPORT_LIB) +#include +#if QT_CONFIG(printer) +#if QT_CONFIG(printdialog) #include +#endif #include +#if QT_CONFIG(printpreviewdialog) #include #endif +#endif +#endif #include "textedit.h" @@ -474,7 +481,7 @@ bool TextEdit::fileSaveAs() void TextEdit::filePrint() { -#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG) +#if QT_CONFIG(printdialog) QPrinter printer(QPrinter::HighResolution); QPrintDialog *dlg = new QPrintDialog(&printer, this); if (textEdit->textCursor().hasSelection()) @@ -488,7 +495,7 @@ void TextEdit::filePrint() void TextEdit::filePrintPreview() { -#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG) +#if QT_CONFIG(printpreviewdialog) QPrinter printer(QPrinter::HighResolution); QPrintPreviewDialog preview(&printer, this); connect(&preview, &QPrintPreviewDialog::paintRequested, this, &TextEdit::printPreview); -- cgit v1.2.3