Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.
C++
Qt6: Explicitly check the weak pointer instead of converting to bool
Halla Rempt83cb99d880fa
diff --git a/libs/ui/tool/KisAsynchronousStrokeUpdateHelper.cpp b/libs/ui/tool/KisAsynchronousStrokeUpdateHelper.cppindex d56b9fe860..992c76896c 100644--- a/libs/ui/tool/KisAsynchronousStrokeUpdateHelper.cpp+++ b/libs/ui/tool/KisAsynchronousStrokeUpdateHelper.cpp@@ -59,7 +59,7 @@ void KisAsynchronousStrokeUpdateHelper::cancelUpdateStream()bool KisAsynchronousStrokeUpdateHelper::isActive() const{- return m_strokeId;+ return !m_strokeId.isNull();}void KisAsynchronousStrokeUpdateHelper::setCustomUpdateDataFactory(KisAsynchronousStrokeUpdateHelper::UpdateDataFactory factory)diff --git a/libs/ui/tool/kis_tool_freehand_helper.cpp b/libs/ui/tool/kis_tool_freehand_helper.cppindex 45ded692a1..7f72511caa 100644--- a/libs/ui/tool/kis_tool_freehand_helper.cpp+++ b/libs/ui/tool/kis_tool_freehand_helper.cpp@@ -259,7 +259,7 @@ void KisToolFreehandHelper::initPaint(KoPointerEvent *event,bool KisToolFreehandHelper::isRunning() const{- return m_d->strokeId;+ return !m_d->strokeId.isNull();}void KisToolFreehandHelper::initPaintImpl(qreal startAngle,diff --git a/libs/ui/tool/strokes/kis_painter_based_stroke_strategy.cpp b/libs/ui/tool/strokes/kis_painter_based_stroke_strategy.cppindex b76bedf70c..545dfae166 100644--- a/libs/ui/tool/strokes/kis_painter_based_stroke_strategy.cpp+++ b/libs/ui/tool/strokes/kis_painter_based_stroke_strategy.cpp@@ -124,7 +124,7 @@ int KisPainterBasedStrokeStrategy::numMaskedPainters() constbool KisPainterBasedStrokeStrategy::needsMaskingUpdates() const{- return m_maskingBrushRenderer;+ return !m_maskingBrushRenderer.isNull();}QVector<KisRunnableStrokeJobData *> KisPainterBasedStrokeStrategy::doMaskingBrushUpdates(const QVector<QRect> &rects)