From c0a8c84eb4bfa8be5fc77d44d25c1a523c022d5c Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 25 Nov 2019 11:49:14 +0100 Subject: Avoid initializing QFlags with 0 or nullptr in further cases Amends 744e77b841878fb017c0f2d60607090008f28180. Change-Id: I16e37aaf503eb62f67fca0e48be4c92c4a72ae46 Reviewed-by: Ulf Hermann --- src/quick/items/qquickflickable.cpp | 2 +- src/quick/items/qquickgenericshadereffect.cpp | 2 +- src/quick/items/qquickmousearea.cpp | 2 +- src/quick/items/qquickpainteditem.cpp | 1 - src/quick/items/qquickscreen.cpp | 3 --- src/quick/items/qquickscreen_p.h | 4 ++-- src/quick/items/qquickstateoperations.cpp | 5 ----- src/quick/items/qquickwindow.cpp | 4 ++-- 8 files changed, 7 insertions(+), 16 deletions(-) (limited to 'src/quick/items') diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp index d9ec7de611..8ade5b7e37 100644 --- a/src/quick/items/qquickflickable.cpp +++ b/src/quick/items/qquickflickable.cpp @@ -316,7 +316,7 @@ void QQuickFlickablePrivate::itemGeometryChanged(QQuickItem *item, QQuickGeometr { Q_Q(QQuickFlickable); if (item == contentItem) { - Qt::Orientations orient = nullptr; + Qt::Orientations orient; if (change.xChange()) orient |= Qt::Horizontal; if (change.yChange()) diff --git a/src/quick/items/qquickgenericshadereffect.cpp b/src/quick/items/qquickgenericshadereffect.cpp index f42b7e6580..a3d04f5dd3 100644 --- a/src/quick/items/qquickgenericshadereffect.cpp +++ b/src/quick/items/qquickgenericshadereffect.cpp @@ -310,7 +310,7 @@ QSGNode *QQuickGenericShaderEffect::handleUpdatePaintNode(QSGNode *oldNode, QQui m_dirty &= ~QSGShaderEffectNode::DirtyShaderGeometry; } - m_dirty = nullptr; + m_dirty = {}; for (int i = 0; i < NShader; ++i) { m_dirtyConstants[i].clear(); m_dirtyTextures[i].clear(); diff --git a/src/quick/items/qquickmousearea.cpp b/src/quick/items/qquickmousearea.cpp index ddf34798d7..24042da2a9 100644 --- a/src/quick/items/qquickmousearea.cpp +++ b/src/quick/items/qquickmousearea.cpp @@ -62,7 +62,7 @@ Q_DECLARE_LOGGING_CATEGORY(DBG_HOVER_TRACE) QQuickMouseAreaPrivate::QQuickMouseAreaPrivate() : enabled(true), scrollGestureEnabled(true), hovered(false), longPress(false), moved(false), stealMouse(false), doubleClick(false), preventStealing(false), - propagateComposedEvents(false), overThreshold(false), pressed(nullptr), + propagateComposedEvents(false), overThreshold(false), pressAndHoldInterval(-1) #if QT_CONFIG(quick_draganddrop) , drag(nullptr) diff --git a/src/quick/items/qquickpainteditem.cpp b/src/quick/items/qquickpainteditem.cpp index 57848919f3..386c8d8862 100644 --- a/src/quick/items/qquickpainteditem.cpp +++ b/src/quick/items/qquickpainteditem.cpp @@ -133,7 +133,6 @@ QQuickPaintedItemPrivate::QQuickPaintedItemPrivate() , contentsScale(1.0) , fillColor(Qt::transparent) , renderTarget(QQuickPaintedItem::Image) - , performanceHints(nullptr) , opaquePainting(false) , antialiasing(false) , mipmap(false) diff --git a/src/quick/items/qquickscreen.cpp b/src/quick/items/qquickscreen.cpp index b17e505f4f..ed2d7eda3e 100644 --- a/src/quick/items/qquickscreen.cpp +++ b/src/quick/items/qquickscreen.cpp @@ -424,9 +424,6 @@ QScreen *QQuickScreenInfo::wrappedScreen() const QQuickScreenAttached::QQuickScreenAttached(QObject* attachee) : QQuickScreenInfo(attachee) - , m_window(nullptr) - , m_updateMask(nullptr) - , m_updateMaskSet(false) { m_attachee = qobject_cast(attachee); diff --git a/src/quick/items/qquickscreen_p.h b/src/quick/items/qquickscreen_p.h index 61cbdf7387..b4266d78c7 100644 --- a/src/quick/items/qquickscreen_p.h +++ b/src/quick/items/qquickscreen_p.h @@ -152,10 +152,10 @@ protected Q_SLOTS: void screenChanged(QScreen*); private: - QQuickWindow* m_window; + QQuickWindow* m_window = nullptr; QQuickItem* m_attachee; Qt::ScreenOrientations m_updateMask; - bool m_updateMaskSet; + bool m_updateMaskSet = false; }; class Q_QUICK_PRIVATE_EXPORT QQuickScreen : public QObject diff --git a/src/quick/items/qquickstateoperations.cpp b/src/quick/items/qquickstateoperations.cpp index 07767d377d..ddaa1979b6 100644 --- a/src/quick/items/qquickstateoperations.cpp +++ b/src/quick/items/qquickstateoperations.cpp @@ -600,11 +600,6 @@ class QQuickAnchorSetPrivate : public QObjectPrivate { Q_DECLARE_PUBLIC(QQuickAnchorSet) public: - QQuickAnchorSetPrivate() - : usedAnchors(nullptr), resetAnchors(nullptr) - { - } - QQuickAnchors::Anchors usedAnchors; QQuickAnchors::Anchors resetAnchors; diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index fec70191ca..40872866df 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -527,7 +527,7 @@ void QQuickWindowPrivate::renderSceneGraph(const QSize &size, const QSize &surfa renderer->setDeviceRect(rect); renderer->setViewportRect(rect); const bool flipY = rhi ? !rhi->isYUpInNDC() : false; - QSGAbstractRenderer::MatrixTransformFlags matrixFlags = 0; + QSGAbstractRenderer::MatrixTransformFlags matrixFlags; if (flipY) matrixFlags |= QSGAbstractRenderer::MatrixTransformFlipY; renderer->setProjectionMatrixToRect(QRectF(QPoint(0, 0), logicalSize), matrixFlags); @@ -4444,7 +4444,7 @@ bool QQuickWindow::clearBeforeRendering() const QSGTexture *QQuickWindow::createTextureFromImage(const QImage &image) const { - return createTextureFromImage(image, nullptr); + return createTextureFromImage(image, {}); } -- cgit v1.2.3