Convert features.printdialog to QT_[REQUIRE_]CONFIG

Change-Id: Ifb016ae2a0986b436f788b34513c81ea91f3804a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
Stephan Binner 2017-05-29 17:35:58 +02:00
parent f209215c0d
commit dbeb748de3
30 changed files with 118 additions and 111 deletions

View File

@ -49,10 +49,13 @@
****************************************************************************/ ****************************************************************************/
#include <QtWidgets> #include <QtWidgets>
#ifndef QT_NO_PRINTER #if defined(QT_PRINTSUPPORT_LIB)
#include <QtPrintSupport/qtprintsupportglobal.h>
#if QT_CONFIG(printdialog)
#include <QPrinter> #include <QPrinter>
#include <QPrintDialog> #include <QPrintDialog>
#endif #endif
#endif
#include "scribblearea.h" #include "scribblearea.h"
@ -167,7 +170,7 @@ void ScribbleArea::resizeImage(QImage *image, const QSize &newSize)
//! [21] //! [21]
void ScribbleArea::print() void ScribbleArea::print()
{ {
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG) #if QT_CONFIG(printdialog)
QPrinter printer(QPrinter::HighResolution); QPrinter printer(QPrinter::HighResolution);
QPrintDialog printDialog(&printer, this); QPrintDialog printDialog(&printer, this);
@ -181,7 +184,7 @@ void ScribbleArea::print()
painter.setWindow(image.rect()); painter.setWindow(image.rect());
painter.drawImage(0, 0, image); painter.drawImage(0, 0, image);
} }
#endif // QT_NO_PRINTER #endif // QT_CONFIG(printdialog)
} }
//! [22] //! [22]

View File

@ -49,8 +49,13 @@
****************************************************************************/ ****************************************************************************/
#include <QtWidgets> #include <QtWidgets>
#if defined(QT_PRINTSUPPORT_LIB)
#include <QtPrintSupport/qtprintsupportglobal.h>
#if QT_CONFIG(printdialog)
#include <QPrinter> #include <QPrinter>
#include <QPrintDialog> #include <QPrintDialog>
#endif
#endif
#include "licensewizard.h" #include "licensewizard.h"
@ -364,7 +369,7 @@ void ConclusionPage::setVisible(bool visible)
void ConclusionPage::printButtonClicked() void ConclusionPage::printButtonClicked()
{ {
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG) #if QT_CONFIG(printdialog)
QPrinter printer; QPrinter printer;
QPrintDialog dialog(&printer, this); QPrintDialog dialog(&printer, this);
if (dialog.exec()) if (dialog.exec())

View File

@ -50,8 +50,13 @@
#include "view.h" #include "view.h"
#if defined(QT_PRINTSUPPORT_LIB)
#include <QtPrintSupport/qtprintsupportglobal.h>
#if QT_CONFIG(printdialog)
#include <QPrinter> #include <QPrinter>
#include <QPrintDialog> #include <QPrintDialog>
#endif
#endif
#ifndef QT_NO_OPENGL #ifndef QT_NO_OPENGL
#include <QtOpenGL> #include <QtOpenGL>
#else #else
@ -259,7 +264,7 @@ void View::toggleAntialiasing()
void View::print() void View::print()
{ {
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG) #if QT_CONFIG(printdialog)
QPrinter printer; QPrinter printer;
QPrintDialog dialog(&printer, this); QPrintDialog dialog(&printer, this);
if (dialog.exec() == QDialog::Accepted) { if (dialog.exec() == QDialog::Accepted) {

View File

@ -53,10 +53,13 @@
#include "pixeldelegate.h" #include "pixeldelegate.h"
#include <QtWidgets> #include <QtWidgets>
#ifndef QT_NO_PRINTER #if defined(QT_PRINTSUPPORT_LIB)
#include <QtPrintSupport/qtprintsupportglobal.h>
#if QT_CONFIG(printdialog)
#include <QPrinter> #include <QPrinter>
#include <QPrintDialog> #include <QPrintDialog>
#endif #endif
#endif
//! [0] //! [0]
MainWindow::MainWindow() MainWindow::MainWindow()
@ -164,7 +167,7 @@ void MainWindow::openImage(const QString &fileName)
void MainWindow::printImage() void MainWindow::printImage()
{ {
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG) #if QT_CONFIG(printdialog)
if (model->rowCount(QModelIndex())*model->columnCount(QModelIndex()) > 90000) { if (model->rowCount(QModelIndex())*model->columnCount(QModelIndex()) > 90000) {
QMessageBox::StandardButton answer; QMessageBox::StandardButton answer;
answer = QMessageBox::question(this, tr("Large Image Size"), answer = QMessageBox::question(this, tr("Large Image Size"),

View File

@ -49,11 +49,16 @@
****************************************************************************/ ****************************************************************************/
#include <QtWidgets> #include <QtWidgets>
#ifndef QT_NO_PRINTER #if defined(QT_PRINTSUPPORT_LIB)
#include <QtPrintSupport/qtprintsupportglobal.h>
#if QT_CONFIG(printdialog)
#include <QPrinter> #include <QPrinter>
#include <QPrintDialog> #include <QPrintDialog>
#endif
#if QT_CONFIG(printpreviewdialog)
#include <QPrintPreviewDialog> #include <QPrintPreviewDialog>
#endif #endif
#endif
#include "spreadsheet.h" #include "spreadsheet.h"
#include "spreadsheetdelegate.h" #include "spreadsheetdelegate.h"
@ -637,7 +642,7 @@ QString encode_pos(int row, int col)
void SpreadSheet::print() void SpreadSheet::print()
{ {
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG) #if QT_CONFIG(printpreviewdialog)
QPrinter printer(QPrinter::ScreenResolution); QPrinter printer(QPrinter::ScreenResolution);
QPrintPreviewDialog dlg(&printer); QPrintPreviewDialog dlg(&printer);
PrintView view; PrintView view;

View File

@ -50,9 +50,12 @@
//! [0] //! [0]
#include <QtWidgets> #include <QtWidgets>
#ifndef QT_NO_PRINTDIALOG #if defined(QT_PRINTSUPPORT_LIB)
#include <QtPrintSupport/qtprintsupportglobal.h>
#if QT_CONFIG(printdialog)
#include <QtPrintSupport> #include <QtPrintSupport>
#endif #endif
#endif
#include "mainwindow.h" #include "mainwindow.h"
//! [0] //! [0]
@ -125,7 +128,7 @@ void MainWindow::newLetter()
//! [3] //! [3]
void MainWindow::print() void MainWindow::print()
{ {
#ifndef QT_NO_PRINTDIALOG #if QT_CONFIG(printdialog)
QTextDocument *document = textEdit->document(); QTextDocument *document = textEdit->document();
QPrinter printer; QPrinter printer;

View File

@ -50,8 +50,15 @@
#include <QtWidgets> #include <QtWidgets>
#if defined(QT_PRINTSUPPORT_LIB) #if defined(QT_PRINTSUPPORT_LIB)
#include <QtPrintSupport/qtprintsupportglobal.h>
#if QT_CONFIG(printdialog)
#include <QPrinter>
#include <QPrintDialog>
#if QT_CONFIG(printpreviewdialog)
#include <QPrintPreviewDialog> #include <QPrintPreviewDialog>
#endif #endif
#endif
#endif
#include "mainwindow.h" #include "mainwindow.h"
@ -270,7 +277,7 @@ void MainWindow::printDocument(QPrinter *printer)
void MainWindow::on_printPreviewAction_triggered() void MainWindow::on_printPreviewAction_triggered()
{ {
#if defined(QT_PRINTSUPPORT_LIB) && QT_CONFIG(printdialog) #if defined(QT_PRINTSUPPORT_LIB) && QT_CONFIG(printpreviewdialog)
pageMap = currentPageMap(); pageMap = currentPageMap();
if (pageMap.count() == 0) if (pageMap.count() == 0)

View File

@ -52,8 +52,6 @@
#define MAINWINDOW_H #define MAINWINDOW_H
#include "ui_mainwindowbase.h" #include "ui_mainwindowbase.h"
#include <QPrinter>
#include <QPrintDialog>
#if defined(QT_PRINTSUPPORT_LIB) #if defined(QT_PRINTSUPPORT_LIB)
#include <QtPrintSupport/qtprintsupportglobal.h> #include <QtPrintSupport/qtprintsupportglobal.h>

View File

@ -49,10 +49,13 @@
****************************************************************************/ ****************************************************************************/
#include <QtWidgets> #include <QtWidgets>
#ifndef QT_NO_PRINTER #if defined(QT_PRINTSUPPORT_LIB)
#include <QtPrintSupport/qtprintsupportglobal.h>
#if QT_CONFIG(printdialog)
#include <QPrinter> #include <QPrinter>
#include <QPrintDialog> #include <QPrintDialog>
#endif #endif
#endif
#include "detailsdialog.h" #include "detailsdialog.h"
#include "mainwindow.h" #include "mainwindow.h"
@ -245,7 +248,7 @@ void MainWindow::openDialog()
//! [17] //! [17]
void MainWindow::printFile() void MainWindow::printFile()
{ {
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG) #if QT_CONFIG(printdialog)
QTextEdit *editor = static_cast<QTextEdit*>(letters->currentWidget()); QTextEdit *editor = static_cast<QTextEdit*>(letters->currentWidget());
//! [18] //! [18]
QPrinter printer; QPrinter printer;

View File

@ -71,11 +71,18 @@
#include <QCloseEvent> #include <QCloseEvent>
#include <QMessageBox> #include <QMessageBox>
#include <QMimeData> #include <QMimeData>
#ifndef QT_NO_PRINTER #if defined(QT_PRINTSUPPORT_LIB)
#include <QtPrintSupport/qtprintsupportglobal.h>
#if QT_CONFIG(printer)
#if QT_CONFIG(printdialog)
#include <QPrintDialog> #include <QPrintDialog>
#endif
#include <QPrinter> #include <QPrinter>
#if QT_CONFIG(printpreviewdialog)
#include <QPrintPreviewDialog> #include <QPrintPreviewDialog>
#endif #endif
#endif
#endif
#include "textedit.h" #include "textedit.h"
@ -474,7 +481,7 @@ bool TextEdit::fileSaveAs()
void TextEdit::filePrint() void TextEdit::filePrint()
{ {
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG) #if QT_CONFIG(printdialog)
QPrinter printer(QPrinter::HighResolution); QPrinter printer(QPrinter::HighResolution);
QPrintDialog *dlg = new QPrintDialog(&printer, this); QPrintDialog *dlg = new QPrintDialog(&printer, this);
if (textEdit->textCursor().hasSelection()) if (textEdit->textCursor().hasSelection())
@ -488,7 +495,7 @@ void TextEdit::filePrint()
void TextEdit::filePrintPreview() void TextEdit::filePrintPreview()
{ {
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG) #if QT_CONFIG(printpreviewdialog)
QPrinter printer(QPrinter::HighResolution); QPrinter printer(QPrinter::HighResolution);
QPrintPreviewDialog preview(&printer, this); QPrintPreviewDialog preview(&printer, this);
connect(&preview, &QPrintPreviewDialog::paintRequested, this, &TextEdit::printPreview); connect(&preview, &QPrintPreviewDialog::paintRequested, this, &TextEdit::printPreview);

View File

@ -49,9 +49,12 @@
****************************************************************************/ ****************************************************************************/
#include <QtWidgets> #include <QtWidgets>
#ifndef QT_NO_PRINTER #if defined(QT_PRINTSUPPORT_LIB)
#include <QtPrintSupport/qtprintsupportglobal.h>
#if QT_CONFIG(printdialog)
#include <QPrintDialog> #include <QPrintDialog>
#endif #endif
#endif
#include "imageviewer.h" #include "imageviewer.h"
@ -180,7 +183,7 @@ void ImageViewer::print()
//! [5] //! [6] //! [5] //! [6]
{ {
Q_ASSERT(imageLabel->pixmap()); Q_ASSERT(imageLabel->pixmap());
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG) #if QT_CONFIG(printdialog)
//! [6] //! [7] //! [6] //! [7]
QPrintDialog dialog(&printer, this); QPrintDialog dialog(&printer, this);
//! [7] //! [8] //! [7] //! [8]

View File

@ -49,10 +49,13 @@
****************************************************************************/ ****************************************************************************/
#include <QtWidgets> #include <QtWidgets>
#ifndef QT_NO_PRINTER #if defined(QT_PRINTSUPPORT_LIB)
#include <QtPrintSupport/qtprintsupportglobal.h>
#if QT_CONFIG(printdialog)
#include <QPrinter> #include <QPrinter>
#include <QPrintDialog> #include <QPrintDialog>
#endif #endif
#endif
#include "scribblearea.h" #include "scribblearea.h"
@ -210,7 +213,7 @@ void ScribbleArea::resizeImage(QImage *image, const QSize &newSize)
//! [21] //! [21]
void ScribbleArea::print() void ScribbleArea::print()
{ {
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG) #if QT_CONFIG(printdialog)
QPrinter printer(QPrinter::HighResolution); QPrinter printer(QPrinter::HighResolution);
QPrintDialog printDialog(&printer, this); QPrintDialog printDialog(&printer, this);
@ -224,6 +227,6 @@ void ScribbleArea::print()
painter.setWindow(image.rect()); painter.setWindow(image.rect());
painter.drawImage(0, 0, image); painter.drawImage(0, 0, image);
} }
#endif // QT_NO_PRINTER #endif // QT_CONFIG(printdialog)
} }
//! [22] //! [22]

View File

@ -1,43 +1,46 @@
# Qt dialogs module # Qt dialogs module
HEADERS += \ INCLUDEPATH += $$PWD
qtConfig(printdialog) {
HEADERS += \
dialogs/qabstractprintdialog.h \ dialogs/qabstractprintdialog.h \
dialogs/qabstractprintdialog_p.h \ dialogs/qabstractprintdialog_p.h \
dialogs/qpagesetupdialog_p.h \ dialogs/qpagesetupdialog_p.h \
dialogs/qpagesetupdialog.h \ dialogs/qpagesetupdialog.h \
dialogs/qprintdialog.h dialogs/qprintdialog.h
osx { macos {
OBJECTIVE_SOURCES += dialogs/qpagesetupdialog_mac.mm \ OBJECTIVE_SOURCES += dialogs/qpagesetupdialog_mac.mm \
dialogs/qprintdialog_mac.mm dialogs/qprintdialog_mac.mm
LIBS_PRIVATE += -framework AppKit LIBS_PRIVATE += -framework AppKit
} }
win32 { win32 {
SOURCES += dialogs/qpagesetupdialog_win.cpp \ SOURCES += dialogs/qpagesetupdialog_win.cpp \
dialogs/qprintdialog_win.cpp dialogs/qprintdialog_win.cpp
} }
unix:!mac { unix:!darwin {
INCLUDEPATH += $$QT_SOURCE_TREE/src/plugins/printsupport/cups INCLUDEPATH += $$QT_SOURCE_TREE/src/plugins/printsupport/cups
HEADERS += dialogs/qpagesetupdialog_unix_p.h HEADERS += dialogs/qpagesetupdialog_unix_p.h
SOURCES += dialogs/qprintdialog_unix.cpp \ SOURCES += dialogs/qprintdialog_unix.cpp \
dialogs/qpagesetupdialog_unix.cpp dialogs/qpagesetupdialog_unix.cpp
FORMS += dialogs/qprintsettingsoutput.ui \ FORMS += dialogs/qprintsettingsoutput.ui \
dialogs/qprintwidget.ui \ dialogs/qprintwidget.ui \
dialogs/qprintpropertieswidget.ui dialogs/qprintpropertieswidget.ui
} }
INCLUDEPATH += $$PWD SOURCES += \
SOURCES += \
dialogs/qabstractprintdialog.cpp \ dialogs/qabstractprintdialog.cpp \
dialogs/qpagesetupdialog.cpp dialogs/qpagesetupdialog.cpp
FORMS += dialogs/qpagesetupwidget.ui
RESOURCES += dialogs/qprintdialog.qrc
}
qtConfig(printpreviewdialog) { qtConfig(printpreviewdialog) {
HEADERS += dialogs/qprintpreviewdialog.h HEADERS += dialogs/qprintpreviewdialog.h
SOURCES += dialogs/qprintpreviewdialog.cpp SOURCES += dialogs/qprintpreviewdialog.cpp
} }
FORMS += dialogs/qpagesetupwidget.ui
RESOURCES += dialogs/qprintdialog.qrc

View File

@ -43,8 +43,6 @@
#include "qprinter.h" #include "qprinter.h"
#include "private/qprinter_p.h" #include "private/qprinter_p.h"
#ifndef QT_NO_PRINTDIALOG
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
// hack // hack
@ -497,5 +495,3 @@ void QPrintDialog::open(QObject *receiver, const char *member)
} }
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QT_NO_PRINTDIALOG

View File

@ -42,12 +42,11 @@
#include <QtPrintSupport/qtprintsupportglobal.h> #include <QtPrintSupport/qtprintsupportglobal.h>
#if QT_CONFIG(printdialog)
#include <QtWidgets/qdialog.h> #include <QtWidgets/qdialog.h>
QT_BEGIN_NAMESPACE QT_REQUIRE_CONFIG(printdialog);
QT_BEGIN_NAMESPACE
class QAbstractPrintDialogPrivate; class QAbstractPrintDialogPrivate;
class QPrinter; class QPrinter;
@ -120,6 +119,4 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QAbstractPrintDialog::PrintDialogOptions)
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QT_NO_PRINTDIALOG
#endif // QABSTRACTPRINTDIALOG_H #endif // QABSTRACTPRINTDIALOG_H

View File

@ -53,14 +53,12 @@
#include <QtPrintSupport/private/qtprintsupportglobal_p.h> #include <QtPrintSupport/private/qtprintsupportglobal_p.h>
#ifndef QT_NO_PRINTDIALOG
#include "private/qdialog_p.h" #include "private/qdialog_p.h"
#include "QtPrintSupport/qabstractprintdialog.h" #include "QtPrintSupport/qabstractprintdialog.h"
QT_BEGIN_NAMESPACE QT_REQUIRE_CONFIG(printdialog);
#ifndef QT_NO_PRINTER QT_BEGIN_NAMESPACE
class QPrinter; class QPrinter;
class QPrinterPrivate; class QPrinterPrivate;
@ -92,10 +90,6 @@ public:
int maxPage; int maxPage;
}; };
#endif //QT_NO_PRINTER
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QT_NO_PRINTDIALOG
#endif // QABSTRACTPRINTDIALOG_P_H #endif // QABSTRACTPRINTDIALOG_P_H

View File

@ -42,8 +42,6 @@
#include <QtPrintSupport/qprinter.h> #include <QtPrintSupport/qprinter.h>
#ifndef QT_NO_PRINTDIALOG
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
/*! /*!
@ -183,5 +181,3 @@ void QPageSetupDialog::done(int result)
} }
QT_END_NAMESPACE QT_END_NAMESPACE
#endif

View File

@ -42,12 +42,11 @@
#include <QtPrintSupport/qtprintsupportglobal.h> #include <QtPrintSupport/qtprintsupportglobal.h>
#ifndef QT_NO_PRINTDIALOG
#include <QtWidgets/qdialog.h> #include <QtWidgets/qdialog.h>
QT_BEGIN_NAMESPACE QT_REQUIRE_CONFIG(printdialog);
QT_BEGIN_NAMESPACE
class QPrinter; class QPrinter;
class QPageSetupDialogPrivate; class QPageSetupDialogPrivate;
@ -77,6 +76,4 @@ public:
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QT_NO_PRINTDIALOG
#endif // QPAGESETUPDIALOG_H #endif // QPAGESETUPDIALOG_H

View File

@ -42,7 +42,6 @@
#include "qpagesetupdialog.h" #include "qpagesetupdialog.h"
#ifndef QT_NO_PRINTDIALOG
#include "qpagesetupdialog_p.h" #include "qpagesetupdialog_p.h"
#include <qpa/qplatformnativeinterface.h> #include <qpa/qplatformnativeinterface.h>
@ -222,5 +221,3 @@ int QPageSetupDialog::exec()
} }
QT_END_NAMESPACE QT_END_NAMESPACE
#endif /* QT_NO_PRINTDIALOG */

View File

@ -54,14 +54,14 @@
#include <QtPrintSupport/private/qtprintsupportglobal_p.h> #include <QtPrintSupport/private/qtprintsupportglobal_p.h>
#ifndef QT_NO_PRINTDIALOG
#include "private/qdialog_p.h" #include "private/qdialog_p.h"
#include "qbytearray.h" #include "qbytearray.h"
#include "qpagesetupdialog.h" #include "qpagesetupdialog.h"
#include "qpointer.h" #include "qpointer.h"
QT_REQUIRE_CONFIG(printdialog);
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QPrinter; class QPrinter;
@ -83,6 +83,4 @@ public:
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QT_NO_PRINTDIALOG
#endif // QPAGESETUPDIALOG_P_H #endif // QPAGESETUPDIALOG_P_H

View File

@ -39,7 +39,6 @@
#include "qpagesetupdialog.h" #include "qpagesetupdialog.h"
#ifndef QT_NO_PRINTDIALOG
#include "qpagesetupdialog_unix_p.h" #include "qpagesetupdialog_unix_p.h"
#include <private/qpagesetupdialog_p.h> #include <private/qpagesetupdialog_p.h>
@ -644,5 +643,3 @@ int QPageSetupDialog::exec()
QT_END_NAMESPACE QT_END_NAMESPACE
#include "moc_qpagesetupdialog.cpp" #include "moc_qpagesetupdialog.cpp"
#endif // QT_NO_PRINTDIALOG

View File

@ -53,14 +53,14 @@
#include <QtPrintSupport/private/qtprintsupportglobal_p.h> #include <QtPrintSupport/private/qtprintsupportglobal_p.h>
#ifndef QT_NO_PRINTDIALOG
#include "qprinter.h" #include "qprinter.h"
#include <QtGui/qpagelayout.h> #include <QtGui/qpagelayout.h>
#include <ui_qpagesetupwidget.h> #include <ui_qpagesetupwidget.h>
QT_REQUIRE_CONFIG(printdialog);
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QPrinter; class QPrinter;
@ -106,5 +106,4 @@ private:
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QT_NO_PRINTDIALOG
#endif #endif

View File

@ -39,7 +39,6 @@
#include "qpagesetupdialog.h" #include "qpagesetupdialog.h"
#ifndef QT_NO_PRINTDIALOG
#include <qapplication.h> #include <qapplication.h>
#include "../kernel/qprintengine_win_p.h" #include "../kernel/qprintengine_win_p.h"
@ -168,4 +167,3 @@ void QPageSetupDialog::setVisible(bool visible)
} }
QT_END_NAMESPACE QT_END_NAMESPACE
#endif

View File

@ -42,12 +42,11 @@
#include <QtPrintSupport/qtprintsupportglobal.h> #include <QtPrintSupport/qtprintsupportglobal.h>
#ifndef QT_NO_PRINTDIALOG
#include <QtPrintSupport/qabstractprintdialog.h> #include <QtPrintSupport/qabstractprintdialog.h>
QT_BEGIN_NAMESPACE QT_REQUIRE_CONFIG(printdialog);
QT_BEGIN_NAMESPACE
class QPrintDialogPrivate; class QPrintDialogPrivate;
class QPushButton; class QPushButton;
@ -104,6 +103,4 @@ private:
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QT_NO_PRINTDIALOG
#endif // QPRINTDIALOG_H #endif // QPRINTDIALOG_H

View File

@ -48,8 +48,6 @@
#include <QtPrintSupport/qprintengine.h> #include <QtPrintSupport/qprintengine.h>
#include <qpa/qplatformprintdevice.h> #include <qpa/qplatformprintdevice.h>
#ifndef QT_NO_PRINTDIALOG
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
extern qreal qt_pointMultiplier(QPageLayout::Unit unit); extern qreal qt_pointMultiplier(QPageLayout::Unit unit);
@ -358,5 +356,3 @@ void QPrintDialog::setVisible(bool visible)
QT_END_NAMESPACE QT_END_NAMESPACE
#include "moc_qprintdialog.cpp" #include "moc_qprintdialog.cpp"
#endif // QT_NO_PRINTDIALOG

View File

@ -40,8 +40,6 @@
#include "qplatformdefs.h" #include "qplatformdefs.h"
#include <QtPrintSupport/private/qtprintsupportglobal_p.h> #include <QtPrintSupport/private/qtprintsupportglobal_p.h>
#ifndef QT_NO_PRINTDIALOG
#include "private/qabstractprintdialog_p.h" #include "private/qabstractprintdialog_p.h"
#include <QtWidgets/qmessagebox.h> #include <QtWidgets/qmessagebox.h>
#include "qprintdialog.h" #include "qprintdialog.h"
@ -983,6 +981,3 @@ QT_END_NAMESPACE
#include "moc_qprintdialog.cpp" #include "moc_qprintdialog.cpp"
#include "qprintdialog_unix.moc" #include "qprintdialog_unix.moc"
#endif // QT_NO_PRINTDIALOG

View File

@ -39,8 +39,6 @@
#include <QtPrintSupport/qtprintsupportglobal.h> #include <QtPrintSupport/qtprintsupportglobal.h>
#ifndef QT_NO_PRINTDIALOG
#include "qprintdialog.h" #include "qprintdialog.h"
#include <qwidget.h> #include <qwidget.h>
@ -308,5 +306,3 @@ void QPrintDialog::setVisible(bool visible)
QT_END_NAMESPACE QT_END_NAMESPACE
#include "moc_qprintdialog.cpp" #include "moc_qprintdialog.cpp"
#endif // QT_NO_PRINTDIALOG

View File

@ -50,7 +50,8 @@
#include <QtGui> #include <QtGui>
#include <QtWidgets> #include <QtWidgets>
#ifndef QT_NO_PRINTER #include <QtPrintSupport/qtprintsupportglobal.h>
#if QT_CONFIG(printdialog)
#include <QPrinter> #include <QPrinter>
#include <QPrintDialog> #include <QPrintDialog>
#endif #endif
@ -98,7 +99,7 @@ private slots:
} }
void printFile() { void printFile() {
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG) #if QT_CONFIG(printdialog)
//! [1] //! [1]
QPrinter printer; QPrinter printer;

View File

@ -40,7 +40,9 @@
#include "qplatformprintdevice.h" #include "qplatformprintdevice.h"
#include "qprintdevice_p.h" #include "qprintdevice_p.h"
#if QT_CONFIG(printdialog)
#include "qprintdialog.h" #include "qprintdialog.h"
#endif
#include <QtGui/qpagelayout.h> #include <QtGui/qpagelayout.h>

View File

@ -31,14 +31,17 @@
#include <qcoreapplication.h> #include <qcoreapplication.h>
#include <qdebug.h> #include <qdebug.h>
#include <QtPrintSupport/qtprintsupportglobal.h>
#if QT_CONFIG(printdialog)
#include <qabstractprintdialog.h> #include <qabstractprintdialog.h>
#include <qprinter.h> #include <qprinter.h>
#endif
class tst_QAbstractPrintDialog : public QObject class tst_QAbstractPrintDialog : public QObject
{ {
Q_OBJECT Q_OBJECT
#if defined(QT_NO_PRINTER) || defined(QT_NO_PRINTDIALOG) #if !QT_CONFIG(printdialog)
public slots: public slots:
void initTestCase(); void initTestCase();
#else #else
@ -49,7 +52,7 @@ private slots:
#endif #endif
}; };
#if defined(QT_NO_PRINTER) || defined(QT_NO_PRINTDIALOG) #if !QT_CONFIG(printdialog)
void tst_QAbstractPrintDialog::initTestCase() void tst_QAbstractPrintDialog::initTestCase()
{ {
QSKIP("This test requires printing and print dialog support"); QSKIP("This test requires printing and print dialog support");