PrintSupport: convert 0 with nullptr (c++11)

Change-Id: I35a8022c78427c9b4d4a9d9941770d22c36c3be8
Reviewed-by: David Faure <david.faure@kdab.com>
This commit is contained in:
Laurent Montel 2017-10-10 10:16:59 +02:00 committed by Jędrzej Nowacki
parent 8d75c6765d
commit 40192995a5
19 changed files with 34 additions and 34 deletions

View File

@ -471,7 +471,7 @@ void QPrintDialog::done(int result)
if (d->receiverToDisconnectOnClose) {
disconnect(this, SIGNAL(accepted(QPrinter*)),
d->receiverToDisconnectOnClose, d->memberToDisconnectOnClose);
d->receiverToDisconnectOnClose = 0;
d->receiverToDisconnectOnClose = nullptr;
}
d->memberToDisconnectOnClose.clear();
}

View File

@ -81,7 +81,7 @@ public:
Q_DECLARE_FLAGS(PrintDialogOptions, PrintDialogOption)
Q_FLAG(PrintDialogOptions)
explicit QAbstractPrintDialog(QPrinter *printer, QWidget *parent = Q_NULLPTR);
explicit QAbstractPrintDialog(QPrinter *printer, QWidget *parent = nullptr);
~QAbstractPrintDialog();
int exec() override = 0;
@ -108,7 +108,7 @@ public:
QPrinter *printer() const;
protected:
QAbstractPrintDialog(QAbstractPrintDialogPrivate &ptr, QPrinter *printer, QWidget *parent = Q_NULLPTR);
QAbstractPrintDialog(QAbstractPrintDialogPrivate &ptr, QPrinter *printer, QWidget *parent = nullptr);
private:
Q_DISABLE_COPY(QAbstractPrintDialog)

View File

@ -69,7 +69,7 @@ class QAbstractPrintDialogPrivate : public QDialogPrivate
public:
QAbstractPrintDialogPrivate()
: printer(0), pd(0), ownsPrinter(false)
: printer(nullptr), pd(nullptr), ownsPrinter(false)
, options(QAbstractPrintDialog::PrintToFile | QAbstractPrintDialog::PrintPageRange |
QAbstractPrintDialog::PrintCollateCopies | QAbstractPrintDialog::PrintShowPageSize),
minPage(0), maxPage(INT_MAX)

View File

@ -57,8 +57,8 @@ class Q_PRINTSUPPORT_EXPORT QPageSetupDialog : public QDialog
Q_DECLARE_PRIVATE(QPageSetupDialog)
public:
explicit QPageSetupDialog(QPrinter *printer, QWidget *parent = Q_NULLPTR);
explicit QPageSetupDialog(QWidget *parent = Q_NULLPTR);
explicit QPageSetupDialog(QPrinter *printer, QWidget *parent = nullptr);
explicit QPageSetupDialog(QWidget *parent = nullptr);
~QPageSetupDialog();
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)

View File

@ -71,7 +71,7 @@ class QPageSetupDialogPrivate : public QDialogPrivate
Q_DECLARE_PUBLIC(QPageSetupDialog)
public:
QPageSetupDialogPrivate(QPrinter *printer);
explicit QPageSetupDialogPrivate(QPrinter *printer);
void setPrinter(QPrinter *newPrinter);

View File

@ -230,8 +230,8 @@ void QUnixPageSetupDialogPrivate::init()
QPageSetupWidget::QPageSetupWidget(QWidget *parent)
: QWidget(parent),
m_pagePreview(0),
m_printer(0),
m_pagePreview(nullptr),
m_printer(nullptr),
m_outputFormat(QPrinter::PdfFormat),
m_units(QPageLayout::Point),
m_blockSignals(false)

View File

@ -69,8 +69,8 @@ class QPagePreview;
class QPageSetupWidget : public QWidget {
Q_OBJECT
public:
explicit QPageSetupWidget(QWidget *parent = 0);
explicit QPageSetupWidget(QPrinter *printer, QWidget *parent = 0);
explicit QPageSetupWidget(QWidget *parent = nullptr);
explicit QPageSetupWidget(QPrinter *printer, QWidget *parent = nullptr);
void setPrinter(QPrinter *printer);
void selectPrinter(QPrinter::OutputFormat outputFormat, const QString &printerName);

View File

@ -59,8 +59,8 @@ class Q_PRINTSUPPORT_EXPORT QPrintDialog : public QAbstractPrintDialog
Q_PROPERTY(PrintDialogOptions options READ options WRITE setOptions)
public:
explicit QPrintDialog(QPrinter *printer, QWidget *parent = Q_NULLPTR);
explicit QPrintDialog(QWidget *parent = Q_NULLPTR);
explicit QPrintDialog(QPrinter *printer, QWidget *parent = nullptr);
explicit QPrintDialog(QWidget *parent = nullptr);
~QPrintDialog();
int exec() Q_DECL_OVERRIDE;

View File

@ -608,7 +608,7 @@ QPrintDialog::QPrintDialog(QPrinter *printer, QWidget *parent)
Constructs a print dialog with the given \a parent.
*/
QPrintDialog::QPrintDialog(QWidget *parent)
: QAbstractPrintDialog(*(new QPrintDialogPrivate), 0, parent)
: QAbstractPrintDialog(*(new QPrintDialogPrivate), nullptr, parent)
{
Q_D(QPrintDialog);
d->init();
@ -656,7 +656,7 @@ void QPrintDialog::accept()
/*! \internal
*/
QUnixPrintWidgetPrivate::QUnixPrintWidgetPrivate(QUnixPrintWidget *p, QPrinter *prn)
: parent(p), propertiesDialog(0), printer(prn), optionsPane(0),
: parent(p), propertiesDialog(nullptr), printer(prn), optionsPane(0),
filePrintersAdded(false), propertiesDialogShown(false)
{
q = 0;
@ -788,7 +788,7 @@ void QUnixPrintWidgetPrivate::_q_btnBrowseClicked()
QString filename = widget.filename->text();
#if QT_CONFIG(filedialog)
filename = QFileDialog::getSaveFileName(parent, QPrintDialog::tr("Print To File ..."), filename,
QString(), 0, QFileDialog::DontConfirmOverwrite);
QString(), nullptr, QFileDialog::DontConfirmOverwrite);
#else
filename.clear();
#endif

View File

@ -79,7 +79,7 @@ class QPrintPreviewMainWindow : public QMainWindow
{
public:
QPrintPreviewMainWindow(QWidget *parent) : QMainWindow(parent) {}
QMenu *createPopupMenu() Q_DECL_OVERRIDE { return 0; }
QMenu *createPopupMenu() Q_DECL_OVERRIDE { return nullptr; }
};
class ZoomFactorValidator : public QDoubleValidator

View File

@ -58,8 +58,8 @@ class Q_PRINTSUPPORT_EXPORT QPrintPreviewDialog : public QDialog
Q_DECLARE_PRIVATE(QPrintPreviewDialog)
public:
explicit QPrintPreviewDialog(QWidget *parent = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags());
explicit QPrintPreviewDialog(QPrinter *printer, QWidget *parent = Q_NULLPTR,
explicit QPrintPreviewDialog(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
explicit QPrintPreviewDialog(QPrinter *printer, QWidget *parent = nullptr,
Qt::WindowFlags flags = Qt::WindowFlags());
~QPrintPreviewDialog();

View File

@ -69,8 +69,8 @@ QPreviewPaintEngine::QPreviewPaintEngine()
: QPaintEngine(*(new QPreviewPaintEnginePrivate), PaintEngineFeatures(AllFeatures & ~ObjectBoundingModeGradients))
{
Q_D(QPreviewPaintEngine);
d->proxy_print_engine = 0;
d->proxy_paint_engine = 0;
d->proxy_print_engine = nullptr;
d->proxy_paint_engine = nullptr;
}
QPreviewPaintEngine::~QPreviewPaintEngine()
@ -102,8 +102,8 @@ bool QPreviewPaintEngine::end()
Q_D(QPreviewPaintEngine);
delete d->painter;
d->painter = 0;
d->engine = 0;
d->painter = nullptr;
d->engine = nullptr;
d->state = QPrinter::Idle;
return true;
}

View File

@ -70,12 +70,12 @@ QPlatformPrinterSupport::~QPlatformPrinterSupport()
QPrintEngine *QPlatformPrinterSupport::createNativePrintEngine(QPrinter::PrinterMode, const QString &)
{
return 0;
return nullptr;
}
QPaintEngine *QPlatformPrinterSupport::createPaintEngine(QPrintEngine *, QPrinter::PrinterMode)
{
return 0;
return nullptr;
}
QPrintDevice QPlatformPrinterSupport::createPrintDevice(QPlatformPrintDevice *device)

View File

@ -60,12 +60,12 @@ QPlatformPrinterSupportPlugin::~QPlatformPrinterSupportPlugin()
{
}
static QPlatformPrinterSupport *printerSupport = 0;
static QPlatformPrinterSupport *printerSupport = nullptr;
static void cleanupPrinterSupport()
{
delete printerSupport;
printerSupport = 0;
printerSupport = nullptr;
}
/*!

View File

@ -381,7 +381,7 @@ void QPdfPrintEnginePrivate::closePrintDevice()
#endif
fd = -1;
delete outDevice;
outDevice = 0;
outDevice = nullptr;
}
}

View File

@ -132,7 +132,7 @@ void QPrinterPrivate::initEngines(QPrinter::OutputFormat format, const QPrinterI
{
// Default to PdfFormat
outputFormat = QPrinter::PdfFormat;
QPlatformPrinterSupport *ps = 0;
QPlatformPrinterSupport *ps = nullptr;
QString printerName;
// Only set NativeFormat if we have a valid plugin and printer to use

View File

@ -71,7 +71,7 @@ class QCupsJobWidget : public QWidget
Q_OBJECT
public:
explicit QCupsJobWidget(QWidget *parent = 0);
explicit QCupsJobWidget(QWidget *parent = nullptr);
~QCupsJobWidget();
void setPrinter(QPrinter *printer);
void setupPrinter();

View File

@ -145,7 +145,7 @@ class GraphicsView : public QGraphicsView
{
Q_OBJECT
public:
GraphicsView(QWidget* parent = 0)
GraphicsView(QWidget* parent = nullptr)
: QGraphicsView(parent)
{
#ifdef Q_OS_MAC
@ -179,7 +179,7 @@ class QPrintPreviewWidgetPrivate : public QWidgetPrivate
Q_DECLARE_PUBLIC(QPrintPreviewWidget)
public:
QPrintPreviewWidgetPrivate()
: scene(0), curPage(1),
: scene(nullptr), curPage(1),
viewMode(QPrintPreviewWidget::SinglePageView),
zoomMode(QPrintPreviewWidget::FitInView),
zoomFactor(1), initialized(false), fitting(true)

View File

@ -69,9 +69,9 @@ public:
FitInView
};
explicit QPrintPreviewWidget(QPrinter *printer, QWidget *parent = Q_NULLPTR,
explicit QPrintPreviewWidget(QPrinter *printer, QWidget *parent = nullptr,
Qt::WindowFlags flags = Qt::WindowFlags());
explicit QPrintPreviewWidget(QWidget *parent = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags());
explicit QPrintPreviewWidget(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
~QPrintPreviewWidget();
qreal zoomFactor() const;