Compile fix when QT_NO_PRINTDIALOG is defined

...but QT_NO_PRINTER isn't.

Change-Id: I888c177cfdd2245eb55de766dfd93f6acd4293e9
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
This commit is contained in:
Paul Olav Tvete 2013-02-18 15:59:14 +01:00 committed by The Qt Project
parent f6af0dad5b
commit 4b1332783e
11 changed files with 13 additions and 13 deletions

View File

@ -154,7 +154,7 @@ void ScribbleArea::resizeImage(QImage *image, const QSize &newSize)
//! [21]
void ScribbleArea::print()
{
#ifndef QT_NO_PRINTER
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG)
QPrinter printer(QPrinter::HighResolution);
QPrintDialog printDialog(&printer, this);

View File

@ -352,7 +352,7 @@ void ConclusionPage::setVisible(bool visible)
void ConclusionPage::printButtonClicked()
{
#ifndef QT_NO_PRINTER
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG)
QPrinter printer;
QPrintDialog dialog(&printer, this);
if (dialog.exec())

View File

@ -250,7 +250,7 @@ void View::toggleAntialiasing()
void View::print()
{
#ifndef QT_NO_PRINTER
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG)
QPrinter printer;
QPrintDialog dialog(&printer, this);
if (dialog.exec() == QDialog::Accepted) {

View File

@ -154,7 +154,7 @@ void MainWindow::openImage(const QString &fileName)
void MainWindow::printImage()
{
#ifndef QT_NO_PRINTER
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG)
if (model->rowCount(QModelIndex())*model->columnCount(QModelIndex()) > 90000) {
QMessageBox::StandardButton answer;
answer = QMessageBox::question(this, tr("Large Image Size"),

View File

@ -627,7 +627,7 @@ QString encode_pos(int row, int col)
void SpreadSheet::print()
{
#ifndef QT_NO_PRINTER
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG)
QPrinter printer(QPrinter::ScreenResolution);
QPrintPreviewDialog dlg(&printer);
PrintView view;

View File

@ -241,7 +241,7 @@ QMap<QString, StyleItems> MainWindow::currentPageMap()
return pageMap;
}
#ifndef QT_NO_PRINTER
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG)
void MainWindow::on_printAction_triggered()
{
pageMap = currentPageMap();

View File

@ -62,12 +62,12 @@ public:
public slots:
void on_clearAction_triggered();
void on_markAction_triggered();
#ifndef QT_NO_PRINTER
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG)
void on_printAction_triggered();
void on_printPreviewAction_triggered();
#endif
void on_unmarkAction_triggered();
#ifndef QT_NO_PRINTER
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG)
void printDocument(QPrinter *printer);
void printPage(int index, QPainter *painter, QPrinter *printer);
#endif

View File

@ -235,7 +235,7 @@ void MainWindow::openDialog()
//! [17]
void MainWindow::printFile()
{
#ifndef QT_NO_PRINTER
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG)
QTextEdit *editor = static_cast<QTextEdit*>(letters->currentWidget());
//! [18]
QPrinter printer;

View File

@ -511,7 +511,7 @@ bool TextEdit::fileSaveAs()
void TextEdit::filePrint()
{
#ifndef QT_NO_PRINTER
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG)
QPrinter printer(QPrinter::HighResolution);
QPrintDialog *dlg = new QPrintDialog(&printer, this);
if (textEdit->textCursor().hasSelection())
@ -525,7 +525,7 @@ void TextEdit::filePrint()
void TextEdit::filePrintPreview()
{
#ifndef QT_NO_PRINTER
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG)
QPrinter printer(QPrinter::HighResolution);
QPrintPreviewDialog preview(&printer, this);
connect(&preview, SIGNAL(paintRequested(QPrinter*)), SLOT(printPreview(QPrinter*)));

View File

@ -99,7 +99,7 @@ void ImageViewer::print()
//! [5] //! [6]
{
Q_ASSERT(imageLabel->pixmap());
#ifndef QT_NO_PRINTER
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG)
//! [6] //! [7]
QPrintDialog dialog(&printer, this);
//! [7] //! [8]

View File

@ -200,7 +200,7 @@ void ScribbleArea::resizeImage(QImage *image, const QSize &newSize)
//! [21]
void ScribbleArea::print()
{
#ifndef QT_NO_PRINTER
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG)
QPrinter printer(QPrinter::HighResolution);
QPrintDialog printDialog(&printer, this);