From b9e250d98d8b26d230a6ea245fc89caddabd1965 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 19 Jul 2023 20:04:11 -0400 Subject: [PATCH] STYLE: Remove obsolete CTK_OVERRIDE macro not needed with C++ >= 11 This commit replaces occurrences of the CTK_OVERRIDE macro with override. This one-liner was used to perform the update: git grep -l "CTK_OVERRIDE" | fgrep -v CMakeLists.txt | fgrep -v .cmake | xargs sed -i '' -e "s/CTK_OVERRIDE/override/g" Adapted from Slicer/Slier@c33381e85 (STYLE: Replace ITK_OVERRIDE with override) --- Libs/Core/ctkCompilerDetections_p.h | 10 ---------- .../ctkDICOMDisplayedFieldGeneratorDefaultRule.h | 12 ++++++------ ...tkDICOMDisplayedFieldGeneratorLastStudyDateRule.h | 12 ++++++------ ...splayedFieldGeneratorPatientNumberOfStudiesRule.h | 12 ++++++------ ...FieldGeneratorRadiotherapySeriesDescriptionRule.h | 12 ++++++------ .../ctkDICOMDisplayedFieldGeneratorRuleFactory.h | 2 +- ...ICOMDisplayedFieldGeneratorSeriesImageCountRule.h | 12 ++++++------ ...MDisplayedFieldGeneratorStudyNumberOfSeriesRule.h | 12 ++++++------ Libs/Scripting/Python/Widgets/ctkPythonConsole.h | 4 ++-- Libs/Widgets/ctkCheckablePushButton.h | 8 ++++---- Libs/Widgets/ctkPathLineEdit.cpp | 2 +- 11 files changed, 44 insertions(+), 54 deletions(-) diff --git a/Libs/Core/ctkCompilerDetections_p.h b/Libs/Core/ctkCompilerDetections_p.h index 94947d3519..9b1cf34a87 100644 --- a/Libs/Core/ctkCompilerDetections_p.h +++ b/Libs/Core/ctkCompilerDetections_p.h @@ -29,14 +29,4 @@ // We mean it. // -/* - * C++11 keywords and expressions - */ - -#if (__cplusplus >= 201103L) || ( defined(_MSC_VER) && _MSC_VER >= 1700 ) -# define CTK_OVERRIDE override -#else -# define CTK_OVERRIDE -#endif - #endif diff --git a/Libs/DICOM/Core/ctkDICOMDisplayedFieldGeneratorDefaultRule.h b/Libs/DICOM/Core/ctkDICOMDisplayedFieldGeneratorDefaultRule.h index 85dbe4795a..13596f579c 100644 --- a/Libs/DICOM/Core/ctkDICOMDisplayedFieldGeneratorDefaultRule.h +++ b/Libs/DICOM/Core/ctkDICOMDisplayedFieldGeneratorDefaultRule.h @@ -35,31 +35,31 @@ class CTK_DICOM_CORE_EXPORT ctkDICOMDisplayedFieldGeneratorDefaultRule : public { public: /// Get name of rule - QString name()const CTK_OVERRIDE; + QString name()const override; /// Clone displayed field generator rule. Override to return a new instance of the rule sub-class - ctkDICOMDisplayedFieldGeneratorAbstractRule* clone() CTK_OVERRIDE; + ctkDICOMDisplayedFieldGeneratorAbstractRule* clone() override; /// Specify list of DICOM tags required by the rule. These tags will be included in the tag cache - QStringList getRequiredDICOMTags() CTK_OVERRIDE; + QStringList getRequiredDICOMTags() override; /// Register placeholder strings that still mean that a given field can be considered empty. /// Used when merging the original database content with the displayed fields generated by the rules. /// Example: SeriesDescription -> Unnamed Series - void registerEmptyFieldNames(QMap emptyFieldsSeries, QMap emptyFieldstudies, QMap emptyFieldsPatients) CTK_OVERRIDE; + void registerEmptyFieldNames(QMap emptyFieldsSeries, QMap emptyFieldstudies, QMap emptyFieldsPatients) override; /// Generate displayed fields for a certain instance based on its cached tags /// The way these generated fields will be used is defined by \sa mergeDisplayedFieldsForInstance void getDisplayedFieldsForInstance( const QMap &cachedTagsForInstance, QMap &displayedFieldsForCurrentSeries, - QMap &displayedFieldsForCurrentStudy, QMap &displayedFieldsForCurrentPatient ) CTK_OVERRIDE; + QMap &displayedFieldsForCurrentStudy, QMap &displayedFieldsForCurrentPatient ) override; /// Define rules of merging initial database values with new values generated by the rule plugins void mergeDisplayedFieldsForInstance( const QMap &initialFieldsSeries, const QMap &initialFieldsStudy, const QMap &initialFieldsPatient, const QMap &newFieldsSeries, const QMap &newFieldsStudy, const QMap &newFieldsPatient, QMap &mergedFieldsSeries, QMap &mergedFieldsStudy, QMap &mergedFieldsPatient, - const QMap &emptyFieldsSeries, const QMap &emptyFieldsStudy, const QMap &emptyFieldsPatient ) CTK_OVERRIDE; + const QMap &emptyFieldsSeries, const QMap &emptyFieldsStudy, const QMap &emptyFieldsPatient ) override; protected: QString humanReadablePatientName(QString dicomPatientName); diff --git a/Libs/DICOM/Core/ctkDICOMDisplayedFieldGeneratorLastStudyDateRule.h b/Libs/DICOM/Core/ctkDICOMDisplayedFieldGeneratorLastStudyDateRule.h index 6bf837f4a0..ad38e6b57a 100644 --- a/Libs/DICOM/Core/ctkDICOMDisplayedFieldGeneratorLastStudyDateRule.h +++ b/Libs/DICOM/Core/ctkDICOMDisplayedFieldGeneratorLastStudyDateRule.h @@ -37,29 +37,29 @@ class CTK_DICOM_CORE_EXPORT ctkDICOMDisplayedFieldGeneratorLastStudyDateRule : p explicit ctkDICOMDisplayedFieldGeneratorLastStudyDateRule(); /// Get name of rule - QString name()const CTK_OVERRIDE; + QString name()const override; /// Clone displayed field generator rule. Override to return a new instance of the rule sub-class - ctkDICOMDisplayedFieldGeneratorAbstractRule* clone() CTK_OVERRIDE; + ctkDICOMDisplayedFieldGeneratorAbstractRule* clone() override; /// Specify list of DICOM tags required by the rule. These tags will be included in the tag cache - QStringList getRequiredDICOMTags() CTK_OVERRIDE; + QStringList getRequiredDICOMTags() override; /// Generate displayed fields for a certain instance based on its cached tags /// The way these generated fields will be used is defined by \sa mergeDisplayedFieldsForInstance void getDisplayedFieldsForInstance( const QMap &cachedTagsForInstance, QMap &displayedFieldsForCurrentSeries, - QMap &displayedFieldsForCurrentStudy, QMap &displayedFieldsForCurrentPatient ) CTK_OVERRIDE; + QMap &displayedFieldsForCurrentStudy, QMap &displayedFieldsForCurrentPatient ) override; /// Start updating displayed fields (reset counters, etc.). No-op by default. - void startUpdate() CTK_OVERRIDE; + void startUpdate() override; /// End updating displayed fields (accumulate stored variables, compute final result, etc.). No-op by default. /// Has a chance to update any field in the series, study, or patient field maps, based on /// the maps themselves or the database. void endUpdate(QMap > &displayedFieldsMapSeries, QMap > &displayedFieldsMapStudy, - QMap > &displayedFieldsMapPatient) CTK_OVERRIDE; + QMap > &displayedFieldsMapPatient) override; protected: /// Composite IDs (containing PatientID, PatientName, PatientBirthDate) of patients that contain instances of which displayed fields are updated in this run. diff --git a/Libs/DICOM/Core/ctkDICOMDisplayedFieldGeneratorPatientNumberOfStudiesRule.h b/Libs/DICOM/Core/ctkDICOMDisplayedFieldGeneratorPatientNumberOfStudiesRule.h index 5a9b29969b..98ac47480d 100644 --- a/Libs/DICOM/Core/ctkDICOMDisplayedFieldGeneratorPatientNumberOfStudiesRule.h +++ b/Libs/DICOM/Core/ctkDICOMDisplayedFieldGeneratorPatientNumberOfStudiesRule.h @@ -37,29 +37,29 @@ class CTK_DICOM_CORE_EXPORT ctkDICOMDisplayedFieldGeneratorPatientNumberOfStudie explicit ctkDICOMDisplayedFieldGeneratorPatientNumberOfStudiesRule(); /// Get name of rule - QString name()const CTK_OVERRIDE; + QString name()const override; /// Clone displayed field generator rule. Override to return a new instance of the rule sub-class - ctkDICOMDisplayedFieldGeneratorAbstractRule* clone() CTK_OVERRIDE; + ctkDICOMDisplayedFieldGeneratorAbstractRule* clone() override; /// Specify list of DICOM tags required by the rule. These tags will be included in the tag cache - QStringList getRequiredDICOMTags() CTK_OVERRIDE; + QStringList getRequiredDICOMTags() override; /// Generate displayed fields for a certain instance based on its cached tags /// The way these generated fields will be used is defined by \sa mergeDisplayedFieldsForInstance void getDisplayedFieldsForInstance( const QMap &cachedTagsForInstance, QMap &displayedFieldsForCurrentSeries, - QMap &displayedFieldsForCurrentStudy, QMap &displayedFieldsForCurrentPatient ) CTK_OVERRIDE; + QMap &displayedFieldsForCurrentStudy, QMap &displayedFieldsForCurrentPatient ) override; /// Start updating displayed fields (reset counters, etc.). No-op by default. - void startUpdate() CTK_OVERRIDE; + void startUpdate() override; /// End updating displayed fields (accumulate stored variables, compute final result, etc.). No-op by default. /// Has a chance to update any field in the series, study, or patient field maps, based on /// the maps themselves or the database. void endUpdate(QMap > &displayedFieldsMapSeries, QMap > &displayedFieldsMapStudy, - QMap > &displayedFieldsMapPatient) CTK_OVERRIDE; + QMap > &displayedFieldsMapPatient) override; protected: /// Composite IDs (containing PatientID, PatientName, PatientBirthDate) of patients that contain instances of which displayed fields are updated in this run. diff --git a/Libs/DICOM/Core/ctkDICOMDisplayedFieldGeneratorRadiotherapySeriesDescriptionRule.h b/Libs/DICOM/Core/ctkDICOMDisplayedFieldGeneratorRadiotherapySeriesDescriptionRule.h index 4a74bb7605..e8e6a35453 100644 --- a/Libs/DICOM/Core/ctkDICOMDisplayedFieldGeneratorRadiotherapySeriesDescriptionRule.h +++ b/Libs/DICOM/Core/ctkDICOMDisplayedFieldGeneratorRadiotherapySeriesDescriptionRule.h @@ -39,31 +39,31 @@ class CTK_DICOM_CORE_EXPORT ctkDICOMDisplayedFieldGeneratorRadiotherapySeriesDes explicit ctkDICOMDisplayedFieldGeneratorRadiotherapySeriesDescriptionRule(); /// Get name of rule - QString name()const CTK_OVERRIDE; + QString name()const override; /// Clone displayed field generator rule. Override to return a new instance of the rule sub-class - ctkDICOMDisplayedFieldGeneratorAbstractRule* clone() CTK_OVERRIDE; + ctkDICOMDisplayedFieldGeneratorAbstractRule* clone() override; /// Specify list of DICOM tags required by the rule. These tags will be included in the tag cache - QStringList getRequiredDICOMTags() CTK_OVERRIDE; + QStringList getRequiredDICOMTags() override; /// Register placeholder strings that still mean that a given field can be considered empty. /// Used when merging the original database content with the displayed fields generated by the rules. /// Example: SeriesDescription -> Unnamed Series - void registerEmptyFieldNames(QMap emptyFieldsSeries, QMap emptyFieldsStudies, QMap emptyFieldsPatients) CTK_OVERRIDE; + void registerEmptyFieldNames(QMap emptyFieldsSeries, QMap emptyFieldsStudies, QMap emptyFieldsPatients) override; /// Generate displayed fields for a certain instance based on its cached tags /// The way these generated fields will be used is defined by \sa mergeDisplayedFieldsForInstance void getDisplayedFieldsForInstance( const QMap &cachedTagsForInstance, QMap &displayedFieldsForCurrentSeries, - QMap &displayedFieldsForCurrentStudy, QMap &displayedFieldsForCurrentPatient ) CTK_OVERRIDE; + QMap &displayedFieldsForCurrentStudy, QMap &displayedFieldsForCurrentPatient ) override; /// Define rules of merging initial database values with new values generated by the rule plugins void mergeDisplayedFieldsForInstance( const QMap &initialFieldsSeries, const QMap &initialFieldsStudy, const QMap &initialFieldsPatient, const QMap &newFieldsSeries, const QMap &newFieldsStudy, const QMap &newFieldsPatient, QMap &mergedFieldsSeries, QMap &mergedFieldsStudy, QMap &mergedFieldsPatient, - const QMap &emptyFieldsSeries, const QMap &emptyFieldsStudy, const QMap &emptyFieldsPatient ) CTK_OVERRIDE; + const QMap &emptyFieldsSeries, const QMap &emptyFieldsStudy, const QMap &emptyFieldsPatient ) override; protected: const QString EmptySeriesDescriptionRtPlan; diff --git a/Libs/DICOM/Core/ctkDICOMDisplayedFieldGeneratorRuleFactory.h b/Libs/DICOM/Core/ctkDICOMDisplayedFieldGeneratorRuleFactory.h index e20f6ecdf8..971bca8d81 100644 --- a/Libs/DICOM/Core/ctkDICOMDisplayedFieldGeneratorRuleFactory.h +++ b/Libs/DICOM/Core/ctkDICOMDisplayedFieldGeneratorRuleFactory.h @@ -70,7 +70,7 @@ class CTK_DICOM_CORE_EXPORT ctkDICOMDisplayedFieldGeneratorRuleFactory : public private: ctkDICOMDisplayedFieldGeneratorRuleFactory(QObject* parent=nullptr); - ~ctkDICOMDisplayedFieldGeneratorRuleFactory() CTK_OVERRIDE; + ~ctkDICOMDisplayedFieldGeneratorRuleFactory() override; Q_DISABLE_COPY(ctkDICOMDisplayedFieldGeneratorRuleFactory); friend class ctkDICOMDisplayedFieldGeneratorRuleFactoryCleanup; diff --git a/Libs/DICOM/Core/ctkDICOMDisplayedFieldGeneratorSeriesImageCountRule.h b/Libs/DICOM/Core/ctkDICOMDisplayedFieldGeneratorSeriesImageCountRule.h index fd38dec96a..a4628c3cfe 100644 --- a/Libs/DICOM/Core/ctkDICOMDisplayedFieldGeneratorSeriesImageCountRule.h +++ b/Libs/DICOM/Core/ctkDICOMDisplayedFieldGeneratorSeriesImageCountRule.h @@ -37,29 +37,29 @@ class CTK_DICOM_CORE_EXPORT ctkDICOMDisplayedFieldGeneratorSeriesImageCountRule explicit ctkDICOMDisplayedFieldGeneratorSeriesImageCountRule(); /// Get name of rule - QString name()const CTK_OVERRIDE; + QString name()const override; /// Clone displayed field generator rule. Override to return a new instance of the rule sub-class - ctkDICOMDisplayedFieldGeneratorAbstractRule* clone() CTK_OVERRIDE; + ctkDICOMDisplayedFieldGeneratorAbstractRule* clone() override; /// Specify list of DICOM tags required by the rule. These tags will be included in the tag cache - QStringList getRequiredDICOMTags() CTK_OVERRIDE; + QStringList getRequiredDICOMTags() override; /// Generate displayed fields for a certain instance based on its cached tags /// The way these generated fields will be used is defined by \sa mergeDisplayedFieldsForInstance void getDisplayedFieldsForInstance( const QMap &cachedTagsForInstance, QMap &displayedFieldsForCurrentSeries, - QMap &displayedFieldsForCurrentStudy, QMap &displayedFieldsForCurrentPatient ) CTK_OVERRIDE; + QMap &displayedFieldsForCurrentStudy, QMap &displayedFieldsForCurrentPatient ) override; /// Start updating displayed fields (reset counters, etc.). No-op by default. - void startUpdate() CTK_OVERRIDE; + void startUpdate() override; /// End updating displayed fields (accumulate stored variables, compute final result, etc.). No-op by default. /// Has a chance to update any field in the series, study, or patient field maps, based on /// the maps themselves or the database. void endUpdate(QMap > &displayedFieldsMapSeries, QMap > &displayedFieldsMapStudy, - QMap > &displayedFieldsMapPatient) CTK_OVERRIDE; + QMap > &displayedFieldsMapPatient) override; protected: /// Identifiers of the series that contain instances of which displayed fields are updated in this run. diff --git a/Libs/DICOM/Core/ctkDICOMDisplayedFieldGeneratorStudyNumberOfSeriesRule.h b/Libs/DICOM/Core/ctkDICOMDisplayedFieldGeneratorStudyNumberOfSeriesRule.h index 2c2de56ef1..2edde43af3 100644 --- a/Libs/DICOM/Core/ctkDICOMDisplayedFieldGeneratorStudyNumberOfSeriesRule.h +++ b/Libs/DICOM/Core/ctkDICOMDisplayedFieldGeneratorStudyNumberOfSeriesRule.h @@ -37,29 +37,29 @@ class CTK_DICOM_CORE_EXPORT ctkDICOMDisplayedFieldGeneratorStudyNumberOfSeriesRu explicit ctkDICOMDisplayedFieldGeneratorStudyNumberOfSeriesRule(); /// Get name of rule - QString name()const CTK_OVERRIDE; + QString name()const override; /// Clone displayed field generator rule. Override to return a new instance of the rule sub-class - ctkDICOMDisplayedFieldGeneratorAbstractRule* clone() CTK_OVERRIDE; + ctkDICOMDisplayedFieldGeneratorAbstractRule* clone() override; /// Specify list of DICOM tags required by the rule. These tags will be included in the tag cache - QStringList getRequiredDICOMTags() CTK_OVERRIDE; + QStringList getRequiredDICOMTags() override; /// Generate displayed fields for a certain instance based on its cached tags /// The way these generated fields will be used is defined by \sa mergeDisplayedFieldsForInstance void getDisplayedFieldsForInstance( const QMap &cachedTagsForInstance, QMap &displayedFieldsForCurrentSeries, - QMap &displayedFieldsForCurrentStudy, QMap &displayedFieldsForCurrentPatient ) CTK_OVERRIDE; + QMap &displayedFieldsForCurrentStudy, QMap &displayedFieldsForCurrentPatient ) override; /// Start updating displayed fields (reset counters, etc.). No-op by default. - void startUpdate() CTK_OVERRIDE; + void startUpdate() override; /// End updating displayed fields (accumulate stored variables, compute final result, etc.). No-op by default. /// Has a chance to update any field in the series, study, or patient field maps, based on /// the maps themselves or the database. void endUpdate(QMap > &displayedFieldsMapSeries, QMap > &displayedFieldsMapStudy, - QMap > &displayedFieldsMapPatient) CTK_OVERRIDE; + QMap > &displayedFieldsMapPatient) override; protected: /// Identifier of studies that contain instances of which displayed fields are updated in this run. diff --git a/Libs/Scripting/Python/Widgets/ctkPythonConsole.h b/Libs/Scripting/Python/Widgets/ctkPythonConsole.h index 569de5b69a..c04b61664a 100644 --- a/Libs/Scripting/Python/Widgets/ctkPythonConsole.h +++ b/Libs/Scripting/Python/Widgets/ctkPythonConsole.h @@ -128,8 +128,8 @@ class CTK_SCRIPTING_PYTHON_WIDGETS_EXPORT ctkPythonConsoleCompleter : public ctk ctkPythonConsoleCompleter(ctkAbstractPythonManager& pythonManager); virtual ~ctkPythonConsoleCompleter(); - int cursorOffset(const QString& completion) CTK_OVERRIDE; - void updateCompletionModel(const QString& completion) CTK_OVERRIDE; + int cursorOffset(const QString& completion) override; + void updateCompletionModel(const QString& completion) override; protected: QScopedPointer d_ptr; diff --git a/Libs/Widgets/ctkCheckablePushButton.h b/Libs/Widgets/ctkCheckablePushButton.h index a755c329dd..ac4d022462 100644 --- a/Libs/Widgets/ctkCheckablePushButton.h +++ b/Libs/Widgets/ctkCheckablePushButton.h @@ -93,13 +93,13 @@ class CTK_WIDGETS_EXPORT ctkCheckablePushButton : public ctkPushButton protected: /// Reimplemented for internal reasons - void mousePressEvent(QMouseEvent* event) CTK_OVERRIDE; + void mousePressEvent(QMouseEvent* event) override; /// Reimplemented for internal reasons - bool hitButton(const QPoint & pos) const CTK_OVERRIDE; + bool hitButton(const QPoint & pos) const override; /// Reimplemented for internal reasons - void checkStateSet() CTK_OVERRIDE; + void checkStateSet() override; /// Reimplemented for internal reasons - void nextCheckState() CTK_OVERRIDE; + void nextCheckState() override; private: Q_DECLARE_PRIVATE(ctkCheckablePushButton); Q_DISABLE_COPY(ctkCheckablePushButton); diff --git a/Libs/Widgets/ctkPathLineEdit.cpp b/Libs/Widgets/ctkPathLineEdit.cpp index 661a609f5a..245fdf2d8b 100644 --- a/Libs/Widgets/ctkPathLineEdit.cpp +++ b/Libs/Widgets/ctkPathLineEdit.cpp @@ -93,7 +93,7 @@ class ctkFileCompleter : public QCompleter ctkFileCompleter(QObject* o, bool showFiles); // Ensure auto-completed file always uses forward-slash as separator - QString pathFromIndex(const QModelIndex& idx) const CTK_OVERRIDE; + QString pathFromIndex(const QModelIndex& idx) const override; // Helper function for getting the current model casted to QFileSystemModel QFileSystemModel* fileSystemModel() const;