Skip to content

Commit

Permalink
Fix false positive cppcheck pureVirtualCall warnings when pure
Browse files Browse the repository at this point in the history
virtual functions are called as slots
  • Loading branch information
nyalldawson committed Apr 17, 2023
1 parent a7f12a5 commit 3c64bcc
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
Expand Up @@ -84,10 +84,14 @@ Raise, unminimize and activate this window.

protected:


virtual void repaintModel( bool showControls = true ) = 0;
virtual void addAlgorithm( const QString &algorithmId, const QPointF &pos ) = 0;

virtual void addInput( const QString &inputId, const QPointF &pos ) = 0;

virtual void exportAsScriptAlgorithm() = 0;

virtual bool saveModel( bool saveAs = false ) = 0;

QToolBar *toolbar();
Expand Down
2 changes: 1 addition & 1 deletion src/core/gps/qgsgpsconnection.h
Expand Up @@ -193,7 +193,7 @@ class CORE_EXPORT QgsGpsConnection : public QObject

protected slots:
//! Parse available data source content
virtual void parseData() = 0;
virtual void parseData() = 0; // cppcheck-suppress pureVirtualCall

private:

Expand Down
2 changes: 2 additions & 0 deletions src/gui/processing/models/qgsmodeldesignerdialog.h
Expand Up @@ -120,7 +120,9 @@ class GUI_EXPORT QgsModelDesignerDialog : public QMainWindow, public Ui::QgsMode
// cppcheck-suppress pureVirtualCall
virtual void repaintModel( bool showControls = true ) = 0;
virtual void addAlgorithm( const QString &algorithmId, const QPointF &pos ) = 0;
// cppcheck-suppress pureVirtualCall
virtual void addInput( const QString &inputId, const QPointF &pos ) = 0;
// cppcheck-suppress pureVirtualCall
virtual void exportAsScriptAlgorithm() = 0;
// cppcheck-suppress pureVirtualCall
virtual bool saveModel( bool saveAs = false ) = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/processing/qgsprocessingbatchalgorithmdialogbase.h
Expand Up @@ -54,7 +54,7 @@ class GUI_EXPORT QgsProcessingBatchAlgorithmDialogBase : public QgsProcessingAlg
/**
* Will be called when the "Run as Single" button is clicked.
*/
virtual void runAsSingle() = 0;
virtual void runAsSingle() = 0; // cppcheck-suppress pureVirtualCall

protected slots:

Expand Down
14 changes: 7 additions & 7 deletions src/gui/qgsfilecontentsourcelineedit.h
Expand Up @@ -111,37 +111,37 @@ class GUI_EXPORT QgsAbstractFileContentSourceLineEdit : public QWidget SIP_ABSTR
/**
* Returns the widget's file filter string.
*/
virtual QString fileFilter() const = 0;
virtual QString fileFilter() const = 0; // cppcheck-suppress pureVirtualCall

/**
* Returns the translated title to use for the select file dialog.
*/
virtual QString selectFileTitle() const = 0;
virtual QString selectFileTitle() const = 0; // cppcheck-suppress pureVirtualCall

/**
* Returns the translated title to use for the file from URL dialog.
*/
virtual QString fileFromUrlTitle() const = 0;
virtual QString fileFromUrlTitle() const = 0; // cppcheck-suppress pureVirtualCall

/**
* Returns the translated descriptive text to use for the file from URL dialog.
*/
virtual QString fileFromUrlText() const = 0;
virtual QString fileFromUrlText() const = 0; // cppcheck-suppress pureVirtualCall

/**
* Returns the translated title to use for the embed file dialog.
*/
virtual QString embedFileTitle() const = 0;
virtual QString embedFileTitle() const = 0; // cppcheck-suppress pureVirtualCall

/**
* Returns the translated title to use for the extract file dialog.
*/
virtual QString extractFileTitle() const = 0;
virtual QString extractFileTitle() const = 0; // cppcheck-suppress pureVirtualCall

/**
* Returns the default settings key to use for the widget's settings.
*/
virtual QString defaultSettingsKey() const = 0;
virtual QString defaultSettingsKey() const = 0; // cppcheck-suppress pureVirtualCall

///@endcond
#endif
Expand Down

0 comments on commit 3c64bcc

Please sign in to comment.