From 57f446b21bb486bab05bf0d833df1e9a9b3bc4e2 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Thu, 26 Mar 2020 23:03:50 +0000 Subject: [PATCH] replace 0 with Q_NULLPTR where applicable Signed-off-by: Ivailo Monev --- src/gui/kernel/qapplication.cpp | 10 +++++----- src/gui/kernel/qwidget.cpp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 1e0583124..c4074b526 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -812,11 +812,11 @@ QApplication::~QApplication() } delete qt_desktopWidget; - qt_desktopWidget = 0; + qt_desktopWidget = Q_NULLPTR; #ifndef QT_NO_CLIPBOARD delete qt_clipboard; - qt_clipboard = 0; + qt_clipboard = Q_NULLPTR; #endif #if defined(Q_WS_X11) @@ -2644,12 +2644,12 @@ QDesktopWidget *QApplication::desktop() */ QClipboard *QApplication::clipboard() { - if (qt_clipboard == 0) { + if (!qt_clipboard) { if (Q_UNLIKELY(!qApp)) { qWarning("QApplication: Must construct a QApplication before accessing a QClipboard"); - return 0; + return Q_NULLPTR; } - qt_clipboard = new QClipboard(0); + qt_clipboard = new QClipboard(Q_NULLPTR); } return qt_clipboard; } diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index a4cff8cb5..61e58503a 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -1286,7 +1286,7 @@ void QWidgetPrivate::setWinId(WId id) // set widget identifier // will have the same windowid (the root window id) as the // qt_desktopWidget. We should not add the second desktop widget // to the mapper. - bool userDesktopWidget = qt_desktopWidget != 0 && qt_desktopWidget != q && q->windowType() == Qt::Desktop; + bool userDesktopWidget = (qt_desktopWidget && qt_desktopWidget != q && q->windowType() == Qt::Desktop); if (mapper && data.winid && !userDesktopWidget) { mapper->remove(data.winid); } -- 2.11.0