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
Expand Up @@ -93,7 +93,6 @@ class QgsImageOperation

struct DistanceTransformProperties
{
DistanceTransformProperties();

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

QgsDrawSourceEffect();
%Docstring
Constructor for QgsDrawSourceEffect
%End

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

ValueRelationItem();
%Docstring
Constructor for ValueRelationItem
%End

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

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

QgsDartMeasurement();
%Docstring
Constructor for QgsDartMeasurement
%End

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

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

QgsDiagramSettings();
%Docstring
Constructor for QgsDiagramSettings
%End

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

QgsSingleCategoryDiagramRenderer();
%Docstring
Constructor for QgsSingleCategoryDiagramRenderer
%End

virtual QgsSingleCategoryDiagramRenderer *clone() const /Factory/;

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

QgsEditorWidgetSetup();
%Docstring
Constructor for QgsEditorWidgetSetup
%End

QString type() const;
%Docstring
Expand Down
6 changes: 6 additions & 0 deletions python/core/qgserror.sip
Expand Up @@ -27,6 +27,9 @@ class 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 );
%Docstring
Expand Down Expand Up @@ -75,6 +78,9 @@ class QgsError
public:

QgsError();
%Docstring
Constructor for QgsError
%End

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

QgsExpressionContext();
%Docstring
Constructor for QgsExpressionContext
%End

explicit QgsExpressionContext( const QList<QgsExpressionContextScope *> &scopes /Transfer/ );
%Docstring
Expand Down
4 changes: 4 additions & 0 deletions python/core/qgspallabeling.sip
Expand Up @@ -20,7 +20,11 @@ class QgsLabelPosition
%End
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();
%Docstring
Constructor for QgsLabelPosition
%End

int featureId;
double rotation;
Expand Down
3 changes: 3 additions & 0 deletions python/core/qgsvectorfilewriter.sip
Expand Up @@ -107,6 +107,9 @@ There are two possibilities how to use this class:
struct 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() );

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

QgsVectorLayerEditBuffer();
%Docstring
Constructor for QgsVectorLayerEditBuffer
%End

void updateFields( QgsFields &fields );

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

QgsDuplicateFeatureContext();
%Docstring
Constructor for QgsDuplicateFeatureContext
%End

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


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

QgsAttributeEditorContext();
%Docstring
Constructor for QgsAttributeEditorContext
%End

QgsAttributeEditorContext( const QgsAttributeEditorContext &parentContext, FormMode formMode );

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

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

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

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

~QgsLongLongValidator();

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

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

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 );
Expand Down
2 changes: 0 additions & 2 deletions python/gui/qgssublayersdialog.sip
Expand Up @@ -25,8 +25,6 @@ class QgsSublayersDialog : QDialog

struct LayerDefinition
{
LayerDefinition();

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

QgsBufferServerResponse();


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

%Docstring
Expand Down
6 changes: 3 additions & 3 deletions src/3d/chunks/qgschunkedentity_p.h
Expand Up @@ -103,7 +103,7 @@ class QgsChunkedEntity : public Qt3DCore::QEntity
//! root node of the quadtree hierarchy
QgsChunkNode *mRootNode = nullptr;
//! A chunk has been loaded recently? let's display it!
bool mNeedsUpdate;
bool mNeedsUpdate = false;
//! max. allowed screen space error
float mTau;
//! 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
QList<QgsChunkNode *> mActiveNodes;
//! number of nodes omitted during frustum culling - for the curious ones
int mFrustumCulled;
int mFrustumCulled = 0;

// TODO: max. length for loading queue

QTime mCurrentTime;

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

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

///@cond PRIVATE

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

int QgsChunkList::trueCount() const
{
int len = 0;
Expand Down
5 changes: 3 additions & 2 deletions src/3d/chunks/qgschunklist_p.h
Expand Up @@ -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;
Expand Down Expand Up @@ -99,7 +100,7 @@ class QgsChunkList
private:
QgsChunkListEntry *mHead = nullptr;
QgsChunkListEntry *mTail = nullptr;
int mCount;
int mCount = 0;
};

/// @endcond
Expand Down
1 change: 0 additions & 1 deletion src/3d/qgs3dmapscene.cpp
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 )
: Qt3DCore::QEntity( parent )
, mMap( map )
, mTerrain( nullptr )
, mForwardRenderer( defaultFrameGraph )
{

Expand Down
17 changes: 0 additions & 17 deletions src/3d/qgs3dmapsettings.cpp
Expand Up @@ -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 )
Expand Down
35 changes: 21 additions & 14 deletions src/3d/qgs3dmapsettings.h
Expand Up @@ -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();
Expand Down Expand Up @@ -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<QgsTerrainGenerator> 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<QgsMapLayerRef> mLayers; //!< Layers to be rendered
QList<QgsAbstract3DRenderer *> 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
};


Expand Down
5 changes: 0 additions & 5 deletions src/3d/qgsaabb.cpp
Expand Up @@ -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 )
{
Expand Down

0 comments on commit bcb815b

Please sign in to comment.