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/kernel/qwidgetrepaintmanager.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/widgets/kernel/qwidgetrepaintmanager.cpp') diff --git a/src/widgets/kernel/qwidgetrepaintmanager.cpp b/src/widgets/kernel/qwidgetrepaintmanager.cpp index c3211e275f..135a1527ac 100644 --- a/src/widgets/kernel/qwidgetrepaintmanager.cpp +++ b/src/widgets/kernel/qwidgetrepaintmanager.cpp @@ -695,7 +695,7 @@ static QPlatformTextureList *widgetTexturesFor(QWidget *tlw, QWidget *widget) return qt_dummy_platformTextureList(); } - return 0; + return nullptr; } #else @@ -788,7 +788,7 @@ bool QWidgetRepaintManager::syncAllowed() QTLWExtra *tlwExtra = tlw->d_func()->maybeTopData(); if (textureListWatcher && !textureListWatcher->isLocked()) { textureListWatcher->deleteLater(); - textureListWatcher = 0; + textureListWatcher = nullptr; } else if (!tlwExtra->widgetTextures.empty()) { bool skipSync = false; for (const auto &tl : tlwExtra->widgetTextures) { @@ -822,7 +822,7 @@ void QWidgetRepaintManager::paintAndFlush() if (hasStaticContents() && !store->size().isEmpty() ) { // Repaint existing dirty area and newly visible area. const QRect clipRect(0, 0, surfaceGeometry.width(), surfaceGeometry.height()); - const QRegion staticRegion(staticContents(0, clipRect)); + const QRegion staticRegion(staticContents(nullptr, clipRect)); QRegion newVisible(0, 0, tlwRect.width(), tlwRect.height()); newVisible -= staticRegion; dirty += newVisible; @@ -1008,13 +1008,13 @@ void QWidgetRepaintManager::paintAndFlush() QPoint offset; if (w != tlw) offset += w->mapTo(tlw, QPoint()); - wd->drawWidget(store->paintDevice(), toBePainted, offset, flags, 0, this); + wd->drawWidget(store->paintDevice(), toBePainted, offset, flags, nullptr, this); } // Paint the rest with composition. if (repaintAllWidgets || !dirtyCopy.isEmpty()) { QWidgetPrivate::DrawWidgetFlags flags = QWidgetPrivate::DrawAsRoot | QWidgetPrivate::DrawRecursive; - tlw->d_func()->drawWidget(store->paintDevice(), dirtyCopy, QPoint(), flags, 0, this); + tlw->d_func()->drawWidget(store->paintDevice(), dirtyCopy, QPoint(), flags, nullptr, this); } store->endPaint(); @@ -1108,7 +1108,7 @@ void QWidgetRepaintManager::flush() for (QWidget *w : qExchange(needsFlushWidgets, {})) { QWidgetPrivate *wd = w->d_func(); Q_ASSERT(wd->needsFlush); - QPlatformTextureList *widgetTexturesForNative = wd->textureChildSeen ? widgetTexturesFor(tlw, w) : 0; + QPlatformTextureList *widgetTexturesForNative = wd->textureChildSeen ? widgetTexturesFor(tlw, w) : nullptr; flush(w, *wd->needsFlush, widgetTexturesForNative); *wd->needsFlush = QRegion(); } @@ -1284,7 +1284,7 @@ QRegion QWidgetRepaintManager::staticContents(QWidget *parent, const QRect &with wd->clipToEffectiveMask(visible); if (visible.isEmpty()) continue; - wd->subtractOpaqueSiblings(visible, 0, /*alsoNonOpaque=*/true); + wd->subtractOpaqueSiblings(visible, nullptr, /*alsoNonOpaque=*/true); visible.translate(offset); region += visible; @@ -1331,7 +1331,7 @@ void QWidgetPrivate::invalidateBackingStore_resizeHelper(const QPoint &oldPos, c if (!staticContents || graphicsEffect) { QRegion staticChildren; - QWidgetRepaintManager *bs = 0; + QWidgetRepaintManager *bs = nullptr; if (offset.isNull() && (bs = maybeRepaintManager())) staticChildren = bs->staticContents(q, oldWidgetRect); const bool hasStaticChildren = !staticChildren.isEmpty(); -- cgit v1.2.3