Skip to content
Permalink
Browse files

Drop redundant virtual keywords on overrides

Run clang-tidy modernize-use-override to remove all the redundant
virtual keywords from overridden methods, and add some missing
overrides.

Another benefit is that this has also added the overrides
on destructors, which will cause a build failure if a base
class is missing a virtual destructor.
  • Loading branch information
nyalldawson committed Dec 14, 2017
1 parent 39521c7 commit 4da1ce8404f59ded32eec6901c99888464988b95
Showing 906 changed files with 3,573 additions and 2,688 deletions.
@@ -32,7 +32,7 @@ using "builder" design patter.
%End
public:

virtual ~QgsGraphDirector();
~QgsGraphDirector();

virtual void makeGraph( QgsGraphBuilderInterface *builder,
const QVector< QgsPointXY > &additionalPoints,
@@ -22,6 +22,7 @@ used for finding shortest path between two points.
%End
public:
virtual QVariant cost( double distance, const QgsFeature & ) const;

};

/************************************************************************
@@ -48,7 +48,7 @@ Default constructor
attribute value is not set or does not equal to the given values
%End

virtual ~QgsVectorLayerDirector();
~QgsVectorLayerDirector();

virtual void makeGraph( QgsGraphBuilderInterface *builder,
const QVector< QgsPointXY > &additionalPoints,
@@ -20,10 +20,10 @@ Adds the ability to calculate derivatives in x- and y-directions. Needs to be su
%End
public:
QgsDerivativeFilter( const QString &inputFile, const QString &outputFile, const QString &outputFormat );
virtual ~QgsDerivativeFilter();
virtual float processNineCellWindow( float *x11, float *x21, float *x31,
float *x12, float *x22, float *x32,
float *x13, float *x23, float *x33 ) = 0;
~QgsDerivativeFilter();
virtual float processNineCellWindow( float *x11, float *x21, float *x31,
float *x12, float *x22, float *x32,
float *x13, float *x23, float *x33 ) = 0;

protected:
float calcFirstDerX( float *x11, float *x21, float *x31, float *x12, float *x22, float *x32, float *x13, float *x23, float *x33 );
@@ -55,8 +55,10 @@ Returns the file path for the source HTML file.
%End

virtual void writeXml( QDomElement &elem, QDomDocument &doc, const QgsReadWriteContext &context ) const;

virtual void readXml( const QDomElement &itemElem, const QgsReadWriteContext &context );


virtual void setAssociatedFeature( const QgsFeature &feature );


@@ -31,8 +31,10 @@ Constructor for QgsSvgAnnotation.


virtual void writeXml( QDomElement &elem, QDomDocument &doc, const QgsReadWriteContext &context ) const;

virtual void readXml( const QDomElement &itemElem, const QgsReadWriteContext &context );


void setFilePath( const QString &file );
%Docstring
Sets the file path for the source SVG file.
@@ -49,8 +49,10 @@ within the annotation. Ownership is not transferred.
%End

virtual void writeXml( QDomElement &elem, QDomDocument &doc, const QgsReadWriteContext &context ) const;

virtual void readXml( const QDomElement &itemElem, const QgsReadWriteContext &context );


static QgsTextAnnotation *create() /Factory/;
%Docstring
Returns a new QgsTextAnnotation object.
@@ -37,12 +37,15 @@ Constructor for QgsComposerAttributeTableColumnModel.
%End

virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const;

virtual int columnCount( const QModelIndex &parent = QModelIndex() ) const;

virtual QVariant data( const QModelIndex &index, int role ) const;

virtual QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;

virtual bool setData( const QModelIndex &index, const QVariant &value, int role = Qt::EditRole );

virtual Qt::ItemFlags flags( const QModelIndex &index ) const;

virtual bool removeRows( int row, int count, const QModelIndex &parent = QModelIndex() );
@@ -176,12 +179,14 @@ Constructor for QgsComposerTableSortColumnsProxyModel.
virtual int columnCount( const QModelIndex &parent = QModelIndex() ) const;

virtual QVariant data( const QModelIndex &index, int role ) const;

virtual QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;

virtual Qt::ItemFlags flags( const QModelIndex &index ) const;

virtual bool setData( const QModelIndex &index, const QVariant &value, int role = Qt::EditRole );


QgsComposerTableColumn *columnFromRow( int row );
%Docstring
Returns the QgsComposerTableColumn corresponding to a row in the proxy model.
@@ -68,7 +68,9 @@ A table that displays attributes from a vector layer

virtual QString displayName() const;


virtual bool writeXml( QDomElement &elem, QDomDocument &doc, bool ignoreFrames = false ) const;

%Docstring
Writes properties specific to attribute tables
:param elem: an existing QDomElement in which to store the attribute table's properties.
@@ -81,6 +83,7 @@ Writes properties specific to attribute tables
%End

virtual bool readXml( const QDomElement &itemElem, const QDomDocument &doc, bool ignoreFrames = false );

%Docstring
Reads the properties specific to an attribute table from xml.
:param itemElem: a QDomElement holding the attribute table's desired properties.
@@ -94,6 +97,7 @@ Reads the properties specific to an attribute table from xml.

virtual void addFrame( QgsComposerFrame *frame /Transfer/, bool recalcFrameSizes = true );


void setSource( const ContentSource source );
%Docstring
Sets the source for attributes to show in table body.
@@ -393,6 +397,7 @@ be replaced by a line break.

virtual QgsExpressionContext createExpressionContext() const;


};

/************************************************************************
@@ -27,6 +27,7 @@ Constructor for QgsComposerEffect.

protected:
virtual void draw( QPainter *painter );

%Docstring
Called whenever source needs to be drawn
%End
@@ -41,6 +41,7 @@ Returns the parent multiframe for the frame.

virtual QString displayName() const;


virtual void setSceneRect( const QRectF &rectangle );


@@ -131,6 +132,7 @@ Returns whether the frame is empty

virtual QgsExpressionContext createExpressionContext() const;


};

/************************************************************************
@@ -265,6 +265,7 @@ Returns whether user stylesheets are enabled for the HTML content.
%End

virtual QString displayName() const;

virtual QSizeF totalSize() const;

virtual void render( QPainter *p, const QRectF &renderExtent, const int frameIndex );
@@ -301,6 +302,7 @@ Recalculates the frame sizes for the current viewport dimensions

virtual void refreshDataDefinedProperty( const QgsComposerObject::DataDefinedProperty property = QgsComposerObject::AllProperties, const QgsExpressionContext *context = 0 );


};

/************************************************************************
@@ -96,7 +96,7 @@ Constructor with box position and composer object
:param composition: parent composition
:param manageZValue: true if the z-Value of this object should be managed by mComposition*
%End
virtual ~QgsComposerItem();
~QgsComposerItem();

virtual int type() const;
%Docstring
@@ -746,6 +746,7 @@ Sets the current layer to draw for exporting
%End

virtual QgsExpressionContext createExpressionContext() const;

%Docstring
Creates an expression context relating to the item's current state. The context includes
scopes for global, project, composition, atlas and item properties.
@@ -799,6 +800,7 @@ around item center. If false, rotation occurs around item origin


virtual void refreshDataDefinedProperty( const QgsComposerObject::DataDefinedProperty property = QgsComposerObject::AllProperties, const QgsExpressionContext *context = 0 );

%Docstring
Refreshes a data defined property for the item by reevaluating the property's value
and redrawing the item with this new value.
@@ -55,6 +55,7 @@ corresponds to 1 scene size unit*

virtual void setVisibility( const bool visible );


virtual bool writeXml( QDomElement &elem, QDomDocument &doc ) const;

%Docstring
@@ -198,6 +198,7 @@ Sets state from Dom document

virtual QString displayName() const;


virtual QRectF boundingRect() const;

%Docstring
@@ -208,11 +209,13 @@ label's frame
%End

virtual void setFrameEnabled( const bool drawFrame );

%Docstring
Reimplemented to call prepareGeometryChange after toggling frame
%End

virtual void setFrameStrokeWidth( const double strokeWidth );

%Docstring
Reimplemented to call prepareGeometryChange after changing stroke width
%End
@@ -110,6 +110,7 @@ Find out whether legend items are filtered to show just the ones visible in the
%End

virtual void updateItem();

%Docstring
Update() overloading. Use it rather than update()

@@ -418,6 +419,7 @@ Sets state from Dom document

virtual QString displayName() const;


const QgsLegendSettings &legendSettings() const;
%Docstring
Returns the legend's renderer settings object.
@@ -440,6 +442,7 @@ Sets mCompositionMap to 0 if the map is deleted
virtual void refreshDataDefinedProperty( const QgsComposerObject::DataDefinedProperty property = QgsComposerObject::AllProperties, const QgsExpressionContext *context = 0 );



};


@@ -28,7 +28,7 @@ Constructor.
%Docstring
Constructor. Settings are read from project.
%End
virtual ~QgsComposerMap();
~QgsComposerMap();

virtual int type() const;
%Docstring
@@ -96,6 +96,7 @@ Move content of map
%End

virtual void zoomContent( const double factor, const QPointF point, const ZoomMode mode = QgsComposerItem::Zoom );

%Docstring
Zoom content of item. Does nothing per default (but implemented in composer map)
:param factor: zoom factor, where > 1 results in a zoom in and < 1 results in a zoom out
@@ -444,6 +445,7 @@ In case of annotations, the bounding rectangle can be larger than the map item r
%End

virtual void setFrameStrokeWidth( const double strokeWidth );

%Docstring
reimplement setFrameStrokeWidth, so that updateBoundingRect() is called after setting the frame width */
%End
@@ -619,6 +621,7 @@ clockwise, starting at the top-left point

virtual QString displayName() const;


QPolygonF transformedMapPolygon() const;
%Docstring
Returns extent that considers rotation and shift with mOffsetX / mOffsetY
@@ -642,6 +645,7 @@ Calculates the extent to request and the yShift of the top-left point in case of

virtual QgsExpressionContext createExpressionContext() const;


signals:
void extentChanged();

@@ -679,6 +683,7 @@ Updates the bounding rect of this item. Call this function before doing any chan

virtual void refreshDataDefinedProperty( const QgsComposerObject::DataDefinedProperty property = QgsComposerObject::AllProperties, const QgsExpressionContext *context = 0 );


};


@@ -284,7 +284,7 @@ Constructor for QgsComposerMapGrid.
:param map: QgsComposerMap the grid is attached to
%End

virtual ~QgsComposerMapGrid();
~QgsComposerMapGrid();

virtual void draw( QPainter *painter );

@@ -1089,6 +1089,7 @@ Retrieves the second fill color for the grid frame.

virtual QgsExpressionContext createExpressionContext() const;


public:
};

@@ -34,6 +34,7 @@ Draws the item on to a painter
%End

virtual bool writeXml( QDomElement &elem, QDomDocument &doc ) const;

%Docstring
Stores map item state in DOM element
:param elem: is DOM element corresponding to a 'ComposerMap' tag
@@ -45,6 +46,7 @@ Stores map item state in DOM element
%End

virtual bool readXml( const QDomElement &itemElem, const QDomDocument &doc );

%Docstring
Sets map item state from a DOM document
:param itemElem: is DOM node corresponding to a 'ComposerMapGrid' tag
@@ -173,7 +173,7 @@ Constructor for QgsComposerMapOverview.
:param map: QgsComposerMap the overview is attached to
%End

virtual ~QgsComposerMapOverview();
~QgsComposerMapOverview();

virtual void draw( QPainter *painter );

@@ -67,7 +67,9 @@ Constructor
virtual Qt::DropActions supportedDropActions() const;

virtual QStringList mimeTypes() const;

virtual QMimeData *mimeData( const QModelIndexList &indexes ) const;

virtual bool dropMimeData( const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent );

virtual bool removeRows( int row, int count, const QModelIndex &parent = QModelIndex() );
@@ -56,7 +56,7 @@ Construct a new multiframe item.
:param createUndoCommands:
%End

virtual ~QgsComposerMultiFrame();
~QgsComposerMultiFrame();

virtual QSizeF totalSize() const = 0;
%Docstring
@@ -92,7 +92,7 @@ Returns the composer object property definitions.
Constructor
:param composition: parent composition
%End
virtual ~QgsComposerObject();
~QgsComposerObject();

const QgsComposition *composition() const;
%Docstring
@@ -208,6 +208,7 @@ Return list of keys stored in custom properties for the object.
%End

virtual QgsExpressionContext createExpressionContext() const;

%Docstring
Creates an expression context relating to the objects' current state. The context includes
scopes for global, project and composition properties.
@@ -398,6 +398,7 @@ Forces a recalculation of the picture's frame size

virtual void refreshDataDefinedProperty( const QgsComposerObject::DataDefinedProperty property = QgsComposerObject::AllProperties, const QgsExpressionContext *context = 0 );


signals:
void pictureRotationChanged( double newRotation );
%Docstring

0 comments on commit 4da1ce8

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