Fix compilation on platforms that don't support printing
Task-number: QTBUG-56259 Change-Id: Ice1d7601494b01b387e787da412cd94b6717ebde Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>bb10
parent
dcd2f82951
commit
f4a33e345e
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue