QtPrintSupport: Replace remaining Q_WS_ conditionals by name checks.
Change-Id: Ic772e2187b3c93c5e0cdee6681289ab81e2c2f65 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
This commit is contained in:
parent
13b1395924
commit
3ef9138efd
@ -44,7 +44,7 @@
|
||||
|
||||
#ifndef QT_NO_PRINTDIALOG
|
||||
|
||||
#include <QtCore/qcoreapplication.h>
|
||||
#include <QtGui/qguiapplication.h>
|
||||
#include <QtPrintSupport/qprinter.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
@ -106,10 +106,8 @@ void QAbstractPageSetupDialogPrivate::setPrinter(QPrinter *newPrinter)
|
||||
printer = new QPrinter;
|
||||
ownsPrinter = true;
|
||||
}
|
||||
#ifndef Q_WS_X11
|
||||
if (printer->outputFormat() != QPrinter::NativeFormat)
|
||||
if (printer->outputFormat() != QPrinter::NativeFormat && QGuiApplication::platformName() == QLatin1String("xcb"))
|
||||
qWarning("QPageSetupDialog: Cannot be used on non-native printers");
|
||||
#endif
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -115,7 +115,7 @@ void QPageSetupDialog::open(QObject *receiver, const char *member)
|
||||
QDialog::open();
|
||||
}
|
||||
|
||||
#if defined(Q_WS_MAC) || defined(Q_OS_WIN)
|
||||
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
|
||||
/*! \fn void QPageSetupDialog::setVisible(bool visible)
|
||||
\reimp
|
||||
*/
|
||||
|
@ -55,9 +55,6 @@
|
||||
|
||||
#include <private/qpagedpaintdevice_p.h>
|
||||
|
||||
#if defined(Q_WS_X11)
|
||||
#include <private/qt_x11_p.h>
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_PDF
|
||||
#include "qprintengine_pdf_p.h"
|
||||
@ -514,11 +511,7 @@ QPrinter::QPrinter(const QPrinterInfo& printer, PrinterMode mode)
|
||||
|
||||
void QPrinterPrivate::init(QPrinter::PrinterMode mode)
|
||||
{
|
||||
#if !defined(Q_WS_X11)
|
||||
if (!QCoreApplication::instance()) {
|
||||
#else
|
||||
if (!QCoreApplication::instance() || !X11) {
|
||||
#endif
|
||||
qFatal("QPrinter: Must construct a QApplication before a QPaintDevice");
|
||||
return;
|
||||
}
|
||||
@ -712,11 +705,8 @@ void QPrinter::setPrinterName(const QString &name)
|
||||
bool QPrinter::isValid() const
|
||||
{
|
||||
Q_D(const QPrinter);
|
||||
#if defined(Q_WS_X11)
|
||||
if (!qApp || !X11) {
|
||||
if (!qApp)
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
return d->validPrinter;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user