Skip to content
Permalink
Browse files

Initialize pointers to nullptr in headers

  • Loading branch information
nyalldawson committed Oct 5, 2017
1 parent dcc6725 commit d9952b63175cb63b56b4a695c1079206f69f0eb5
Showing with 108 additions and 108 deletions.
  1. +2 −2 src/3d/chunks/qgschunkboundsentity_p.cpp
  2. +1 −1 src/3d/chunks/qgschunkboundsentity_p.h
  3. +4 −4 src/3d/chunks/qgschunkedentity_p.h
  4. +2 −2 src/3d/chunks/qgschunklist_p.h
  5. +1 −1 src/3d/chunks/qgschunkqueuejob_p.h
  6. +4 −4 src/3d/qgs3dmapscene.h
  7. +21 −21 src/3d/qgscameracontroller.h
  8. +3 −3 src/3d/qgstessellatedpolygongeometry.h
  9. +1 −1 src/3d/symbols/qgsline3dsymbol_p.h
  10. +1 −1 src/3d/symbols/qgspolygon3dsymbol_p.h
  11. +1 −1 src/3d/terrain/qgsdemterraintileloader_p.cpp
  12. +2 −2 src/3d/terrain/qgsdemterraintileloader_p.h
  13. +1 −1 src/3d/terrain/qgsflatterraingenerator.cpp
  14. +1 −1 src/3d/terrain/qgsterrainentity_p.cpp
  15. +4 −4 src/3d/terrain/qgsterrainentity_p.h
  16. +1 −1 src/3d/terrain/qgsterraintexturegenerator_p.h
  17. +1 −1 src/3d/terrain/qgsterraintileloader_p.cpp
  18. +1 −1 src/3d/terrain/qgsterraintileloader_p.h
  19. +5 −5 src/3d/terrain/quantizedmeshgeometry.h
  20. +2 −2 src/3d/terrain/quantizedmeshterraingenerator.cpp
  21. +4 −4 src/app/3d/qgs3dmapcanvas.h
  22. +2 −2 src/app/3d/qgs3dmapcanvasdockwidget.h
  23. +2 −2 src/app/3d/qgs3dmapconfigwidget.h
  24. +1 −1 src/app/3d/qgsvectorlayer3drendererwidget.cpp
  25. +6 −6 src/app/3d/qgsvectorlayer3drendererwidget.h
  26. +1 −1 src/app/composer/qgscomposermanager.h
  27. +1 −1 src/app/layout/qgslayoutdesignerdialog.h
  28. +2 −2 src/app/nodetool/qgsnodetool.cpp
  29. +1 −1 src/app/nodetool/qgsnodetool.h
  30. +2 −2 src/app/qgsmapsavedialog.cpp
  31. +1 −1 src/app/qgsmapsavedialog.h
  32. +1 −1 src/core/expression/qgsexpressionfunction.cpp
  33. +1 −1 src/core/processing/qgsprocessingcontext.h
  34. +1 −1 src/core/processing/qgsprocessingparameters.h
  35. +1 −1 src/core/qgscadutils.h
  36. +1 −1 src/core/qgsfeaturesink.h
  37. +1 −1 src/gui/qgscurveeditorwidget.h
  38. +1 −1 src/gui/qgsdatasourcemanagerdialog.h
  39. +1 −1 src/gui/qgsmetadatawidget.cpp
  40. +5 −5 src/gui/symbology/qgsdatadefinedsizelegendwidget.h
  41. +1 −1 src/gui/symbology/qgssymbollevelsdialog.h
  42. +3 −3 src/providers/geonode/qgsgeonodesourceselect.cpp
  43. +2 −2 src/providers/ogr/qgsgeopackagedataitems.cpp
  44. +1 −1 src/providers/ogr/qgsogrdataitems.cpp
  45. +3 −3 src/providers/oracle/ocispatial/wkbptr.h
  46. +1 −1 src/providers/postgres/qgspostgreslistener.cpp
  47. +1 −1 src/server/qgsserver.h
  48. +1 −1 src/server/services/wms/qgswmsrenderer.cpp
@@ -39,8 +39,8 @@ class LineMeshGeometry : public Qt3DRender::QGeometry
void setVertices( QList<QVector3D> vertices );

private:
Qt3DRender::QAttribute *mPositionAttribute;
Qt3DRender::QBuffer *mVertexBuffer;
Qt3DRender::QAttribute *mPositionAttribute = nullptr;
Qt3DRender::QBuffer *mVertexBuffer = nullptr;
QList<QVector3D> mVertices;

};
@@ -47,7 +47,7 @@ class QgsChunkBoundsEntity : public Qt3DCore::QEntity
void setBoxes( const QList<QgsAABB> &bboxes );

private:
AABBMesh *mAabbMesh;
AABBMesh *mAabbMesh = nullptr;
};

/// @endcond
@@ -100,19 +100,19 @@ class QgsChunkedEntity : public Qt3DCore::QEntity

protected:
//! root node of the quadtree hierarchy
QgsChunkNode *mRootNode;
QgsChunkNode *mRootNode = nullptr;
//! A chunk has been loaded recently? let's display it!
bool mNeedsUpdate;
//! max. allowed screen space error
float mTau;
//! maximum allowed depth of quad tree
int mMaxLevel;
//! factory that creates loaders for individual chunk nodes
QgsChunkLoaderFactory *mChunkLoaderFactory;
QgsChunkLoaderFactory *mChunkLoaderFactory = nullptr;
//! queue of chunks to be loaded
QgsChunkList *mChunkLoaderQueue;
QgsChunkList *mChunkLoaderQueue = nullptr;
//! queue of chunk to be eventually replaced
QgsChunkList *mReplacementQueue;
QgsChunkList *mReplacementQueue = nullptr;
//! list of nodes that are being currently used for rendering
QList<QgsChunkNode *> mActiveNodes;
//! number of nodes omitted during frustum culling - for the curious ones
@@ -93,8 +93,8 @@ class QgsChunkList
void insertLast( QgsChunkListEntry *entry );

private:
QgsChunkListEntry *mHead;
QgsChunkListEntry *mTail;
QgsChunkListEntry *mHead = nullptr;
QgsChunkListEntry *mTail = nullptr;
int mCount;
};

@@ -71,7 +71,7 @@ class QgsChunkQueueJob : public QObject
void finished();

protected:
QgsChunkNode *mNode;
QgsChunkNode *mNode = nullptr;
};

/** \ingroup 3d
@@ -77,11 +77,11 @@ class _3D_EXPORT Qgs3DMapScene : public Qt3DCore::QEntity
private:
const Qgs3DMapSettings &mMap;
//! Provides a way to have a synchronous function executed each frame
Qt3DLogic::QFrameAction *mFrameAction;
QgsCameraController *mCameraController;
QgsTerrainEntity *mTerrain;
Qt3DLogic::QFrameAction *mFrameAction = nullptr;
QgsCameraController *mCameraController = nullptr;
QgsTerrainEntity *mTerrain = nullptr;
//! Forward renderer provided by 3D window
Qt3DExtras::QForwardRenderer *mForwardRenderer;
Qt3DExtras::QForwardRenderer *mForwardRenderer = nullptr;
QList<QgsChunkedEntity *> mChunkEntities;
//! Keeps track of entities that belong to a particular layer
QMap<QgsMapLayer *, Qt3DCore::QEntity *> mLayerEntities;
@@ -69,7 +69,7 @@ class _3D_EXPORT QgsCameraController : public Qt3DCore::QEntity

private:
//! Camera that is being controlled
Qt3DRender::QCamera *mCamera;
Qt3DRender::QCamera *mCamera = nullptr;
//! used for computation of translation when dragging mouse
QRect mViewport;
//! height of terrain when mouse button was last pressed - for camera control
@@ -114,37 +114,37 @@ class _3D_EXPORT QgsCameraController : public Qt3DCore::QEntity
QPoint mLastMousePos;

//! Delegates mouse events to the attached MouseHandler objects
Qt3DInput::QMouseDevice *mMouseDevice;
Qt3DInput::QMouseDevice *mMouseDevice = nullptr;

Qt3DInput::QKeyboardDevice *mKeyboardDevice;
Qt3DInput::QKeyboardDevice *mKeyboardDevice = nullptr;

Qt3DInput::QMouseHandler *mMouseHandler;
Qt3DInput::QMouseHandler *mMouseHandler = nullptr;

//! Allows us to define a set of actions that we wish to use
//! (it is a component that can be attached to 3D scene)
Qt3DInput::QLogicalDevice *mLogicalDevice;
Qt3DInput::QLogicalDevice *mLogicalDevice = nullptr;

Qt3DInput::QAction *mLeftMouseButtonAction;
Qt3DInput::QActionInput *mLeftMouseButtonInput;
Qt3DInput::QAction *mLeftMouseButtonAction = nullptr;
Qt3DInput::QActionInput *mLeftMouseButtonInput = nullptr;

Qt3DInput::QAction *mMiddleMouseButtonAction;
Qt3DInput::QActionInput *mMiddleMouseButtonInput;
Qt3DInput::QAction *mMiddleMouseButtonAction = nullptr;
Qt3DInput::QActionInput *mMiddleMouseButtonInput = nullptr;

Qt3DInput::QAction *mRightMouseButtonAction;
Qt3DInput::QActionInput *mRightMouseButtonInput;
Qt3DInput::QAction *mRightMouseButtonAction = nullptr;
Qt3DInput::QActionInput *mRightMouseButtonInput = nullptr;

Qt3DInput::QAction *mShiftAction;
Qt3DInput::QActionInput *mShiftInput;
Qt3DInput::QAction *mShiftAction = nullptr;
Qt3DInput::QActionInput *mShiftInput = nullptr;

Qt3DInput::QAxis *mWheelAxis;
Qt3DInput::QAnalogAxisInput *mMouseWheelInput;
Qt3DInput::QAxis *mWheelAxis = nullptr;
Qt3DInput::QAnalogAxisInput *mMouseWheelInput = nullptr;

Qt3DInput::QAxis *mTxAxis;
Qt3DInput::QAxis *mTyAxis;
Qt3DInput::QButtonAxisInput *mKeyboardTxPosInput;
Qt3DInput::QButtonAxisInput *mKeyboardTyPosInput;
Qt3DInput::QButtonAxisInput *mKeyboardTxNegInput;
Qt3DInput::QButtonAxisInput *mKeyboardTyNegInput;
Qt3DInput::QAxis *mTxAxis = nullptr;
Qt3DInput::QAxis *mTyAxis = nullptr;
Qt3DInput::QButtonAxisInput *mKeyboardTxPosInput = nullptr;
Qt3DInput::QButtonAxisInput *mKeyboardTyPosInput = nullptr;
Qt3DInput::QButtonAxisInput *mKeyboardTxNegInput = nullptr;
Qt3DInput::QButtonAxisInput *mKeyboardTyNegInput = nullptr;
};

#endif // QGSCAMERACONTROLLER_H
@@ -46,9 +46,9 @@ class QgsTessellatedPolygonGeometry : public Qt3DRender::QGeometry
private:
QList<QgsPolygonV2 *> mPolygons;

Qt3DRender::QAttribute *mPositionAttribute;
Qt3DRender::QAttribute *mNormalAttribute;
Qt3DRender::QBuffer *mVertexBuffer;
Qt3DRender::QAttribute *mPositionAttribute = nullptr;
Qt3DRender::QAttribute *mNormalAttribute = nullptr;
Qt3DRender::QBuffer *mVertexBuffer = nullptr;

bool mWithNormals;
};
@@ -60,7 +60,7 @@ class QgsLine3DSymbolEntityNode : public Qt3DCore::QEntity
private:
Qt3DRender::QGeometryRenderer *renderer( const Qgs3DMapSettings &map, const QgsLine3DSymbol &symbol, const QgsVectorLayer *layer, const QgsFeatureRequest &req );

QgsTessellatedPolygonGeometry *mGeometry;
QgsTessellatedPolygonGeometry *mGeometry = nullptr;
};

/// @endcond
@@ -61,7 +61,7 @@ class QgsPolygon3DSymbolEntityNode : public Qt3DCore::QEntity
private:
Qt3DRender::QGeometryRenderer *renderer( const Qgs3DMapSettings &map, const QgsPolygon3DSymbol &symbol, const QgsVectorLayer *layer, const QgsFeatureRequest &request );

QgsTessellatedPolygonGeometry *mGeometry;
QgsTessellatedPolygonGeometry *mGeometry = nullptr;
};

/// @endcond
@@ -76,7 +76,7 @@ Qt3DCore::QEntity *QgsDemTerrainTileLoader::createEntity( Qt3DCore::QEntity *par

// create transform

Qt3DCore::QTransform *transform;
Qt3DCore::QTransform *transform = nullptr;
transform = new Qt3DCore::QTransform();
entity->addComponent( transform );

@@ -98,10 +98,10 @@ class QgsDemHeightMapGenerator : public QObject

private:
//! raster used to build terrain
QgsRasterLayer *mDtm;
QgsRasterLayer *mDtm = nullptr;

//! cloned provider to be used in worker thread
QgsRasterDataProvider *mClonedProvider;
QgsRasterDataProvider *mClonedProvider = nullptr;

QgsTilingScheme mTilingScheme;

@@ -71,7 +71,7 @@ Qt3DCore::QEntity *FlatTerrainChunkLoader::createEntity( Qt3DCore::QEntity *pare

// create transform

Qt3DCore::QTransform *transform;
Qt3DCore::QTransform *transform = nullptr;
transform = new Qt3DCore::QTransform();
entity->addComponent( transform );

@@ -45,7 +45,7 @@ class TerrainMapUpdateJobFactory : public QgsChunkQueueJobFactory
}

private:
QgsTerrainTextureGenerator *mTextureGenerator;
QgsTerrainTextureGenerator *mTextureGenerator = nullptr;
};


@@ -79,9 +79,9 @@ class QgsTerrainEntity : public QgsChunkedEntity

const Qgs3DMapSettings &mMap;
//! picker of terrain to know height of terrain when dragging
Qt3DRender::QObjectPicker *mTerrainPicker;
QgsTerrainTextureGenerator *mTextureGenerator;
QgsCoordinateTransform *mTerrainToMapTransform;
Qt3DRender::QObjectPicker *mTerrainPicker = nullptr;
QgsTerrainTextureGenerator *mTextureGenerator = nullptr;
QgsCoordinateTransform *mTerrainToMapTransform = nullptr;

std::unique_ptr<TerrainMapUpdateJobFactory> mUpdateJobFactory;

@@ -104,7 +104,7 @@ class TerrainMapUpdateJob : public QgsChunkQueueJob
void onTileReady( int jobId, const QImage &image );

private:
QgsTerrainTextureGenerator *mTextureGenerator;
QgsTerrainTextureGenerator *mTextureGenerator = nullptr;
int mJobId;
};

@@ -80,7 +80,7 @@ class QgsTerrainTextureGenerator : public QObject
struct JobData
{
int jobId;
QgsMapRendererSequentialJob *job;
QgsMapRendererSequentialJob *job = nullptr;
QgsRectangle extent;
QString debugText;
};
@@ -74,7 +74,7 @@ void QgsTerrainTileLoader::createTextureComponent( QgsTerrainTileEntity *entity
texture->addTextureImage( textureImage );
texture->setMinificationFilter( Qt3DRender::QTexture2D::Linear );
texture->setMagnificationFilter( Qt3DRender::QTexture2D::Linear );
Qt3DExtras::QTextureMaterial *material;
Qt3DExtras::QTextureMaterial *material = nullptr;
#if QT_VERSION >= 0x050900
material = new Qt3DExtras::QTextureMaterial;
material->setTexture( texture );
@@ -59,7 +59,7 @@ class QgsTerrainTileLoader : public QgsChunkLoader
void onImageReady( int jobId, const QImage &image );

private:
QgsTerrainEntity *mTerrain;
QgsTerrainEntity *mTerrain = nullptr;
QgsRectangle mExtentMapCrs;
QString mTileDebugText;
int mTextureJobId;
@@ -70,11 +70,11 @@ class QuantizedMeshGeometry : public Qt3DRender::QGeometry
static void downloadTileIfMissing( int tx, int ty, int tz );

private:
Qt3DRender::QBuffer *mVertexBuffer;
Qt3DRender::QBuffer *mIndexBuffer;
Qt3DRender::QAttribute *mPositionAttribute;
Qt3DRender::QAttribute *mTexCoordAttribute;
Qt3DRender::QAttribute *mIndexAttribute;
Qt3DRender::QBuffer *mVertexBuffer = nullptr;
Qt3DRender::QBuffer *mIndexBuffer = nullptr;
Qt3DRender::QAttribute *mPositionAttribute = nullptr;
Qt3DRender::QAttribute *mTexCoordAttribute = nullptr;
Qt3DRender::QAttribute *mIndexAttribute = nullptr;
};

#endif // QUANTIZEDMESHGEOMETRY_H
@@ -59,7 +59,7 @@ class QuantizedMeshTerrainChunkLoader : public TerrainChunkLoader

// create transform

Qt3DCore::QTransform *transform;
Qt3DCore::QTransform *transform = nullptr;
transform = new Qt3DCore::QTransform();
entity->addComponent( transform );

@@ -83,7 +83,7 @@ class QuantizedMeshTerrainChunkLoader : public TerrainChunkLoader
}

protected:
QuantizedMeshTile *qmt;
QuantizedMeshTile *qmt = nullptr;
QgsMapSettings mapSettings;
int tx, ty, tz;
QgsRectangle tileRect;
@@ -47,13 +47,13 @@ class Qgs3DMapCanvas : public QWidget

private:
//! 3D window with all the 3D magic inside
Qt3DExtras::Qt3DWindow *mWindow3D;
Qt3DExtras::Qt3DWindow *mWindow3D = nullptr;
//! Container QWidget that encapsulates mWindow3D so we can use it embedded in ordinary widgets app
QWidget *mContainer;
QWidget *mContainer = nullptr;
//! Description of the 3D scene
Qgs3DMapSettings *mMap;
Qgs3DMapSettings *mMap = nullptr;
//! Root entity of the 3D scene
Qgs3DMapScene *mScene;
Qgs3DMapScene *mScene = nullptr;
};

#endif // QGS3DMAPCANVAS_H
@@ -43,8 +43,8 @@ class Qgs3DMapCanvasDockWidget : public QgsDockWidget
void onMainCanvasColorChanged();

private:
Qgs3DMapCanvas *mCanvas;
QgsMapCanvas *mMainCanvas;
Qgs3DMapCanvas *mCanvas = nullptr;
QgsMapCanvas *mMainCanvas = nullptr;
};

#endif // QGS3DMAPCANVASDOCKWIDGET_H
@@ -42,8 +42,8 @@ class Qgs3DMapConfigWidget : public QWidget, private Ui::Map3DConfigWidget
void updateMaxZoomLevel();

private:
Qgs3DMapSettings *mMap;
QgsMapCanvas *mMainCanvas;
Qgs3DMapSettings *mMap = nullptr;
QgsMapCanvas *mMainCanvas = nullptr;
};

#endif // QGS3DMAPCONFIGWIDGET_H
@@ -140,7 +140,7 @@ QgsVectorLayer3DRenderer *QgsVectorLayer3DRendererWidget::renderer()
int pageIndex = widgetStack->currentIndex();
if ( pageIndex == 1 || pageIndex == 2 || pageIndex == 3 )
{
QgsAbstract3DSymbol *sym;
QgsAbstract3DSymbol *sym = nullptr;
if ( pageIndex == 1 )
sym = new QgsLine3DSymbol( widgetLine->symbol() );
else if ( pageIndex == 2 )
@@ -54,12 +54,12 @@ class QgsVectorLayer3DRendererWidget : public QgsMapLayerConfigWidget
void onEnabledClicked();

private:
QCheckBox *chkEnabled;
QStackedWidget *widgetStack;
QgsLine3DSymbolWidget *widgetLine;
QgsPoint3DSymbolWidget *widgetPoint;
QgsPolygon3DSymbolWidget *widgetPolygon;
QLabel *widgetUnsupported;
QCheckBox *chkEnabled = nullptr;
QStackedWidget *widgetStack = nullptr;
QgsLine3DSymbolWidget *widgetLine = nullptr;
QgsPoint3DSymbolWidget *widgetPoint = nullptr;
QgsPolygon3DSymbolWidget *widgetPolygon = nullptr;
QLabel *widgetUnsupported = nullptr;

std::unique_ptr<QgsVectorLayer3DRenderer> mRenderer;
};
@@ -52,7 +52,7 @@ class QgsLayoutManagerModel : public QAbstractListModel
void compositionRemoved( const QString &name );
void compositionRenamed( QgsComposition *composition, const QString &newName );
private:
QgsLayoutManager *mLayoutManager;
QgsLayoutManager *mLayoutManager = nullptr;
};

/** A dialog that shows the existing composer instances. Lets the user add new
@@ -198,7 +198,7 @@ class QgsLayoutDesignerDialog: public QMainWindow, private Ui::QgsLayoutDesigner
QMap< QString, QToolButton * > mItemGroupToolButtons;
QMap< QString, QMenu * > mItemGroupSubmenus;

QgsLayoutAppMenuProvider *mMenuProvider;
QgsLayoutAppMenuProvider *mMenuProvider = nullptr;

QgsDockWidget *mItemDock = nullptr;
QgsPanelWidgetStack *mItemPropertiesStack = nullptr;

0 comments on commit d9952b6

Please sign in to comment.
You can’t perform that action at this time.