Skip to content
Permalink
Browse files
Address -Woverloaded-virtual clang virtual and enable the warning
  • Loading branch information
rouault authored and nyalldawson committed Jun 24, 2021
1 parent e64e8d2 commit 8a6ed7d8f90a807232662b1616a4cb6899971f6d
@@ -635,7 +635,7 @@ if (PEDANTIC)
# add_definitions( -fstrict-aliasing -Wstrict-aliasing=1 -Wredundant-decls )

if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-return-type-c-linkage -Wno-overloaded-virtual -Wimplicit-fallthrough")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-return-type-c-linkage -Woverloaded-virtual -Wimplicit-fallthrough")
endif()

# add any extra CXXFLAGS flags set by user. can be -D CXX_EXTRA_FLAGS or environment variable
@@ -205,6 +205,7 @@ Subclasses should override this and :py:func:`~QgsDataItem.handleDrop` to accept
QGIS 3.10
%End


virtual bool handleDrop( const QMimeData * /*data*/, Qt::DropAction /*action*/ ) /Deprecated/;
%Docstring
Attempts to process the mime data dropped on this item. Subclasses must override this and :py:func:`~QgsDataItem.acceptDrop` if they
@@ -105,6 +105,8 @@ Inherited method not used. You cannot delete or insert a vertex directly. Return





QgsPoint vertexAt( int atVertex ) const /HoldGIL/;
%Docstring
Returns coordinates of a vertex.
@@ -61,6 +61,7 @@ Constructor
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
%End


QgsAuxiliaryLayer *clone( QgsVectorLayer *layer ) const /Factory/;
%Docstring
Returns a new instance equivalent to this one. The underlying table
@@ -48,6 +48,7 @@ Make sure, the master model is already loaded, so the selection will get synchro
:param canvas: The mapCanvas. Used to identify the currently visible features.
%End


void setSourceModel( QgsAttributeTableModel *sourceModel );
%Docstring
Set the attribute table model that backs this model
@@ -57,6 +58,7 @@ Set the attribute table model that backs this model
.. versionadded:: 2.0
%End


void setSelectedOnTop( bool selectedOnTop );
%Docstring
Changes the sort order of the features. If set to ``True``, selected features
@@ -38,6 +38,7 @@ Returns the layer cache
:return: the layer cache used as backend
%End


virtual void setModel( QgsFeatureListModel *featureListModel );
%Docstring
Set the :py:class:`QgsFeatureListModel` which is used to retrieve information
@@ -29,6 +29,7 @@ Widget to control a layers transparency and related options

public slots:


void syncToLayer();
%Docstring
Sync the widget state to the layer set for the widget.
@@ -55,6 +55,8 @@ called when user changes renderer type
Apply the changes from the dialog to the layer.
%End



void syncToLayer( QgsRasterLayer *layer );
%Docstring
Sync the widget to the given layer.
@@ -76,6 +76,8 @@ class QgsNetworkLogger : public QAbstractItemModel
QList< QAction * > actions( const QModelIndex &index, QObject *parent );


using QAbstractItemModel::removeRows;

/**
* Removes a list of request \a rows from the log.
*/
@@ -217,6 +217,11 @@ class CORE_EXPORT QgsDataItem : public QObject
*/
Q_DECL_DEPRECATED virtual bool acceptDrop() SIP_DEPRECATED { return false; }

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Woverloaded-virtual"
#endif

/**
* Attempts to process the mime data dropped on this item. Subclasses must override this and acceptDrop() if they
* accept dropped layers.
@@ -226,6 +231,9 @@ class CORE_EXPORT QgsDataItem : public QObject
* \deprecated QGIS 3.10
*/
Q_DECL_DEPRECATED virtual bool handleDrop( const QMimeData * /*data*/, Qt::DropAction /*action*/ ) SIP_DEPRECATED { return false; }
#ifdef __clang__
#pragma clang diagnostic pop
#endif

/**
* Called when a user double clicks on the item. Subclasses should return TRUE
@@ -102,12 +102,21 @@ class CORE_EXPORT QgsTriangle : public QgsPolygon

// inherited: double pointDistanceToBoundary( double x, double y ) const;


#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Woverloaded-virtual"
#endif

/**
* Returns coordinates of a vertex.
* \param atVertex index of the vertex
* \returns Coordinates of the vertex or empty QgsPoint on error (\a atVertex < 0 or > 3).
*/
QgsPoint vertexAt( int atVertex ) const SIP_HOLDGIL;
#ifdef __clang__
#pragma clang diagnostic pop
#endif

/**
* Returns the three lengths of the triangle.
@@ -89,6 +89,11 @@ class CORE_EXPORT QgsAuxiliaryLayer : public QgsVectorLayer
% End
#endif

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Woverloaded-virtual"
#endif

/**
* Returns a new instance equivalent to this one. The underlying table
* is duplicate for the layer given in parameter. Note that the current
@@ -97,6 +102,9 @@ class CORE_EXPORT QgsAuxiliaryLayer : public QgsVectorLayer
* \param layer The layer for which the clone is made
*/
QgsAuxiliaryLayer *clone( QgsVectorLayer *layer ) const SIP_FACTORY;
#ifdef __clang__
#pragma clang diagnostic pop
#endif

/**
* An auxiliary layer is not spatial. This method returns a spatial
@@ -82,6 +82,11 @@ class GUI_EXPORT QgsAttributeTableFilterModel: public QSortFilterProxyModel, pub
*/
QgsAttributeTableFilterModel( QgsMapCanvas *canvas, QgsAttributeTableModel *sourceModel, QObject *parent SIP_TRANSFERTHIS = nullptr );

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Woverloaded-virtual"
#endif

/**
* Set the attribute table model that backs this model
*
@@ -91,6 +96,10 @@ class GUI_EXPORT QgsAttributeTableFilterModel: public QSortFilterProxyModel, pub
*/
void setSourceModel( QgsAttributeTableModel *sourceModel );

#ifdef __clang__
#pragma clang diagnostic pop
#endif

/**
* Changes the sort order of the features. If set to TRUE, selected features
* will be sorted on top, regardless of the current sort column
@@ -54,7 +54,14 @@ class GUI_EXPORT QgsAttributeTableView : public QTableView
//! Constructor for QgsAttributeTableView
QgsAttributeTableView( QWidget *parent SIP_TRANSFERTHIS = nullptr );

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Woverloaded-virtual"
#endif
virtual void setModel( QgsAttributeTableFilterModel *filterModel );
#ifdef __clang__
#pragma clang diagnostic pop
#endif

/**
* \brief setFeatureSelectionManager
@@ -68,7 +68,14 @@ class GUI_EXPORT QgsFeatureListModel : public QSortFilterProxyModel, public QgsF
//! Constructor for QgsFeatureListModel
explicit QgsFeatureListModel( QgsAttributeTableFilterModel *sourceModel, QObject *parent SIP_TRANSFERTHIS = nullptr );

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Woverloaded-virtual"
#endif
virtual void setSourceModel( QgsAttributeTableFilterModel *sourceModel );
#ifdef __clang__
#pragma clang diagnostic pop
#endif

/**
* Returns the vector layer cache which is being used to populate the model.
@@ -62,12 +62,20 @@ class GUI_EXPORT QgsFeatureListView : public QListView
*/
QgsVectorLayerCache *layerCache();

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Woverloaded-virtual"
#endif

/**
* Set the QgsFeatureListModel which is used to retrieve information
*
* \param featureListModel The model to use
*/
virtual void setModel( QgsFeatureListModel *featureListModel );
#ifdef __clang__
#pragma clang diagnostic pop
#endif

/**
* Gets the featureListModel used by this view
@@ -51,8 +51,15 @@ class GUI_EXPORT QgsRendererMeshPropertiesWidget : public QgsMapLayerConfigWidge
//! Applies the settings made in the dialog
void apply() override;

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Woverloaded-virtual"
#endif
//! Synchronize widgets state with associated mesh layer
void syncToLayer();
#ifdef __clang__
#pragma clang diagnostic pop
#endif

private slots:
void onActiveScalarGroupChanged( int groupIndex );
@@ -45,10 +45,18 @@ class GUI_EXPORT QgsRasterTransparencyWidget : public QgsMapLayerConfigWidget, p

public slots:

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Woverloaded-virtual"
#endif

/**
* Sync the widget state to the layer set for the widget.
*/
void syncToLayer();
#ifdef __clang__
#pragma clang diagnostic pop
#endif

/**
* Apply any changes on the widget to the set layer.
@@ -67,11 +67,20 @@ class GUI_EXPORT QgsRendererRasterPropertiesWidget : public QgsMapLayerConfigWid
//! Apply the changes from the dialog to the layer.
void apply() override;


#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Woverloaded-virtual"
#endif

/**
* \brief Sync the widget to the given layer.
* \param layer The layer to use for the widget
*/
void syncToLayer( QgsRasterLayer *layer );
#ifdef __clang__
#pragma clang diagnostic pop
#endif

private slots:
//! Slot to reset all color rendering options to default
@@ -80,7 +80,9 @@ class QgsDb2ConnectionItem : public QgsDataCollectionItem
QVector<QgsDataItem *> createChildren() override;
bool equal( const QgsDataItem *other ) override;

using QgsDataCollectionItem::handleDrop;
bool handleDrop( const QMimeData *data, const QString &toSchema );

void refresh() override;

QString connInfo() const { return mConnInfo; }
@@ -65,6 +65,7 @@ class QgsMssqlConnectionItem : public QgsDataCollectionItem
QVector<QgsDataItem *> createChildren() override;
bool equal( const QgsDataItem *other ) override;

using QgsDataCollectionItem::handleDrop;
bool handleDrop( const QMimeData *data, const QString &toSchema );

QString connInfo() const { return mConnInfo; }
@@ -55,6 +55,7 @@ class QgsPGConnectionItem : public QgsDataCollectionItem
QVector<QgsDataItem *> createChildren() override;
bool equal( const QgsDataItem *other ) override;

using QgsDataCollectionItem::handleDrop;
bool handleDrop( const QMimeData *data, const QString &toSchema );

signals:

0 comments on commit 8a6ed7d

Please sign in to comment.