Skip to content

Commit 4da1ce8

Browse files
committed
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.
1 parent 39521c7 commit 4da1ce8

File tree

906 files changed

+3573
-2688
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

906 files changed

+3573
-2688
lines changed

python/analysis/network/qgsgraphdirector.sip

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ using "builder" design patter.
3232
%End
3333
public:
3434

35-
virtual ~QgsGraphDirector();
35+
~QgsGraphDirector();
3636

3737
virtual void makeGraph( QgsGraphBuilderInterface *builder,
3838
const QVector< QgsPointXY > &additionalPoints,

python/analysis/network/qgsnetworkdistancestrategy.sip

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ used for finding shortest path between two points.
2222
%End
2323
public:
2424
virtual QVariant cost( double distance, const QgsFeature & ) const;
25+
2526
};
2627

2728
/************************************************************************

python/analysis/network/qgsvectorlayerdirector.sip

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Default constructor
4848
attribute value is not set or does not equal to the given values
4949
%End
5050

51-
virtual ~QgsVectorLayerDirector();
51+
~QgsVectorLayerDirector();
5252

5353
virtual void makeGraph( QgsGraphBuilderInterface *builder,
5454
const QVector< QgsPointXY > &additionalPoints,

python/analysis/raster/qgsderivativefilter.sip

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ Adds the ability to calculate derivatives in x- and y-directions. Needs to be su
2020
%End
2121
public:
2222
QgsDerivativeFilter( const QString &inputFile, const QString &outputFile, const QString &outputFormat );
23-
virtual ~QgsDerivativeFilter();
24-
virtual float processNineCellWindow( float *x11, float *x21, float *x31,
25-
float *x12, float *x22, float *x32,
26-
float *x13, float *x23, float *x33 ) = 0;
23+
~QgsDerivativeFilter();
24+
virtual float processNineCellWindow( float *x11, float *x21, float *x31,
25+
float *x12, float *x22, float *x32,
26+
float *x13, float *x23, float *x33 ) = 0;
2727

2828
protected:
2929
float calcFirstDerX( float *x11, float *x21, float *x31, float *x12, float *x22, float *x32, float *x13, float *x23, float *x33 );

python/core/annotations/qgshtmlannotation.sip

+2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ Returns the file path for the source HTML file.
5555
%End
5656

5757
virtual void writeXml( QDomElement &elem, QDomDocument &doc, const QgsReadWriteContext &context ) const;
58+
5859
virtual void readXml( const QDomElement &itemElem, const QgsReadWriteContext &context );
5960

61+
6062
virtual void setAssociatedFeature( const QgsFeature &feature );
6163

6264

python/core/annotations/qgssvgannotation.sip

+2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ Constructor for QgsSvgAnnotation.
3131

3232

3333
virtual void writeXml( QDomElement &elem, QDomDocument &doc, const QgsReadWriteContext &context ) const;
34+
3435
virtual void readXml( const QDomElement &itemElem, const QgsReadWriteContext &context );
3536

37+
3638
void setFilePath( const QString &file );
3739
%Docstring
3840
Sets the file path for the source SVG file.

python/core/annotations/qgstextannotation.sip

+2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ within the annotation. Ownership is not transferred.
4949
%End
5050

5151
virtual void writeXml( QDomElement &elem, QDomDocument &doc, const QgsReadWriteContext &context ) const;
52+
5253
virtual void readXml( const QDomElement &itemElem, const QgsReadWriteContext &context );
5354

55+
5456
static QgsTextAnnotation *create() /Factory/;
5557
%Docstring
5658
Returns a new QgsTextAnnotation object.

python/core/composer/qgscomposerattributetablemodelv2.sip

+5
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,15 @@ Constructor for QgsComposerAttributeTableColumnModel.
3737
%End
3838

3939
virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const;
40+
4041
virtual int columnCount( const QModelIndex &parent = QModelIndex() ) const;
4142

4243
virtual QVariant data( const QModelIndex &index, int role ) const;
44+
4345
virtual QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
4446

4547
virtual bool setData( const QModelIndex &index, const QVariant &value, int role = Qt::EditRole );
48+
4649
virtual Qt::ItemFlags flags( const QModelIndex &index ) const;
4750

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

178181
virtual QVariant data( const QModelIndex &index, int role ) const;
182+
179183
virtual QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
180184

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

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

189+
185190
QgsComposerTableColumn *columnFromRow( int row );
186191
%Docstring
187192
Returns the QgsComposerTableColumn corresponding to a row in the proxy model.

python/core/composer/qgscomposerattributetablev2.sip

+5
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ A table that displays attributes from a vector layer
6868

6969
virtual QString displayName() const;
7070

71+
7172
virtual bool writeXml( QDomElement &elem, QDomDocument &doc, bool ignoreFrames = false ) const;
73+
7274
%Docstring
7375
Writes properties specific to attribute tables
7476
:param elem: an existing QDomElement in which to store the attribute table's properties.
@@ -81,6 +83,7 @@ Writes properties specific to attribute tables
8183
%End
8284

8385
virtual bool readXml( const QDomElement &itemElem, const QDomDocument &doc, bool ignoreFrames = false );
86+
8487
%Docstring
8588
Reads the properties specific to an attribute table from xml.
8689
: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.
9497

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

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

394398
virtual QgsExpressionContext createExpressionContext() const;
395399

400+
396401
};
397402

398403
/************************************************************************

python/core/composer/qgscomposereffect.sip

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Constructor for QgsComposerEffect.
2727

2828
protected:
2929
virtual void draw( QPainter *painter );
30+
3031
%Docstring
3132
Called whenever source needs to be drawn
3233
%End

python/core/composer/qgscomposerframe.sip

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Returns the parent multiframe for the frame.
4141

4242
virtual QString displayName() const;
4343

44+
4445
virtual void setSceneRect( const QRectF &rectangle );
4546

4647

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

132133
virtual QgsExpressionContext createExpressionContext() const;
133134

135+
134136
};
135137

136138
/************************************************************************

python/core/composer/qgscomposerhtml.sip

+2
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ Returns whether user stylesheets are enabled for the HTML content.
265265
%End
266266

267267
virtual QString displayName() const;
268+
268269
virtual QSizeF totalSize() const;
269270

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

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

305+
304306
};
305307

306308
/************************************************************************

python/core/composer/qgscomposeritem.sip

+3-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Constructor with box position and composer object
9696
:param composition: parent composition
9797
:param manageZValue: true if the z-Value of this object should be managed by mComposition*
9898
%End
99-
virtual ~QgsComposerItem();
99+
~QgsComposerItem();
100100

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

748748
virtual QgsExpressionContext createExpressionContext() const;
749+
749750
%Docstring
750751
Creates an expression context relating to the item's current state. The context includes
751752
scopes for global, project, composition, atlas and item properties.
@@ -799,6 +800,7 @@ around item center. If false, rotation occurs around item origin
799800

800801

801802
virtual void refreshDataDefinedProperty( const QgsComposerObject::DataDefinedProperty property = QgsComposerObject::AllProperties, const QgsExpressionContext *context = 0 );
803+
802804
%Docstring
803805
Refreshes a data defined property for the item by reevaluating the property's value
804806
and redrawing the item with this new value.

python/core/composer/qgscomposeritemgroup.sip

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ corresponds to 1 scene size unit*
5555

5656
virtual void setVisibility( const bool visible );
5757

58+
5859
virtual bool writeXml( QDomElement &elem, QDomDocument &doc ) const;
5960

6061
%Docstring

python/core/composer/qgscomposerlabel.sip

+3
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ Sets state from Dom document
198198

199199
virtual QString displayName() const;
200200

201+
201202
virtual QRectF boundingRect() const;
202203

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

210211
virtual void setFrameEnabled( const bool drawFrame );
212+
211213
%Docstring
212214
Reimplemented to call prepareGeometryChange after toggling frame
213215
%End
214216

215217
virtual void setFrameStrokeWidth( const double strokeWidth );
218+
216219
%Docstring
217220
Reimplemented to call prepareGeometryChange after changing stroke width
218221
%End

python/core/composer/qgscomposerlegend.sip

+3
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ Find out whether legend items are filtered to show just the ones visible in the
110110
%End
111111

112112
virtual void updateItem();
113+
113114
%Docstring
114115
Update() overloading. Use it rather than update()
115116

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

419420
virtual QString displayName() const;
420421

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

442444

445+
443446
};
444447

445448

python/core/composer/qgscomposermap.sip

+6-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Constructor.
2828
%Docstring
2929
Constructor. Settings are read from project.
3030
%End
31-
virtual ~QgsComposerMap();
31+
~QgsComposerMap();
3232

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

9898
virtual void zoomContent( const double factor, const QPointF point, const ZoomMode mode = QgsComposerItem::Zoom );
99+
99100
%Docstring
100101
Zoom content of item. Does nothing per default (but implemented in composer map)
101102
: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
444445
%End
445446

446447
virtual void setFrameStrokeWidth( const double strokeWidth );
448+
447449
%Docstring
448450
reimplement setFrameStrokeWidth, so that updateBoundingRect() is called after setting the frame width */
449451
%End
@@ -619,6 +621,7 @@ clockwise, starting at the top-left point
619621

620622
virtual QString displayName() const;
621623

624+
622625
QPolygonF transformedMapPolygon() const;
623626
%Docstring
624627
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
642645

643646
virtual QgsExpressionContext createExpressionContext() const;
644647

648+
645649
signals:
646650
void extentChanged();
647651

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

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

686+
682687
};
683688

684689

python/core/composer/qgscomposermapgrid.sip

+2-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ Constructor for QgsComposerMapGrid.
284284
:param map: QgsComposerMap the grid is attached to
285285
%End
286286

287-
virtual ~QgsComposerMapGrid();
287+
~QgsComposerMapGrid();
288288

289289
virtual void draw( QPainter *painter );
290290

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

10901090
virtual QgsExpressionContext createExpressionContext() const;
10911091

1092+
10921093
public:
10931094
};
10941095

python/core/composer/qgscomposermapitem.sip

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Draws the item on to a painter
3434
%End
3535

3636
virtual bool writeXml( QDomElement &elem, QDomDocument &doc ) const;
37+
3738
%Docstring
3839
Stores map item state in DOM element
3940
:param elem: is DOM element corresponding to a 'ComposerMap' tag
@@ -45,6 +46,7 @@ Stores map item state in DOM element
4546
%End
4647

4748
virtual bool readXml( const QDomElement &itemElem, const QDomDocument &doc );
49+
4850
%Docstring
4951
Sets map item state from a DOM document
5052
:param itemElem: is DOM node corresponding to a 'ComposerMapGrid' tag

python/core/composer/qgscomposermapoverview.sip

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ Constructor for QgsComposerMapOverview.
173173
:param map: QgsComposerMap the overview is attached to
174174
%End
175175

176-
virtual ~QgsComposerMapOverview();
176+
~QgsComposerMapOverview();
177177

178178
virtual void draw( QPainter *painter );
179179

python/core/composer/qgscomposermodel.sip

+2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ Constructor
6767
virtual Qt::DropActions supportedDropActions() const;
6868

6969
virtual QStringList mimeTypes() const;
70+
7071
virtual QMimeData *mimeData( const QModelIndexList &indexes ) const;
72+
7173
virtual bool dropMimeData( const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent );
7274

7375
virtual bool removeRows( int row, int count, const QModelIndex &parent = QModelIndex() );

python/core/composer/qgscomposermultiframe.sip

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Construct a new multiframe item.
5656
:param createUndoCommands:
5757
%End
5858

59-
virtual ~QgsComposerMultiFrame();
59+
~QgsComposerMultiFrame();
6060

6161
virtual QSizeF totalSize() const = 0;
6262
%Docstring

python/core/composer/qgscomposerobject.sip

+2-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Returns the composer object property definitions.
9292
Constructor
9393
:param composition: parent composition
9494
%End
95-
virtual ~QgsComposerObject();
95+
~QgsComposerObject();
9696

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

210210
virtual QgsExpressionContext createExpressionContext() const;
211+
211212
%Docstring
212213
Creates an expression context relating to the objects' current state. The context includes
213214
scopes for global, project and composition properties.

python/core/composer/qgscomposerpicture.sip

+1
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ Forces a recalculation of the picture's frame size
398398

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

401+
401402
signals:
402403
void pictureRotationChanged( double newRotation );
403404
%Docstring

0 commit comments

Comments
 (0)