diff --git a/python/core/geometry/qgsabstractgeometry.sip b/python/core/geometry/qgsabstractgeometry.sip index 0289ac3e70a9..9a9f69365270 100644 --- a/python/core/geometry/qgsabstractgeometry.sip +++ b/python/core/geometry/qgsabstractgeometry.sip @@ -646,6 +646,9 @@ class QgsVertexIterator %End public: QgsVertexIterator(); +%Docstring +Constructor for QgsVertexIterator +%End QgsVertexIterator( const QgsAbstractGeometry *geometry ); %Docstring diff --git a/src/3d/chunks/qgschunklist_p.cpp b/src/3d/chunks/qgschunklist_p.cpp index f7f8508b0453..e38534fdd59e 100644 --- a/src/3d/chunks/qgschunklist_p.cpp +++ b/src/3d/chunks/qgschunklist_p.cpp @@ -19,13 +19,6 @@ ///@cond PRIVATE -QgsChunkList::QgsChunkList() - : mHead( nullptr ) - , mTail( nullptr ) - , mCount( 0 ) -{ -} - int QgsChunkList::trueCount() const { int len = 0; diff --git a/src/3d/chunks/qgschunklist_p.h b/src/3d/chunks/qgschunklist_p.h index 70f9454542f3..f3febb72631f 100644 --- a/src/3d/chunks/qgschunklist_p.h +++ b/src/3d/chunks/qgschunklist_p.h @@ -64,7 +64,8 @@ struct QgsChunkListEntry class QgsChunkList { public: - QgsChunkList(); + //! Constructor for QgsChunkList + QgsChunkList() = default; //! Counts the real number of entries by walking the list (for debugging purposes only) int trueCount() const; @@ -99,7 +100,7 @@ class QgsChunkList private: QgsChunkListEntry *mHead = nullptr; QgsChunkListEntry *mTail = nullptr; - int mCount; + int mCount = 0; }; /// @endcond diff --git a/src/3d/qgs3dmapscene.cpp b/src/3d/qgs3dmapscene.cpp index b76d8dfe8059..0af795f80063 100644 --- a/src/3d/qgs3dmapscene.cpp +++ b/src/3d/qgs3dmapscene.cpp @@ -42,7 +42,6 @@ Qgs3DMapScene::Qgs3DMapScene( const Qgs3DMapSettings &map, Qt3DExtras::QForwardRenderer *defaultFrameGraph, Qt3DRender::QRenderSettings *renderSettings, Qt3DRender::QCamera *camera, const QRect &viewportRect, Qt3DCore::QNode *parent ) : Qt3DCore::QEntity( parent ) , mMap( map ) - , mTerrain( nullptr ) , mForwardRenderer( defaultFrameGraph ) { diff --git a/src/3d/qgs3dmapsettings.cpp b/src/3d/qgs3dmapsettings.cpp index 0d102c7e7719..2559a8dcc0f2 100644 --- a/src/3d/qgs3dmapsettings.cpp +++ b/src/3d/qgs3dmapsettings.cpp @@ -26,23 +26,6 @@ #include "qgssymbollayerutils.h" #include "qgsrasterlayer.h" - -Qgs3DMapSettings::Qgs3DMapSettings() - : mOriginX( 0 ) - , mOriginY( 0 ) - , mOriginZ( 0 ) - , mBackgroundColor( Qt::black ) - , mTerrainVerticalScale( 1 ) - , mMapTileResolution( 512 ) - , mMaxTerrainScreenError( 3.f ) - , mMaxTerrainGroundError( 1.f ) - , mShowTerrainBoundingBoxes( false ) - , mShowTerrainTileInfo( false ) - , mShowLabels( false ) - , mSkyboxEnabled( false ) -{ -} - Qgs3DMapSettings::Qgs3DMapSettings( const Qgs3DMapSettings &other ) : QObject() , mOriginX( other.mOriginX ) diff --git a/src/3d/qgs3dmapsettings.h b/src/3d/qgs3dmapsettings.h index b522a11242ab..eeefd8d9b877 100644 --- a/src/3d/qgs3dmapsettings.h +++ b/src/3d/qgs3dmapsettings.h @@ -47,7 +47,9 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject { Q_OBJECT public: - Qgs3DMapSettings(); + + //! Constructor for Qgs3DMapSettings + Qgs3DMapSettings() = default; //! Copy constructor Qgs3DMapSettings( const Qgs3DMapSettings &other ); ~Qgs3DMapSettings(); @@ -206,23 +208,28 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject void showLabelsChanged(); private: - double mOriginX, mOriginY, mOriginZ; //!< Coordinates in map CRS at which our 3D world has origin (0,0,0) + //! X coordinate in map CRS at which our 3D world has origin (0,0,0) + double mOriginX = 0; + //! Y coordinate in map CRS at which our 3D world has origin (0,0,0) + double mOriginY = 0; + //! Z coordinate in map CRS at which our 3D world has origin (0,0,0) + double mOriginZ = 0; QgsCoordinateReferenceSystem mCrs; //!< Destination coordinate system of the world - QColor mBackgroundColor; //!< Background color of the scene - QColor mSelectionColor; //!< Color to be used for selected map features - double mTerrainVerticalScale; //!< Multiplier of terrain heights to make the terrain shape more pronounced + QColor mBackgroundColor = Qt::black; //!< Background color of the scene + QColor mSelectionColor; //!< Color to be used for selected map features + double mTerrainVerticalScale = 1; //!< Multiplier of terrain heights to make the terrain shape more pronounced std::unique_ptr mTerrainGenerator; //!< Implementation of the terrain generation - int mMapTileResolution; //!< Size of map textures of tiles in pixels (width/height) - float mMaxTerrainScreenError; //!< Maximum allowed terrain error in pixels (determines when tiles are switched to more detailed ones) - float mMaxTerrainGroundError; //!< Maximum allowed horizontal map error in map units (determines how many zoom levels will be used) - bool mShowTerrainBoundingBoxes; //!< Whether to show bounding boxes of entities - useful for debugging - bool mShowTerrainTileInfo; //!< Whether to draw extra information about terrain tiles to the textures - useful for debugging - bool mShowLabels; //!< Whether to display labels on terrain tiles + int mMapTileResolution = 512; //!< Size of map textures of tiles in pixels (width/height) + float mMaxTerrainScreenError = 3.f; //!< Maximum allowed terrain error in pixels (determines when tiles are switched to more detailed ones) + float mMaxTerrainGroundError = 1.f; //!< Maximum allowed horizontal map error in map units (determines how many zoom levels will be used) + bool mShowTerrainBoundingBoxes = false; //!< Whether to show bounding boxes of entities - useful for debugging + bool mShowTerrainTileInfo = false; //!< Whether to draw extra information about terrain tiles to the textures - useful for debugging + bool mShowLabels = false; //!< Whether to display labels on terrain tiles QList mLayers; //!< Layers to be rendered QList mRenderers; //!< Extra stuff to render as 3D object - bool mSkyboxEnabled; //!< Whether to render skybox - QString mSkyboxFileBase; //!< Base part of the files with skybox textures - QString mSkyboxFileExtension; //!< Extension part of the files with skybox textures + bool mSkyboxEnabled = false; //!< Whether to render skybox + QString mSkyboxFileBase; //!< Base part of the files with skybox textures + QString mSkyboxFileExtension; //!< Extension part of the files with skybox textures }; diff --git a/src/3d/qgsaabb.cpp b/src/3d/qgsaabb.cpp index 3ac101d50787..2dc9544f2f6b 100644 --- a/src/3d/qgsaabb.cpp +++ b/src/3d/qgsaabb.cpp @@ -15,11 +15,6 @@ #include "qgsaabb.h" -QgsAABB::QgsAABB() - : xMin( 0 ), yMin( 0 ), zMin( 0 ), xMax( 0 ), yMax( 0 ), zMax( 0 ) -{ -} - QgsAABB::QgsAABB( float xMin, float yMin, float zMin, float xMax, float yMax, float zMax ) : xMin( xMin ), yMin( yMin ), zMin( zMin ), xMax( xMax ), yMax( yMax ), zMax( zMax ) { diff --git a/src/3d/qgsaabb.h b/src/3d/qgsaabb.h index 84319bebb89e..7b0e7f201d8f 100644 --- a/src/3d/qgsaabb.h +++ b/src/3d/qgsaabb.h @@ -31,7 +31,7 @@ class _3D_EXPORT QgsAABB { public: //! Constructs bounding box with null coordinates - QgsAABB(); + QgsAABB() = default; //! Constructs bounding box QgsAABB( float xMin, float yMin, float zMin, float xMax, float yMax, float zMax ); @@ -72,8 +72,12 @@ class _3D_EXPORT QgsAABB //! Returns a list of pairs of vertices (useful for display of bounding boxes) QList verticesForLines() const; - float xMin, yMin, zMin; - float xMax, yMax, zMax; + float xMin = 0.0f; + float yMin = 0.0f; + float zMin = 0.0f; + float xMax = 0.0f; + float yMax = 0.0f; + float zMax = 0.0f; }; #endif // QGSAABB_H diff --git a/src/3d/qgscameracontroller.cpp b/src/3d/qgscameracontroller.cpp index 590bd871003e..2b323bf8802a 100644 --- a/src/3d/qgscameracontroller.cpp +++ b/src/3d/qgscameracontroller.cpp @@ -23,7 +23,6 @@ QgsCameraController::QgsCameraController( Qt3DCore::QNode *parent ) : Qt3DCore::QEntity( parent ) - , mLastPressedHeight( 0 ) , mMouseDevice( new Qt3DInput::QMouseDevice() ) , mKeyboardDevice( new Qt3DInput::QKeyboardDevice() ) , mMouseHandler( new Qt3DInput::QMouseHandler ) diff --git a/src/3d/qgscameracontroller.h b/src/3d/qgscameracontroller.h index 1b2c974094d5..6d4aa8ec2481 100644 --- a/src/3d/qgscameracontroller.h +++ b/src/3d/qgscameracontroller.h @@ -76,7 +76,7 @@ class _3D_EXPORT QgsCameraController : public Qt3DCore::QEntity //! used for computation of translation when dragging mouse QRect mViewport; //! height of terrain when mouse button was last pressed - for camera control - float mLastPressedHeight; + float mLastPressedHeight = 0; struct CameraData { diff --git a/src/3d/qgsphongmaterialsettings.h b/src/3d/qgsphongmaterialsettings.h index 800d632fcf59..2bfb00ab48db 100644 --- a/src/3d/qgsphongmaterialsettings.h +++ b/src/3d/qgsphongmaterialsettings.h @@ -35,7 +35,6 @@ class _3D_EXPORT QgsPhongMaterialSettings : mAmbient( QColor::fromRgbF( 0.1f, 0.1f, 0.1f, 1.0f ) ) , mDiffuse( QColor::fromRgbF( 0.7f, 0.7f, 0.7f, 1.0f ) ) , mSpecular( QColor::fromRgbF( 1.0f, 1.0f, 1.0f, 1.0f ) ) - , mShininess( 0.0f ) { } @@ -66,7 +65,7 @@ class _3D_EXPORT QgsPhongMaterialSettings QColor mAmbient; QColor mDiffuse; QColor mSpecular; - float mShininess; + float mShininess = 0.0f; }; diff --git a/src/3d/qgstessellatedpolygongeometry.cpp b/src/3d/qgstessellatedpolygongeometry.cpp index e10194ef842b..163c2b6467ca 100644 --- a/src/3d/qgstessellatedpolygongeometry.cpp +++ b/src/3d/qgstessellatedpolygongeometry.cpp @@ -27,11 +27,7 @@ QgsTessellatedPolygonGeometry::QgsTessellatedPolygonGeometry( QNode *parent ) : Qt3DRender::QGeometry( parent ) - , mPositionAttribute( nullptr ) - , mNormalAttribute( nullptr ) { - mWithNormals = true; - mVertexBuffer = new Qt3DRender::QBuffer( Qt3DRender::QBuffer::VertexBuffer, this ); QgsTessellator tmpTess( 0, 0, mWithNormals ); diff --git a/src/3d/qgstessellatedpolygongeometry.h b/src/3d/qgstessellatedpolygongeometry.h index 8fc5b8450dbc..7d64554c8e41 100644 --- a/src/3d/qgstessellatedpolygongeometry.h +++ b/src/3d/qgstessellatedpolygongeometry.h @@ -51,7 +51,7 @@ class QgsTessellatedPolygonGeometry : public Qt3DRender::QGeometry Qt3DRender::QAttribute *mNormalAttribute = nullptr; Qt3DRender::QBuffer *mVertexBuffer = nullptr; - bool mWithNormals; + bool mWithNormals = true; }; #endif // QGSTESSELLATEDPOLYGONGEOMETRY_H diff --git a/src/3d/qgstilingscheme.cpp b/src/3d/qgstilingscheme.cpp index 3d7c67225248..dc09bab22b5c 100644 --- a/src/3d/qgstilingscheme.cpp +++ b/src/3d/qgstilingscheme.cpp @@ -17,13 +17,6 @@ #include "qgsrectangle.h" - -QgsTilingScheme::QgsTilingScheme() - : mMapOrigin() - , mBaseTileSide( 0 ) -{ -} - QgsTilingScheme::QgsTilingScheme( const QgsRectangle &fullExtent, const QgsCoordinateReferenceSystem &crs ) : mCrs( crs ) { diff --git a/src/3d/qgstilingscheme.h b/src/3d/qgstilingscheme.h index 6d79caf3da34..829ffa2e25a8 100644 --- a/src/3d/qgstilingscheme.h +++ b/src/3d/qgstilingscheme.h @@ -33,7 +33,7 @@ class _3D_EXPORT QgsTilingScheme { public: //! Creates invalid tiling scheme - QgsTilingScheme(); + QgsTilingScheme() = default; //! Creates tiling scheme where level 0 tile is centered at the full extent and the full extent completely fits into the level 0 tile QgsTilingScheme( const QgsRectangle &fullExtent, const QgsCoordinateReferenceSystem &crs ); @@ -54,7 +54,7 @@ class _3D_EXPORT QgsTilingScheme private: QgsPointXY mMapOrigin; //!< Origin point in map coordinates: (0,0) in the tiling scheme - double mBaseTileSide; //!< Length of tile side at zoom level 0 in map coordinates + double mBaseTileSide = 0; //!< Length of tile side at zoom level 0 in map coordinates QgsCoordinateReferenceSystem mCrs; //!< CRS of the coordinates }; diff --git a/src/3d/symbols/qgsline3dsymbol.cpp b/src/3d/symbols/qgsline3dsymbol.cpp index c1bc4497bab7..39aa1e1b26d7 100644 --- a/src/3d/symbols/qgsline3dsymbol.cpp +++ b/src/3d/symbols/qgsline3dsymbol.cpp @@ -15,16 +15,6 @@ #include "qgsline3dsymbol.h" -QgsLine3DSymbol::QgsLine3DSymbol() - : mAltClamping( AltClampRelative ) - , mAltBinding( AltBindCentroid ) - , mWidth( 2 ) - , mHeight( 0 ) - , mExtrusionHeight( 0 ) -{ - -} - QgsAbstract3DSymbol *QgsLine3DSymbol::clone() const { return new QgsLine3DSymbol( *this ); diff --git a/src/3d/symbols/qgsline3dsymbol.h b/src/3d/symbols/qgsline3dsymbol.h index dad8fb3a8652..5c966706b25e 100644 --- a/src/3d/symbols/qgsline3dsymbol.h +++ b/src/3d/symbols/qgsline3dsymbol.h @@ -31,7 +31,8 @@ class _3D_EXPORT QgsLine3DSymbol : public QgsAbstract3DSymbol { public: - QgsLine3DSymbol(); + //! Constructor for QgsLine3DSymbol + QgsLine3DSymbol() = default; QString type() const override { return "line"; } QgsAbstract3DSymbol *clone() const override SIP_FACTORY; @@ -70,12 +71,14 @@ class _3D_EXPORT QgsLine3DSymbol : public QgsAbstract3DSymbol void setMaterial( const QgsPhongMaterialSettings &material ) { mMaterial = material; } private: - AltitudeClamping mAltClamping; //! how to handle altitude of vector features - AltitudeBinding mAltBinding; //! how to handle clamping of vertices of individual features - - float mWidth; //!< Line width (horizontally) - float mHeight; //!< Base height of polygons - float mExtrusionHeight; //!< How much to extrude (0 means no walls) + //! how to handle altitude of vector features + AltitudeClamping mAltClamping = AltClampRelative; + //! how to handle clamping of vertices of individual features + AltitudeBinding mAltBinding = AltBindCentroid; + + float mWidth = 2.0f; //!< Line width (horizontally) + float mHeight = 0.0f; //!< Base height of polygons + float mExtrusionHeight = 0.0f; //!< How much to extrude (0 means no walls) QgsPhongMaterialSettings mMaterial; //!< Defines appearance of objects }; diff --git a/src/3d/symbols/qgspoint3dsymbol.cpp b/src/3d/symbols/qgspoint3dsymbol.cpp index 669d01c30a47..d1ef1c9ec58a 100644 --- a/src/3d/symbols/qgspoint3dsymbol.cpp +++ b/src/3d/symbols/qgspoint3dsymbol.cpp @@ -18,12 +18,6 @@ #include "qgsreadwritecontext.h" #include "qgsxmlutils.h" - -QgsPoint3DSymbol::QgsPoint3DSymbol() - : mAltClamping( AltClampRelative ) -{ -} - QgsAbstract3DSymbol *QgsPoint3DSymbol::clone() const { return new QgsPoint3DSymbol( *this ); diff --git a/src/3d/symbols/qgspoint3dsymbol.h b/src/3d/symbols/qgspoint3dsymbol.h index 197bf45c240f..859d0d8221f3 100644 --- a/src/3d/symbols/qgspoint3dsymbol.h +++ b/src/3d/symbols/qgspoint3dsymbol.h @@ -32,7 +32,8 @@ class _3D_EXPORT QgsPoint3DSymbol : public QgsAbstract3DSymbol { public: - QgsPoint3DSymbol(); + //! Constructor for QgsPoint3DSymbol. + QgsPoint3DSymbol() = default; QString type() const override { return "point"; } QgsAbstract3DSymbol *clone() const override SIP_FACTORY; @@ -84,7 +85,8 @@ class _3D_EXPORT QgsPoint3DSymbol : public QgsAbstract3DSymbol void setTransform( const QMatrix4x4 &transform ) { mTransform = transform; } private: - AltitudeClamping mAltClamping; //! how to handle altitude of vector features + //! how to handle altitude of vector features + AltitudeClamping mAltClamping = AltClampRelative; QgsPhongMaterialSettings mMaterial; //!< Defines appearance of objects Shape mShape = Cylinder; //!< What kind of shape to use diff --git a/src/3d/symbols/qgspolygon3dsymbol.cpp b/src/3d/symbols/qgspolygon3dsymbol.cpp index 74b403c6572e..6057074144db 100644 --- a/src/3d/symbols/qgspolygon3dsymbol.cpp +++ b/src/3d/symbols/qgspolygon3dsymbol.cpp @@ -15,14 +15,6 @@ #include "qgspolygon3dsymbol.h" -QgsPolygon3DSymbol::QgsPolygon3DSymbol() - : mAltClamping( AltClampRelative ) - , mAltBinding( AltBindCentroid ) - , mHeight( 0 ) - , mExtrusionHeight( 0 ) -{ -} - QgsAbstract3DSymbol *QgsPolygon3DSymbol::clone() const { return new QgsPolygon3DSymbol( *this ); diff --git a/src/3d/symbols/qgspolygon3dsymbol.h b/src/3d/symbols/qgspolygon3dsymbol.h index 554ca9f39cc4..4f1512d93bbf 100644 --- a/src/3d/symbols/qgspolygon3dsymbol.h +++ b/src/3d/symbols/qgspolygon3dsymbol.h @@ -31,7 +31,8 @@ class _3D_EXPORT QgsPolygon3DSymbol : public QgsAbstract3DSymbol { public: - QgsPolygon3DSymbol(); + //! Constructor for QgsPolygon3DSymbol + QgsPolygon3DSymbol() = default; QString type() const override { return "polygon"; } QgsAbstract3DSymbol *clone() const override SIP_FACTORY; @@ -65,11 +66,13 @@ class _3D_EXPORT QgsPolygon3DSymbol : public QgsAbstract3DSymbol void setMaterial( const QgsPhongMaterialSettings &material ) { mMaterial = material; } private: - AltitudeClamping mAltClamping; //! how to handle altitude of vector features - AltitudeBinding mAltBinding; //! how to handle clamping of vertices of individual features + //! how to handle altitude of vector features + AltitudeClamping mAltClamping = AltClampRelative; + //! how to handle clamping of vertices of individual features + AltitudeBinding mAltBinding = AltBindCentroid; - float mHeight; //!< Base height of polygons - float mExtrusionHeight; //!< How much to extrude (0 means no walls) + float mHeight = 0.0f; //!< Base height of polygons + float mExtrusionHeight = 0.0f; //!< How much to extrude (0 means no walls) QgsPhongMaterialSettings mMaterial; //!< Defines appearance of objects }; diff --git a/src/3d/terrain/qgsdemterraingenerator.cpp b/src/3d/terrain/qgsdemterraingenerator.cpp index c6f46bff893c..0f053780dcc7 100644 --- a/src/3d/terrain/qgsdemterraingenerator.cpp +++ b/src/3d/terrain/qgsdemterraingenerator.cpp @@ -19,14 +19,6 @@ #include "qgsrasterlayer.h" - - -QgsDemTerrainGenerator::QgsDemTerrainGenerator() - : mResolution( 16 ) - , mSkirtHeight( 10.f ) -{ -} - QgsDemTerrainGenerator::~QgsDemTerrainGenerator() { delete mHeightMapGenerator; diff --git a/src/3d/terrain/qgsdemterraingenerator.h b/src/3d/terrain/qgsdemterraingenerator.h index 3e566797ce03..142b958a4087 100644 --- a/src/3d/terrain/qgsdemterraingenerator.h +++ b/src/3d/terrain/qgsdemterraingenerator.h @@ -36,7 +36,8 @@ class QgsDemHeightMapGenerator; class _3D_EXPORT QgsDemTerrainGenerator : public QgsTerrainGenerator { public: - QgsDemTerrainGenerator(); + //! Constructor for QgsDemTerrainGenerator + QgsDemTerrainGenerator() = default; ~QgsDemTerrainGenerator(); //! Sets raster layer with elevation model to be used for terrain generation @@ -75,9 +76,9 @@ class _3D_EXPORT QgsDemTerrainGenerator : public QgsTerrainGenerator //! source layer for heights QgsMapLayerRef mLayer; //! how many vertices to place on one side of the tile - int mResolution; + int mResolution = 16; //! height of the "skirts" at the edges of tiles to hide cracks between adjacent cracks - float mSkirtHeight; + float mSkirtHeight = 10.f; }; diff --git a/src/3d/terrain/qgsterrainentity_p.cpp b/src/3d/terrain/qgsterrainentity_p.cpp index ed03be5eb5c3..94c4e72998e0 100644 --- a/src/3d/terrain/qgsterrainentity_p.cpp +++ b/src/3d/terrain/qgsterrainentity_p.cpp @@ -57,7 +57,6 @@ QgsTerrainEntity::QgsTerrainEntity( int maxLevel, const Qgs3DMapSettings &map, Q map.terrainGenerator()->rootChunkError( map ), map.maxTerrainScreenError(), maxLevel, map.terrainGenerator(), parent ) , mMap( map ) - , mTerrainPicker( nullptr ) { map.terrainGenerator()->setTerrain( this ); diff --git a/src/app/3d/qgs3dmapcanvas.cpp b/src/app/3d/qgs3dmapcanvas.cpp index afa8e66f6fd5..9958f1c79dc3 100644 --- a/src/app/3d/qgs3dmapcanvas.cpp +++ b/src/app/3d/qgs3dmapcanvas.cpp @@ -25,10 +25,6 @@ Qgs3DMapCanvas::Qgs3DMapCanvas( QWidget *parent ) : QWidget( parent ) - , mWindow3D( nullptr ) - , mContainer( nullptr ) - , mMap( nullptr ) - , mScene( nullptr ) { mWindow3D = new Qt3DExtras::Qt3DWindow; mContainer = QWidget::createWindowContainer( mWindow3D ); diff --git a/src/app/3d/qgs3dmapcanvasdockwidget.cpp b/src/app/3d/qgs3dmapcanvasdockwidget.cpp index bd4d769adad2..946b76f1d49a 100644 --- a/src/app/3d/qgs3dmapcanvasdockwidget.cpp +++ b/src/app/3d/qgs3dmapcanvasdockwidget.cpp @@ -29,7 +29,6 @@ Qgs3DMapCanvasDockWidget::Qgs3DMapCanvasDockWidget( QWidget *parent ) : QgsDockWidget( parent ) - , mMainCanvas( nullptr ) { setAttribute( Qt::WA_DeleteOnClose ); // removes the dock widget from main window when diff --git a/src/app/qgsattributesformproperties.cpp b/src/app/qgsattributesformproperties.cpp index 27c0b99237c3..631d41d0f713 100644 --- a/src/app/qgsattributesformproperties.cpp +++ b/src/app/qgsattributesformproperties.cpp @@ -731,18 +731,7 @@ void QgsAttributesFormProperties::apply() * FieldConfig implementation */ -QgsAttributesFormProperties::FieldConfig::FieldConfig() - : mEditable( true ) - , mEditableEnabled( true ) - , mLabelOnTop( false ) - , mConstraints( 0 ) - , mConstraintDescription( QString() ) - , mButton( nullptr ) -{ -} - QgsAttributesFormProperties::FieldConfig::FieldConfig( QgsVectorLayer *layer, int idx ) - : mButton( nullptr ) { mAlias = layer->fields().at( idx ).alias(); mComment = layer->fields().at( idx ).comment(); diff --git a/src/app/qgsattributesformproperties.h b/src/app/qgsattributesformproperties.h index ee5378880d66..686e1527e428 100644 --- a/src/app/qgsattributesformproperties.h +++ b/src/app/qgsattributesformproperties.h @@ -66,12 +66,8 @@ class APP_EXPORT QgsAttributesFormProperties : public QWidget, private Ui_QgsAtt struct RelationEditorConfiguration { - RelationEditorConfiguration() - : showLinkButton( true ) - , showUnlinkButton( true ) - {} - bool showLinkButton; - bool showUnlinkButton; + bool showLinkButton = true; + bool showUnlinkButton = true; }; class DnDTreeItemData : public QTreeWidgetItem @@ -85,12 +81,7 @@ class APP_EXPORT QgsAttributesFormProperties : public QWidget, private Ui_QgsAtt }; //do we need that - DnDTreeItemData() - : mType( Field ) - , mColumnCount( 1 ) - , mShowAsGroupBox( false ) - , mShowLabel( true ) - {} + DnDTreeItemData() = default; DnDTreeItemData( Type type, const QString &name ) : mType( type ) @@ -124,11 +115,11 @@ class APP_EXPORT QgsAttributesFormProperties : public QWidget, private Ui_QgsAtt void setRelationEditorConfiguration( RelationEditorConfiguration relationEditorConfiguration ); private: - Type mType; + Type mType = Field; QString mName; - int mColumnCount; - bool mShowAsGroupBox; - bool mShowLabel; + int mColumnCount = 1; + bool mShowAsGroupBox = false; + bool mShowLabel = true; QgsOptionalExpression mVisibilityExpression; RelationEditorConfiguration mRelationEditorConfiguration; }; @@ -139,14 +130,14 @@ class APP_EXPORT QgsAttributesFormProperties : public QWidget, private Ui_QgsAtt */ struct FieldConfig { - FieldConfig(); + FieldConfig() = default; FieldConfig( QgsVectorLayer *layer, int idx ); - bool mEditable; - bool mEditableEnabled; - bool mLabelOnTop; + bool mEditable = true ; + bool mEditableEnabled = true ; + bool mLabelOnTop = false ; QgsFieldConstraints mFieldConstraints; - QgsFieldConstraints::Constraints mConstraints; + QgsFieldConstraints::Constraints mConstraints = 0; QHash< QgsFieldConstraints::Constraint, QgsFieldConstraints::ConstraintStrength > mConstraintStrength; QString mConstraint; QString mConstraintDescription; diff --git a/src/core/geometry/qgsabstractgeometry.h b/src/core/geometry/qgsabstractgeometry.h index da060e7ddf53..60879ff70c5e 100644 --- a/src/core/geometry/qgsabstractgeometry.h +++ b/src/core/geometry/qgsabstractgeometry.h @@ -521,18 +521,18 @@ class CORE_EXPORT QgsAbstractGeometry */ struct Level { - const QgsAbstractGeometry *g; //!< Current geometry - int index; //!< Ptr in the current geometry + const QgsAbstractGeometry *g = nullptr; //!< Current geometry + int index = 0; //!< Ptr in the current geometry }; Level levels[3]; //!< Stack of levels - three levels should be sufficient (e.g. part index, ring index, vertex index) - int depth; //!< At what depth level are we right now + int depth = -1; //!< At what depth level are we right now void digDown(); //!< Prepare the stack of levels so that it points to a leaf child geometry public: //! Create invalid iterator - vertex_iterator() : depth( -1 ) {} + vertex_iterator() = default; //! Create vertex iterator for a geometry vertex_iterator( const QgsAbstractGeometry *g, int index ); @@ -720,7 +720,8 @@ inline T qgsgeometry_cast( const QgsAbstractGeometry *geom ) class CORE_EXPORT QgsVertexIterator { public: - QgsVertexIterator(): g( nullptr ) {} + //! Constructor for QgsVertexIterator + QgsVertexIterator() = default; //! Constructs iterator for the given geometry QgsVertexIterator( const QgsAbstractGeometry *geometry ) @@ -755,7 +756,7 @@ class CORE_EXPORT QgsVertexIterator #endif private: - const QgsAbstractGeometry *g; + const QgsAbstractGeometry *g = nullptr; QgsAbstractGeometry::vertex_iterator i, n; }; diff --git a/src/core/layout/qgslayoutitemgroupundocommand.cpp b/src/core/layout/qgslayoutitemgroupundocommand.cpp index eab2e2c72356..ce36ccaef703 100644 --- a/src/core/layout/qgslayoutitemgroupundocommand.cpp +++ b/src/core/layout/qgslayoutitemgroupundocommand.cpp @@ -26,7 +26,6 @@ QgsLayoutItemGroupUndoCommand::QgsLayoutItemGroupUndoCommand( State s, QgsLayout , mGroupUuid( group->uuid() ) , mLayout( layout ) , mState( s ) - , mFirstRun( true ) { const QList< QgsLayoutItem * > items = group->items(); for ( QgsLayoutItem *i : items ) diff --git a/src/core/layout/qgslayoutitemgroupundocommand.h b/src/core/layout/qgslayoutitemgroupundocommand.h index 5bed88ce479d..5b15ae7a6c03 100644 --- a/src/core/layout/qgslayoutitemgroupundocommand.h +++ b/src/core/layout/qgslayoutitemgroupundocommand.h @@ -64,7 +64,8 @@ class CORE_EXPORT QgsLayoutItemGroupUndoCommand: public QObject, public QUndoCom QSet mItemUuids; QgsLayout *mLayout = nullptr; State mState; - bool mFirstRun = true; //flag to prevent execution when the command is pushed to the QUndoStack + //! Flag to prevent execution when the command is pushed to the QUndoStack + bool mFirstRun = true; //changes between added / removed state void switchState(); diff --git a/src/gui/layout/qgslayoutitemwidget.cpp b/src/gui/layout/qgslayoutitemwidget.cpp index 2555cb5f63a5..379af5939109 100644 --- a/src/gui/layout/qgslayoutitemwidget.cpp +++ b/src/gui/layout/qgslayoutitemwidget.cpp @@ -195,11 +195,6 @@ void QgsLayoutItemPropertiesWidget::updateVariables() QgsLayoutItemPropertiesWidget::QgsLayoutItemPropertiesWidget( QWidget *parent, QgsLayoutItem *item ) : QWidget( parent ) , mConfigObject( new QgsLayoutConfigObject( this, item ) ) - , mFreezeXPosSpin( false ) - , mFreezeYPosSpin( false ) - , mFreezeWidthSpin( false ) - , mFreezeHeightSpin( false ) - , mFreezePageSpin( false ) { setupUi( this );