From ece0c0a5e7e0b18beb58ccd868bde54c7be64f78 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 22 Nov 2019 14:46:58 +0100 Subject: Tidy nullptr usage Move away from using 0 as pointer literal. Done using clang-tidy. This is not complete as run-clang-tidy can't handle all of qtbase in one go. Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0 Reviewed-by: Friedemann Kleint Reviewed-by: Lars Knoll --- src/widgets/widgets/qwidgettextcontrol.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/widgets/widgets/qwidgettextcontrol.cpp') diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp index 1c169c3325..0b3c30312d 100644 --- a/src/widgets/widgets/qwidgettextcontrol.cpp +++ b/src/widgets/widgets/qwidgettextcontrol.cpp @@ -125,7 +125,7 @@ static QTextLine currentTextLine(const QTextCursor &cursor) } QWidgetTextControlPrivate::QWidgetTextControlPrivate() - : doc(0), cursorOn(false), cursorVisible(false), cursorIsFocusIndicator(false), + : doc(nullptr), cursorOn(false), cursorVisible(false), cursorIsFocusIndicator(false), #ifndef Q_OS_ANDROID interactionFlags(Qt::TextEditorInteraction), #else @@ -683,7 +683,7 @@ void QWidgetTextControlPrivate::_q_contentsChanged(int from, int charsRemoved, i // always report the right number of removed chars, but in lack of the real string use spaces QString oldText = QString(charsRemoved, QLatin1Char(' ')); - QAccessibleEvent *ev = 0; + QAccessibleEvent *ev = nullptr; if (charsRemoved == 0) { ev = new QAccessibleTextInsertEvent(q->parent(), from, newText); } else if (charsAdded == 0) { @@ -906,12 +906,12 @@ void QWidgetTextControl::setDocument(QTextDocument *document) d->doc->disconnect(this); d->doc->documentLayout()->disconnect(this); - d->doc->documentLayout()->setPaintDevice(0); + d->doc->documentLayout()->setPaintDevice(nullptr); if (d->doc->parent() == this) delete d->doc; - d->doc = 0; + d->doc = nullptr; d->setContent(Qt::RichText, QString(), document); } @@ -2302,7 +2302,7 @@ QMenu *QWidgetTextControl::createStandardContextMenu(const QPointF &pos, QWidget d->linkToCopy = anchorAt(pos); if (d->linkToCopy.isEmpty() && !showTextSelectionActions) - return 0; + return nullptr; QMenu *menu = new QMenu(parent); QAction *a; @@ -2656,7 +2656,7 @@ void QWidgetTextControl::print(QPagedPaintDevice *printer) const Q_D(const QWidgetTextControl); if (!printer) return; - QTextDocument *tempDoc = 0; + QTextDocument *tempDoc = nullptr; const QTextDocument *doc = d->doc; if (QPagedPaintDevicePrivate::get(printer)->printSelectionOnly) { if (!d->cursor.hasSelection()) -- cgit v1.2.3