Skip to content

Commit

Permalink
Merge pull request #5602 from nyalldawson/modernize2
Browse files Browse the repository at this point in the history
Apply some more clang-tidy modernizations
  • Loading branch information
nyalldawson committed Nov 11, 2017
2 parents 8c6e029 + 5a6c222 commit bcb815b
Show file tree
Hide file tree
Showing 189 changed files with 356 additions and 588 deletions.
1 change: 0 additions & 1 deletion python/core/effects/qgsimageoperation.sip
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ class QgsImageOperation


struct DistanceTransformProperties struct DistanceTransformProperties
{ {
DistanceTransformProperties();


bool shadeExterior; bool shadeExterior;
%Docstring %Docstring
Expand Down
3 changes: 3 additions & 0 deletions python/core/effects/qgspainteffect.sip
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -300,6 +300,9 @@ class QgsDrawSourceEffect : QgsPaintEffect
public: public:


QgsDrawSourceEffect(); QgsDrawSourceEffect();
%Docstring
Constructor for QgsDrawSourceEffect
%End


static QgsPaintEffect *create( const QgsStringMap &map ) /Factory/; static QgsPaintEffect *create( const QgsStringMap &map ) /Factory/;
%Docstring %Docstring
Expand Down
6 changes: 6 additions & 0 deletions python/core/fieldformatter/qgsvaluerelationfieldformatter.sip
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -25,8 +25,14 @@ class QgsValueRelationFieldFormatter : QgsFieldFormatter
struct ValueRelationItem struct ValueRelationItem
{ {
ValueRelationItem( const QVariant &key, const QString &value ); ValueRelationItem( const QVariant &key, const QString &value );
%Docstring
Constructor for ValueRelationItem
%End


ValueRelationItem(); ValueRelationItem();
%Docstring
Constructor for ValueRelationItem
%End


QVariant key; QVariant key;
QString value; QString value;
Expand Down
3 changes: 3 additions & 0 deletions python/core/geometry/qgsabstractgeometry.sip
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -646,6 +646,9 @@ class QgsVertexIterator
%End %End
public: public:
QgsVertexIterator(); QgsVertexIterator();
%Docstring
Constructor for QgsVertexIterator
%End


QgsVertexIterator( const QgsAbstractGeometry *geometry ); QgsVertexIterator( const QgsAbstractGeometry *geometry );
%Docstring %Docstring
Expand Down
3 changes: 3 additions & 0 deletions python/core/qgsdartmeasurement.sip
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ class QgsDartMeasurement
}; };


QgsDartMeasurement(); QgsDartMeasurement();
%Docstring
Constructor for QgsDartMeasurement
%End


QgsDartMeasurement( const QString &name, Type type, const QString &value ); QgsDartMeasurement( const QString &name, Type type, const QString &value );


Expand Down
7 changes: 7 additions & 0 deletions python/core/qgsdiagramrenderer.sip
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -319,6 +319,9 @@ class QgsDiagramSettings
}; };


QgsDiagramSettings(); QgsDiagramSettings();
%Docstring
Constructor for QgsDiagramSettings
%End


bool enabled; bool enabled;
QFont font; QFont font;
Expand Down Expand Up @@ -614,7 +617,11 @@ class QgsSingleCategoryDiagramRenderer : QgsDiagramRenderer
#include "qgsdiagramrenderer.h" #include "qgsdiagramrenderer.h"
%End %End
public: public:

QgsSingleCategoryDiagramRenderer(); QgsSingleCategoryDiagramRenderer();
%Docstring
Constructor for QgsSingleCategoryDiagramRenderer
%End


virtual QgsSingleCategoryDiagramRenderer *clone() const /Factory/; virtual QgsSingleCategoryDiagramRenderer *clone() const /Factory/;


Expand Down
6 changes: 6 additions & 0 deletions python/core/qgseditformconfig.sip
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ class QgsEditFormConfig
struct GroupData struct GroupData
{ {
GroupData(); GroupData();
%Docstring
Constructor for GroupData
%End
GroupData( const QString &name, const QList<QString> &fields ); GroupData( const QString &name, const QList<QString> &fields );
QString mName; QString mName;
QList<QString> mFields; QList<QString> mFields;
Expand All @@ -37,6 +40,9 @@ class QgsEditFormConfig
struct TabData struct TabData
{ {
TabData(); TabData();
%Docstring
Constructor for TabData
%End
TabData( const QString &name, const QList<QString> &fields, const QList<QgsEditFormConfig::GroupData> &groups ); TabData( const QString &name, const QList<QString> &fields, const QList<QgsEditFormConfig::GroupData> &groups );
QString mName; QString mName;
QList<QString> mFields; QList<QString> mFields;
Expand Down
3 changes: 3 additions & 0 deletions python/core/qgseditorwidgetsetup.sip
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ class QgsEditorWidgetSetup
%End %End


QgsEditorWidgetSetup(); QgsEditorWidgetSetup();
%Docstring
Constructor for QgsEditorWidgetSetup
%End


QString type() const; QString type() const;
%Docstring %Docstring
Expand Down
6 changes: 6 additions & 0 deletions python/core/qgserror.sip
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ class QgsErrorMessage
}; };


QgsErrorMessage(); QgsErrorMessage();
%Docstring
Constructor for QgsErrorMessage
%End


QgsErrorMessage( const QString &message, const QString &tag = QString(), const QString &file = QString(), const QString &function = QString(), int line = 0 ); QgsErrorMessage( const QString &message, const QString &tag = QString(), const QString &file = QString(), const QString &function = QString(), int line = 0 );
%Docstring %Docstring
Expand Down Expand Up @@ -75,6 +78,9 @@ class QgsError
public: public:


QgsError(); QgsError();
%Docstring
Constructor for QgsError
%End


QgsError( const QString &message, const QString &tag ); QgsError( const QString &message, const QString &tag );
%Docstring %Docstring
Expand Down
3 changes: 3 additions & 0 deletions python/core/qgsexpressioncontext.sip
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -345,6 +345,9 @@ class QgsExpressionContext
public: public:


QgsExpressionContext(); QgsExpressionContext();
%Docstring
Constructor for QgsExpressionContext
%End


explicit QgsExpressionContext( const QList<QgsExpressionContextScope *> &scopes /Transfer/ ); explicit QgsExpressionContext( const QList<QgsExpressionContextScope *> &scopes /Transfer/ );
%Docstring %Docstring
Expand Down
4 changes: 4 additions & 0 deletions python/core/qgspallabeling.sip
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ class QgsLabelPosition
%End %End
public: public:
QgsLabelPosition( int id, double r, const QVector< QgsPointXY > &corners, const QgsRectangle &rect, double w, double h, const QString &layer, const QString &labeltext, const QFont &labelfont, bool upside_down, bool diagram = false, bool pinned = false, const QString &providerId = QString() ); QgsLabelPosition( int id, double r, const QVector< QgsPointXY > &corners, const QgsRectangle &rect, double w, double h, const QString &layer, const QString &labeltext, const QFont &labelfont, bool upside_down, bool diagram = false, bool pinned = false, const QString &providerId = QString() );

QgsLabelPosition(); QgsLabelPosition();
%Docstring
Constructor for QgsLabelPosition
%End


int featureId; int featureId;
double rotation; double rotation;
Expand Down
3 changes: 3 additions & 0 deletions python/core/qgsvectorfilewriter.sip
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ There are two possibilities how to use this class:
struct MetaData struct MetaData
{ {
MetaData(); MetaData();
%Docstring
Constructor for MetaData
%End


MetaData( const QString &longName, const QString &trLongName, const QString &glob, const QString &ext, const QMap<QString, QgsVectorFileWriter::Option *> &driverOptions, const QMap<QString, QgsVectorFileWriter::Option *> &layerOptions, const QString &compulsoryEncoding = QString() ); MetaData( const QString &longName, const QString &trLongName, const QString &glob, const QString &ext, const QMap<QString, QgsVectorFileWriter::Option *> &driverOptions, const QMap<QString, QgsVectorFileWriter::Option *> &layerOptions, const QString &compulsoryEncoding = QString() );


Expand Down
3 changes: 3 additions & 0 deletions python/core/qgsvectorlayereditbuffer.sip
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -249,6 +249,9 @@ Signals emitted after committing changes
protected: protected:


QgsVectorLayerEditBuffer(); QgsVectorLayerEditBuffer();
%Docstring
Constructor for QgsVectorLayerEditBuffer
%End


void updateFields( QgsFields &fields ); void updateFields( QgsFields &fields );


Expand Down
3 changes: 3 additions & 0 deletions python/core/qgsvectorlayerutils.sip
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ class QgsVectorLayerUtils
public: public:


QgsDuplicateFeatureContext(); QgsDuplicateFeatureContext();
%Docstring
Constructor for QgsDuplicateFeatureContext
%End


QList<QgsVectorLayer *> layers() const; QList<QgsVectorLayer *> layers() const;
%Docstring %Docstring
Expand Down
1 change: 1 addition & 0 deletions python/core/symbology/qgssymbol.sip
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ class QgsSymbolRenderContext
\param mapUnitScale \param mapUnitScale
%End %End



QgsRenderContext &renderContext(); QgsRenderContext &renderContext();
%Docstring %Docstring
:rtype: QgsRenderContext :rtype: QgsRenderContext
Expand Down
3 changes: 3 additions & 0 deletions python/gui/qgsattributeeditorcontext.sip
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ class QgsAttributeEditorContext
}; };


QgsAttributeEditorContext(); QgsAttributeEditorContext();
%Docstring
Constructor for QgsAttributeEditorContext
%End


QgsAttributeEditorContext( const QgsAttributeEditorContext &parentContext, FormMode formMode ); QgsAttributeEditorContext( const QgsAttributeEditorContext &parentContext, FormMode formMode );


Expand Down
3 changes: 3 additions & 0 deletions python/gui/qgsidentifymenu.sip
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ class QgsIdentifyMenu : QMenu
struct ActionData struct ActionData
{ {
ActionData(); ActionData();
%Docstring
Constructor for ActionData
%End


ActionData( QgsMapLayer *layer, QgsMapLayerAction *mapLayerAction = 0 ); ActionData( QgsMapLayer *layer, QgsMapLayerAction *mapLayerAction = 0 );


Expand Down
2 changes: 0 additions & 2 deletions python/gui/qgslonglongvalidator.sip
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ class QgsLongLongValidator : QValidator


QgsLongLongValidator( qint64 bottom, qint64 top, QObject *parent ); QgsLongLongValidator( qint64 bottom, qint64 top, QObject *parent );


~QgsLongLongValidator();

virtual QValidator::State validate( QString &input, int & ) const; virtual QValidator::State validate( QString &input, int & ) const;


void setBottom( qint64 bottom ); void setBottom( qint64 bottom );
Expand Down
3 changes: 3 additions & 0 deletions python/gui/qgsmaptoolidentify.sip
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ after selecting a point, performs the identification:
struct IdentifyResult struct IdentifyResult
{ {
IdentifyResult(); IdentifyResult();
%Docstring
Constructor for IdentifyResult
%End


IdentifyResult( QgsMapLayer *layer, const QgsFeature &feature, const QMap< QString, QString > &derivedAttributes ); IdentifyResult( QgsMapLayer *layer, const QgsFeature &feature, const QMap< QString, QString > &derivedAttributes );
IdentifyResult( QgsMapLayer *layer, const QString &label, const QMap< QString, QString > &attributes, const QMap< QString, QString > &derivedAttributes ); IdentifyResult( QgsMapLayer *layer, const QString &label, const QMap< QString, QString > &attributes, const QMap< QString, QString > &derivedAttributes );
Expand Down
2 changes: 0 additions & 2 deletions python/gui/qgssublayersdialog.sip
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ class QgsSublayersDialog : QDialog


struct LayerDefinition struct LayerDefinition
{ {
LayerDefinition();

int layerId; int layerId;
QString layerName; //!< Name of the layer (not necessarily unique) QString layerName; //!< Name of the layer (not necessarily unique)
int count; int count;
Expand Down
1 change: 1 addition & 0 deletions python/server/qgsbufferserverresponse.sip
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class QgsBufferServerResponse: QgsServerResponse


QgsBufferServerResponse(); QgsBufferServerResponse();



virtual void setHeader( const QString &key, const QString &value ); virtual void setHeader( const QString &key, const QString &value );


%Docstring %Docstring
Expand Down
6 changes: 3 additions & 3 deletions src/3d/chunks/qgschunkedentity_p.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class QgsChunkedEntity : public Qt3DCore::QEntity
//! root node of the quadtree hierarchy //! root node of the quadtree hierarchy
QgsChunkNode *mRootNode = nullptr; QgsChunkNode *mRootNode = nullptr;
//! A chunk has been loaded recently? let's display it! //! A chunk has been loaded recently? let's display it!
bool mNeedsUpdate; bool mNeedsUpdate = false;
//! max. allowed screen space error //! max. allowed screen space error
float mTau; float mTau;
//! maximum allowed depth of quad tree //! maximum allowed depth of quad tree
Expand All @@ -117,14 +117,14 @@ class QgsChunkedEntity : public Qt3DCore::QEntity
//! list of nodes that are being currently used for rendering //! list of nodes that are being currently used for rendering
QList<QgsChunkNode *> mActiveNodes; QList<QgsChunkNode *> mActiveNodes;
//! number of nodes omitted during frustum culling - for the curious ones //! number of nodes omitted during frustum culling - for the curious ones
int mFrustumCulled; int mFrustumCulled = 0;


// TODO: max. length for loading queue // TODO: max. length for loading queue


QTime mCurrentTime; QTime mCurrentTime;


//! max. length for replacement queue //! max. length for replacement queue
int mMaxLoadedChunks; int mMaxLoadedChunks = 512;


//! Entity that shows bounding boxes of active chunks (null if not enabled) //! Entity that shows bounding boxes of active chunks (null if not enabled)
QgsChunkBoundsEntity *mBboxesEntity = nullptr; QgsChunkBoundsEntity *mBboxesEntity = nullptr;
Expand Down
7 changes: 0 additions & 7 deletions src/3d/chunks/qgschunklist_p.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@


///@cond PRIVATE ///@cond PRIVATE


QgsChunkList::QgsChunkList()
: mHead( nullptr )
, mTail( nullptr )
, mCount( 0 )
{
}

int QgsChunkList::trueCount() const int QgsChunkList::trueCount() const
{ {
int len = 0; int len = 0;
Expand Down
5 changes: 3 additions & 2 deletions src/3d/chunks/qgschunklist_p.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ struct QgsChunkListEntry
class QgsChunkList class QgsChunkList
{ {
public: public:
QgsChunkList(); //! Constructor for QgsChunkList
QgsChunkList() = default;


//! Counts the real number of entries by walking the list (for debugging purposes only) //! Counts the real number of entries by walking the list (for debugging purposes only)
int trueCount() const; int trueCount() const;
Expand Down Expand Up @@ -99,7 +100,7 @@ class QgsChunkList
private: private:
QgsChunkListEntry *mHead = nullptr; QgsChunkListEntry *mHead = nullptr;
QgsChunkListEntry *mTail = nullptr; QgsChunkListEntry *mTail = nullptr;
int mCount; int mCount = 0;
}; };


/// @endcond /// @endcond
Expand Down
1 change: 0 additions & 1 deletion src/3d/qgs3dmapscene.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
Qgs3DMapScene::Qgs3DMapScene( const Qgs3DMapSettings &map, Qt3DExtras::QForwardRenderer *defaultFrameGraph, Qt3DRender::QRenderSettings *renderSettings, Qt3DRender::QCamera *camera, const QRect &viewportRect, Qt3DCore::QNode *parent ) Qgs3DMapScene::Qgs3DMapScene( const Qgs3DMapSettings &map, Qt3DExtras::QForwardRenderer *defaultFrameGraph, Qt3DRender::QRenderSettings *renderSettings, Qt3DRender::QCamera *camera, const QRect &viewportRect, Qt3DCore::QNode *parent )
: Qt3DCore::QEntity( parent ) : Qt3DCore::QEntity( parent )
, mMap( map ) , mMap( map )
, mTerrain( nullptr )
, mForwardRenderer( defaultFrameGraph ) , mForwardRenderer( defaultFrameGraph )
{ {


Expand Down
17 changes: 0 additions & 17 deletions src/3d/qgs3dmapsettings.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -26,23 +26,6 @@
#include "qgssymbollayerutils.h" #include "qgssymbollayerutils.h"
#include "qgsrasterlayer.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 ) Qgs3DMapSettings::Qgs3DMapSettings( const Qgs3DMapSettings &other )
: QObject() : QObject()
, mOriginX( other.mOriginX ) , mOriginX( other.mOriginX )
Expand Down
35 changes: 21 additions & 14 deletions src/3d/qgs3dmapsettings.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
Qgs3DMapSettings();
//! Constructor for Qgs3DMapSettings
Qgs3DMapSettings() = default;
//! Copy constructor //! Copy constructor
Qgs3DMapSettings( const Qgs3DMapSettings &other ); Qgs3DMapSettings( const Qgs3DMapSettings &other );
~Qgs3DMapSettings(); ~Qgs3DMapSettings();
Expand Down Expand Up @@ -206,23 +208,28 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject
void showLabelsChanged(); void showLabelsChanged();


private: 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 QgsCoordinateReferenceSystem mCrs; //!< Destination coordinate system of the world
QColor mBackgroundColor; //!< Background color of the scene QColor mBackgroundColor = Qt::black; //!< Background color of the scene
QColor mSelectionColor; //!< Color to be used for selected map features QColor mSelectionColor; //!< Color to be used for selected map features
double mTerrainVerticalScale; //!< Multiplier of terrain heights to make the terrain shape more pronounced double mTerrainVerticalScale = 1; //!< Multiplier of terrain heights to make the terrain shape more pronounced
std::unique_ptr<QgsTerrainGenerator> mTerrainGenerator; //!< Implementation of the terrain generation std::unique_ptr<QgsTerrainGenerator> mTerrainGenerator; //!< Implementation of the terrain generation
int mMapTileResolution; //!< Size of map textures of tiles in pixels (width/height) int mMapTileResolution = 512; //!< 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 mMaxTerrainScreenError = 3.f; //!< 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) float mMaxTerrainGroundError = 1.f; //!< 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 mShowTerrainBoundingBoxes = false; //!< 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 mShowTerrainTileInfo = false; //!< Whether to draw extra information about terrain tiles to the textures - useful for debugging
bool mShowLabels; //!< Whether to display labels on terrain tiles bool mShowLabels = false; //!< Whether to display labels on terrain tiles
QList<QgsMapLayerRef> mLayers; //!< Layers to be rendered QList<QgsMapLayerRef> mLayers; //!< Layers to be rendered
QList<QgsAbstract3DRenderer *> mRenderers; //!< Extra stuff to render as 3D object QList<QgsAbstract3DRenderer *> mRenderers; //!< Extra stuff to render as 3D object
bool mSkyboxEnabled; //!< Whether to render skybox bool mSkyboxEnabled = false; //!< Whether to render skybox
QString mSkyboxFileBase; //!< Base part of the files with skybox textures QString mSkyboxFileBase; //!< Base part of the files with skybox textures
QString mSkyboxFileExtension; //!< Extension part of the files with skybox textures QString mSkyboxFileExtension; //!< Extension part of the files with skybox textures
}; };




Expand Down
5 changes: 0 additions & 5 deletions src/3d/qgsaabb.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@


#include "qgsaabb.h" #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 ) 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 ) : xMin( xMin ), yMin( yMin ), zMin( zMin ), xMax( xMax ), yMax( yMax ), zMax( zMax )
{ {
Expand Down
Loading

0 comments on commit bcb815b

Please sign in to comment.