Skip to content

Commit b69389b

Browse files
committed
Run clang-tidy modernization checks
1 parent 8f55093 commit b69389b

File tree

112 files changed

+279
-448
lines changed

Some content is hidden

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

112 files changed

+279
-448
lines changed

python/gui/auto_generated/qgsnewgeopackagelayerdialog.sip.in

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ Dialog to set up parameters to create a new GeoPackage layer, and on accept() to
3131
%Docstring
3232
Constructor
3333
%End
34-
~QgsNewGeoPackageLayerDialog();
3534

3635
void setCrs( const QgsCoordinateReferenceSystem &crs );
3736
%Docstring

python/gui/auto_generated/qgsprojectionselectiondialog.sip.in

-3
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ the you probably want to look at QgsProjectionSelectionWidget instead.
3636
Constructor for QgsProjectionSelectionDialog.
3737
%End
3838

39-
40-
~QgsProjectionSelectionDialog();
41-
4239
QgsCoordinateReferenceSystem crs() const;
4340
%Docstring
4441
Returns the CRS currently selected in the widget.

src/3d/chunks/qgschunkedentity_p.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,9 @@ static float screenSpaceError( QgsChunkNode *node, const QgsChunkedEntity::Scene
6464

6565
QgsChunkedEntity::QgsChunkedEntity( const QgsAABB &rootBbox, float rootError, float tau, int maxLevel, QgsChunkLoaderFactory *loaderFactory, Qt3DCore::QNode *parent )
6666
: Qt3DCore::QEntity( parent )
67-
, mNeedsUpdate( false )
6867
, mTau( tau )
6968
, mMaxLevel( maxLevel )
7069
, mChunkLoaderFactory( loaderFactory )
71-
, mMaxLoadedChunks( 512 )
7270
{
7371
mRootNode = new QgsChunkNode( 0, 0, 0, rootBbox, rootError );
7472
mChunkLoaderQueue = new QgsChunkList;

src/3d/qgs3dmapsettings.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include "qgsrasterlayer.h"
2828

2929
Qgs3DMapSettings::Qgs3DMapSettings( const Qgs3DMapSettings &other )
30-
: QObject()
30+
: QObject( nullptr )
3131
, mOrigin( other.mOrigin )
3232
, mCrs( other.mCrs )
3333
, mBackgroundColor( other.mBackgroundColor )

src/3d/qgsaabb.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
#include "qgis_3d.h"
2020

21-
#include <math.h>
21+
#include <cmath>
2222
#include <QList>
2323
#include <QVector3D>
2424

src/3d/qgstessellatedpolygongeometry.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ QgsTessellatedPolygonGeometry::QgsTessellatedPolygonGeometry( QNode *parent )
5656
}
5757
}
5858

59-
QgsTessellatedPolygonGeometry::~QgsTessellatedPolygonGeometry()
60-
{
61-
}
62-
6359
void QgsTessellatedPolygonGeometry::setPolygons( const QList<QgsPolygon *> &polygons, const QgsPointXY &origin, float extrusionHeight, const QList<float> &extrusionHeightPerPolygon )
6460
{
6561
QgsTessellator tessellator( origin.x(), origin.y(), mWithNormals, mInvertNormals, mAddBackFaces );

src/3d/qgstessellatedpolygongeometry.h

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ class QgsTessellatedPolygonGeometry : public Qt3DRender::QGeometry
3939
public:
4040
//! Constructor
4141
QgsTessellatedPolygonGeometry( QNode *parent = nullptr );
42-
~QgsTessellatedPolygonGeometry() override;
4342

4443
//! Returns whether the normals of triangles will be inverted (useful for fixing clockwise / counter-clockwise face vertex orders)
4544
bool invertNormals() const { return mInvertNormals; }

src/3d/qgstilingscheme.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ QgsRectangle QgsTilingScheme::tileToExtent( int x, int y, int z ) const
4949
void QgsTilingScheme::extentToTile( const QgsRectangle &extent, int &x, int &y, int &z ) const
5050
{
5151
x = y = z = 0; // start with root tile
52-
while ( 1 )
52+
while ( true )
5353
{
5454
// try to see if any child tile fully contains our extent - if so, go deeper
5555
if ( tileToExtent( x * 2, y * 2, z + 1 ).contains( extent ) )

src/analysis/interpolation/Bezier3D.h

+1-6
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class ANALYSIS_EXPORT Bezier3D: public ParametricLine
3434

3535
public:
3636
//! Default constructor
37-
Bezier3D();
37+
Bezier3D() = default;
3838
//! Constructor, par is a pointer to the parent, controlpoly a controlpolygon
3939
Bezier3D( ParametricLine *par, QVector<QgsPoint *> *controlpoly );
4040

@@ -72,11 +72,6 @@ class ANALYSIS_EXPORT Bezier3D: public ParametricLine
7272

7373
//-----------------------------------------------constructors, destructor and assignment operator------------------------------
7474

75-
inline Bezier3D::Bezier3D() : ParametricLine()//default constructor
76-
{
77-
78-
}
79-
8075
inline Bezier3D::Bezier3D( ParametricLine *parent, QVector<QgsPoint *> *controlpoly ) : ParametricLine( parent, controlpoly )
8176
{
8277
mDegree = mControlPoly->count() - 1;

src/analysis/interpolation/NormVecDecorator.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ class ANALYSIS_EXPORT NormVecDecorator: public TriDecorator
8686
#ifndef SIP_RUN
8787

8888
inline NormVecDecorator::NormVecDecorator()
89-
: TriDecorator()
90-
, mNormVec( new QVector<Vector3D*>( DEFAULT_STORAGE_FOR_NORMALS ) )
89+
: mNormVec( new QVector<Vector3D*>( DEFAULT_STORAGE_FOR_NORMALS ) )
9190
, mPointState( new QVector<PointState>( DEFAULT_STORAGE_FOR_NORMALS ) )
9291
{
9392
alreadyestimated = false;

src/analysis/vector/mersenne-twister.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#define SIP_NO_FILE
2828

2929
#ifndef _MSC_VER
30-
#include <stdint.h>
30+
#include <cstdint>
3131
#else
3232
typedef __int32 int32_t;
3333
typedef unsigned __int32 uint32_t;

src/app/layout/qgslayoutimageexportoptionsdialog.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class QgsLayoutImageExportOptionsDialog: public QDialog, private Ui::QgsLayoutIm
3737
* \param parent parent widget
3838
* \param flags window flags
3939
*/
40-
QgsLayoutImageExportOptionsDialog( QWidget *parent = nullptr, Qt::WindowFlags flags = 0 );
40+
QgsLayoutImageExportOptionsDialog( QWidget *parent = nullptr, Qt::WindowFlags flags = nullptr );
4141

4242
/**
4343
* Sets the initial resolution displayed in the dialog.

src/app/layout/qgsreportsectionmodel.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ QgsReportSectionModel::QgsReportSectionModel( QgsReport *report, QObject *parent
2929
Qt::ItemFlags QgsReportSectionModel::flags( const QModelIndex &index ) const
3030
{
3131
if ( !index.isValid() )
32-
return 0;
32+
return nullptr;
3333

3434
return QAbstractItemModel::flags( index );
3535
}

src/app/main.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,8 @@
3636
#include <QMessageBox>
3737

3838
#include <cstdio>
39-
#include <stdio.h>
40-
#include <stdlib.h>
41-
#include <stdarg.h>
39+
#include <cstdlib>
40+
#include <cstdarg>
4241

4342
#ifdef WIN32
4443
// Open files in binary mode
@@ -72,9 +71,9 @@ typedef SInt32 SRefCon;
7271
#if ((defined(linux) || defined(__linux__)) && !defined(ANDROID)) || defined(__FreeBSD__)
7372
#include <unistd.h>
7473
#include <execinfo.h>
75-
#include <signal.h>
74+
#include <csignal>
7675
#include <sys/wait.h>
77-
#include <errno.h>
76+
#include <cerrno>
7877
#endif
7978

8079
#include "qgscustomization.h"

src/app/qgsattributesformproperties.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -747,9 +747,7 @@ QgsAttributesFormProperties::FieldConfig::operator QVariant()
747747
/*
748748
* RelationConfig implementation
749749
*/
750-
QgsAttributesFormProperties::RelationConfig::RelationConfig()
751-
{
752-
}
750+
QgsAttributesFormProperties::RelationConfig::RelationConfig() = default;
753751

754752
QgsAttributesFormProperties::RelationConfig::RelationConfig( QgsVectorLayer *layer, const QString &relationId )
755753
{

src/app/qgsattributesformproperties.h

-3
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,6 @@ class APP_EXPORT QgsAttributesFormProperties : public QWidget, private Ui_QgsAtt
8787
: mType( type )
8888
, mName( name )
8989
, mDisplayName( displayName )
90-
, mColumnCount( 1 )
91-
, mShowAsGroupBox( false )
92-
, mShowLabel( true )
9390
{}
9491

9592
QString name() const { return mName; }

src/app/qgscustomization.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,6 @@ QgsCustomizationDialog::QgsCustomizationDialog( QWidget * parent, QSettings * se
7272

7373
}
7474

75-
QgsCustomizationDialog::~QgsCustomizationDialog()
76-
{
77-
}
78-
7975
QTreeWidgetItem *QgsCustomizationDialog::item( const QString &path, QTreeWidgetItem *widgetItem )
8076
{
8177
QString pathCopy = path;

src/app/qgscustomization.h

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ class APP_EXPORT QgsCustomizationDialog : public QMainWindow, private Ui::QgsCus
3737
Q_OBJECT
3838
public:
3939
QgsCustomizationDialog( QWidget *parent, QSettings *settings );
40-
~QgsCustomizationDialog() override;
4140

4241
// get item by path
4342
QTreeWidgetItem *item( const QString &path, QTreeWidgetItem *widgetItem = nullptr );

src/app/qgscustomprojectiondialog.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,6 @@ QgsCustomProjectionDialog::QgsCustomProjectionDialog( QWidget *parent, Qt::Windo
8282
connect( teParameters, &QPlainTextEdit::textChanged, this, &QgsCustomProjectionDialog::updateListFromCurrentItem );
8383
}
8484

85-
QgsCustomProjectionDialog::~QgsCustomProjectionDialog()
86-
{
87-
}
88-
89-
9085
void QgsCustomProjectionDialog::populateList()
9186
{
9287
//Setup connection to the existing custom CRS database:

src/app/qgscustomprojectiondialog.h

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ class APP_EXPORT QgsCustomProjectionDialog : public QDialog, private Ui::QgsCust
3333
Q_OBJECT
3434
public:
3535
QgsCustomProjectionDialog( QWidget *parent = nullptr, Qt::WindowFlags fl = nullptr );
36-
~QgsCustomProjectionDialog() override;
3736

3837
public slots:
3938
void pbnCalculate_clicked();

src/app/qgsdatumtransformtablewidget.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,6 @@ QgsDatumTransformTableWidget::QgsDatumTransformTableWidget( QWidget *parent )
193193
connect( mEditButton, &QToolButton::clicked, this, &QgsDatumTransformTableWidget::editDatumTransform );
194194
}
195195

196-
QgsDatumTransformTableWidget::~QgsDatumTransformTableWidget()
197-
{
198-
}
199-
200-
201196
void QgsDatumTransformTableWidget::addDatumTransform()
202197
{
203198
QgsDatumTransformDialog dlg;

src/app/qgsdatumtransformtablewidget.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ class APP_EXPORT QgsDatumTransformTableWidget : public QWidget, private Ui::QgsD
7373
Q_OBJECT
7474

7575
public:
76-
explicit QgsDatumTransformTableWidget( QWidget *parent = 0 );
77-
~QgsDatumTransformTableWidget() override;
76+
explicit QgsDatumTransformTableWidget( QWidget *parent = nullptr );
7877

7978
void setTransformContext( const QgsCoordinateTransformContext &context )
8079
{

src/app/qgsfirstrundialog.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class APP_EXPORT QgsFirstRunDialog : public QDialog, private Ui::QgsFirstRunDial
2626
{
2727
Q_OBJECT
2828
public:
29-
QgsFirstRunDialog( QWidget *parent = 0 );
29+
QgsFirstRunDialog( QWidget *parent = nullptr );
3030

3131
bool migrateSettings();
3232

src/app/qgsmaptoolselectionhandler.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ bool QgsDistanceWidget::eventFilter( QObject *obj, QEvent *ev )
9898

9999

100100
QgsMapToolSelectionHandler::QgsMapToolSelectionHandler( QgsMapCanvas *canvas, QgsMapToolSelectionHandler::SelectionMode selectionMode )
101-
: QObject()
102-
, mCanvas( canvas )
101+
: mCanvas( canvas )
103102
, mSelectionMode( selectionMode )
104103
, mSnapIndicator( qgis::make_unique< QgsSnapIndicator >( canvas ) )
105104
{

src/app/qgsnewspatialitelayerdialog.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,6 @@ QgsNewSpatialiteLayerDialog::QgsNewSpatialiteLayerDialog( QWidget *parent, Qt::W
112112

113113
}
114114

115-
QgsNewSpatialiteLayerDialog::~QgsNewSpatialiteLayerDialog()
116-
{
117-
118-
}
119-
120115
void QgsNewSpatialiteLayerDialog::mGeometryTypeBox_currentIndexChanged( int index )
121116
{
122117
pbnFindSRID->setEnabled( index != 0 );

src/app/qgsnewspatialitelayerdialog.h

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ class APP_EXPORT QgsNewSpatialiteLayerDialog: public QDialog, private Ui::QgsNew
3737

3838
public:
3939
QgsNewSpatialiteLayerDialog( QWidget *parent = nullptr, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags, const QgsCoordinateReferenceSystem &defaultCrs = QgsCoordinateReferenceSystem() );
40-
~QgsNewSpatialiteLayerDialog() override;
4140

4241
protected slots:
4342
void mAddAttributeButton_clicked();

src/app/qgsrasterlayerproperties.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -450,11 +450,6 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer *lyr, QgsMapCanv
450450
title += QStringLiteral( " (%1)" ).arg( mRasterLayer->styleManager()->currentStyle() );
451451
restoreOptionsBaseUi( title );
452452
optionsStackedWidget_CurrentChanged( mOptionsStackedWidget->currentIndex() );
453-
} // QgsRasterLayerProperties ctor
454-
455-
456-
QgsRasterLayerProperties::~QgsRasterLayerProperties()
457-
{
458453
}
459454

460455
void QgsRasterLayerProperties::setupTransparencyTable( int nBands )

src/app/qgsrasterlayerproperties.h

-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ class APP_EXPORT QgsRasterLayerProperties : public QgsOptionsDialogBase, private
5353
*/
5454
QgsRasterLayerProperties( QgsMapLayer *lyr, QgsMapCanvas *canvas, QWidget *parent = nullptr, Qt::WindowFlags = QgsGuiUtils::ModalDialogFlags );
5555

56-
~QgsRasterLayerProperties() override;
57-
5856
//! Synchronize state with associated raster layer
5957
void sync();
6058

src/app/qgssnappingwidget.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@ QgsSnappingWidget::QgsSnappingWidget( QgsProject *project, QgsMapCanvas *canvas,
4747
, mProject( project )
4848
, mConfig( project )
4949
, mCanvas( canvas )
50-
, mModeAction( nullptr )
51-
, mTypeAction( nullptr )
52-
, mToleranceAction( nullptr )
53-
, mUnitAction( nullptr )
54-
5550
{
5651
// detect the type of display
5752
QToolBar *tb = qobject_cast<QToolBar *>( parent );

src/auth/basic/qgsauthbasicedit.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class QgsAuthBasicEdit : public QgsAuthMethodEdit, private Ui::QgsAuthBasicEdit
4949

5050
private:
5151
QgsStringMap mConfigMap;
52-
bool mValid = 0;
52+
bool mValid = false;
5353
};
5454

5555
#endif // QGSAUTHBASICEDIT_H

src/auth/identcert/qgsauthidentcertedit.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class QgsAuthIdentCertEdit : public QgsAuthMethodEdit, private Ui::QgsAuthIdentC
4949

5050
private:
5151
QgsStringMap mConfigMap;
52-
bool mValid = 0;
52+
bool mValid = false;
5353
};
5454

5555
#endif // QGSAUTHIDENTCERTEDIT_H

src/auth/pkipaths/qgsauthpkipathsedit.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class QgsAuthPkiPathsEdit : public QgsAuthMethodEdit, private Ui::QgsAuthPkiPath
6767
bool validityChange( bool curvalid );
6868
bool populateCas();
6969
QgsStringMap mConfigMap;
70-
bool mValid = 0;
70+
bool mValid = false;
7171
};
7272

7373
#endif // QGSAUTHPKIPATHSEDIT_H

src/auth/pkipkcs12/qgsauthpkcs12edit.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class QgsAuthPkcs12Edit : public QgsAuthMethodEdit, private Ui::QgsAuthPkcs12Edi
6767
bool populateCas( );
6868

6969
QgsStringMap mConfigMap;
70-
bool mValid = 0;
70+
bool mValid = false;
7171
};
7272

7373
#endif // QGSAUTHPKCS12EDIT_H

src/core/layout/qgslayoutexporter.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ class LayoutContextSettingsRestorer
289289
private:
290290
QgsLayout *mLayout = nullptr;
291291
double mPreviousDpi = 0;
292-
QgsLayoutRenderContext::Flags mPreviousFlags = 0;
292+
QgsLayoutRenderContext::Flags mPreviousFlags = nullptr;
293293
int mPreviousExportLayer = 0;
294294
};
295295
///@endcond PRIVATE

src/core/layout/qgslayoutexporter.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ class CORE_EXPORT QgsLayoutExporter
203203
/**
204204
* Layout context flags, which control how the export will be created.
205205
*/
206-
QgsLayoutRenderContext::Flags flags = 0;
206+
QgsLayoutRenderContext::Flags flags = nullptr;
207207

208208
};
209209

@@ -273,7 +273,7 @@ class CORE_EXPORT QgsLayoutExporter
273273
/**
274274
* Layout context flags, which control how the export will be created.
275275
*/
276-
QgsLayoutRenderContext::Flags flags = 0;
276+
QgsLayoutRenderContext::Flags flags = nullptr;
277277

278278
};
279279

@@ -338,7 +338,7 @@ class CORE_EXPORT QgsLayoutExporter
338338
/**
339339
* Layout context flags, which control how the export will be created.
340340
*/
341-
QgsLayoutRenderContext::Flags flags = 0;
341+
QgsLayoutRenderContext::Flags flags = nullptr;
342342

343343
};
344344

@@ -412,7 +412,7 @@ class CORE_EXPORT QgsLayoutExporter
412412
/**
413413
* Layout context flags, which control how the export will be created.
414414
*/
415-
QgsLayoutRenderContext::Flags flags = 0;
415+
QgsLayoutRenderContext::Flags flags = nullptr;
416416

417417
};
418418

0 commit comments

Comments
 (0)