Skip to content

Commit

Permalink
STYLE: Remove obsolete CTK_OVERRIDE macro not needed with C++ >= 11
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
jcfr committed Jul 20, 2023
1 parent 911d9a3 commit b9e250d
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 54 deletions.
10 changes: 0 additions & 10 deletions Libs/Core/ctkCompilerDetections_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 6 additions & 6 deletions Libs/DICOM/Core/ctkDICOMDisplayedFieldGeneratorDefaultRule.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<QString, QString> emptyFieldsSeries, QMap<QString, QString> emptyFieldstudies, QMap<QString, QString> emptyFieldsPatients) CTK_OVERRIDE;
void registerEmptyFieldNames(QMap<QString, QString> emptyFieldsSeries, QMap<QString, QString> emptyFieldstudies, QMap<QString, QString> 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<QString, QString> &cachedTagsForInstance, QMap<QString, QString> &displayedFieldsForCurrentSeries,
QMap<QString, QString> &displayedFieldsForCurrentStudy, QMap<QString, QString> &displayedFieldsForCurrentPatient ) CTK_OVERRIDE;
QMap<QString, QString> &displayedFieldsForCurrentStudy, QMap<QString, QString> &displayedFieldsForCurrentPatient ) override;

/// Define rules of merging initial database values with new values generated by the rule plugins
void mergeDisplayedFieldsForInstance(
const QMap<QString, QString> &initialFieldsSeries, const QMap<QString, QString> &initialFieldsStudy, const QMap<QString, QString> &initialFieldsPatient,
const QMap<QString, QString> &newFieldsSeries, const QMap<QString, QString> &newFieldsStudy, const QMap<QString, QString> &newFieldsPatient,
QMap<QString, QString> &mergedFieldsSeries, QMap<QString, QString> &mergedFieldsStudy, QMap<QString, QString> &mergedFieldsPatient,
const QMap<QString, QString> &emptyFieldsSeries, const QMap<QString, QString> &emptyFieldsStudy, const QMap<QString, QString> &emptyFieldsPatient ) CTK_OVERRIDE;
const QMap<QString, QString> &emptyFieldsSeries, const QMap<QString, QString> &emptyFieldsStudy, const QMap<QString, QString> &emptyFieldsPatient ) override;

protected:
QString humanReadablePatientName(QString dicomPatientName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<QString, QString> &cachedTagsForInstance, QMap<QString, QString> &displayedFieldsForCurrentSeries,
QMap<QString, QString> &displayedFieldsForCurrentStudy, QMap<QString, QString> &displayedFieldsForCurrentPatient ) CTK_OVERRIDE;
QMap<QString, QString> &displayedFieldsForCurrentStudy, QMap<QString, QString> &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<QString, QMap<QString, QString> > &displayedFieldsMapSeries,
QMap<QString, QMap<QString, QString> > &displayedFieldsMapStudy,
QMap<QString, QMap<QString, QString> > &displayedFieldsMapPatient) CTK_OVERRIDE;
QMap<QString, QMap<QString, QString> > &displayedFieldsMapPatient) override;

protected:
/// Composite IDs (containing PatientID, PatientName, PatientBirthDate) of patients that contain instances of which displayed fields are updated in this run.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<QString, QString> &cachedTagsForInstance, QMap<QString, QString> &displayedFieldsForCurrentSeries,
QMap<QString, QString> &displayedFieldsForCurrentStudy, QMap<QString, QString> &displayedFieldsForCurrentPatient ) CTK_OVERRIDE;
QMap<QString, QString> &displayedFieldsForCurrentStudy, QMap<QString, QString> &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<QString, QMap<QString, QString> > &displayedFieldsMapSeries,
QMap<QString, QMap<QString, QString> > &displayedFieldsMapStudy,
QMap<QString, QMap<QString, QString> > &displayedFieldsMapPatient) CTK_OVERRIDE;
QMap<QString, QMap<QString, QString> > &displayedFieldsMapPatient) override;

protected:
/// Composite IDs (containing PatientID, PatientName, PatientBirthDate) of patients that contain instances of which displayed fields are updated in this run.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<QString, QString> emptyFieldsSeries, QMap<QString, QString> emptyFieldsStudies, QMap<QString, QString> emptyFieldsPatients) CTK_OVERRIDE;
void registerEmptyFieldNames(QMap<QString, QString> emptyFieldsSeries, QMap<QString, QString> emptyFieldsStudies, QMap<QString, QString> 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<QString, QString> &cachedTagsForInstance, QMap<QString, QString> &displayedFieldsForCurrentSeries,
QMap<QString, QString> &displayedFieldsForCurrentStudy, QMap<QString, QString> &displayedFieldsForCurrentPatient ) CTK_OVERRIDE;
QMap<QString, QString> &displayedFieldsForCurrentStudy, QMap<QString, QString> &displayedFieldsForCurrentPatient ) override;

/// Define rules of merging initial database values with new values generated by the rule plugins
void mergeDisplayedFieldsForInstance(
const QMap<QString, QString> &initialFieldsSeries, const QMap<QString, QString> &initialFieldsStudy, const QMap<QString, QString> &initialFieldsPatient,
const QMap<QString, QString> &newFieldsSeries, const QMap<QString, QString> &newFieldsStudy, const QMap<QString, QString> &newFieldsPatient,
QMap<QString, QString> &mergedFieldsSeries, QMap<QString, QString> &mergedFieldsStudy, QMap<QString, QString> &mergedFieldsPatient,
const QMap<QString, QString> &emptyFieldsSeries, const QMap<QString, QString> &emptyFieldsStudy, const QMap<QString, QString> &emptyFieldsPatient ) CTK_OVERRIDE;
const QMap<QString, QString> &emptyFieldsSeries, const QMap<QString, QString> &emptyFieldsStudy, const QMap<QString, QString> &emptyFieldsPatient ) override;

protected:
const QString EmptySeriesDescriptionRtPlan;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<QString, QString> &cachedTagsForInstance, QMap<QString, QString> &displayedFieldsForCurrentSeries,
QMap<QString, QString> &displayedFieldsForCurrentStudy, QMap<QString, QString> &displayedFieldsForCurrentPatient ) CTK_OVERRIDE;
QMap<QString, QString> &displayedFieldsForCurrentStudy, QMap<QString, QString> &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<QString, QMap<QString, QString> > &displayedFieldsMapSeries,
QMap<QString, QMap<QString, QString> > &displayedFieldsMapStudy,
QMap<QString, QMap<QString, QString> > &displayedFieldsMapPatient) CTK_OVERRIDE;
QMap<QString, QMap<QString, QString> > &displayedFieldsMapPatient) override;

protected:
/// Identifiers of the series that contain instances of which displayed fields are updated in this run.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<QString, QString> &cachedTagsForInstance, QMap<QString, QString> &displayedFieldsForCurrentSeries,
QMap<QString, QString> &displayedFieldsForCurrentStudy, QMap<QString, QString> &displayedFieldsForCurrentPatient ) CTK_OVERRIDE;
QMap<QString, QString> &displayedFieldsForCurrentStudy, QMap<QString, QString> &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<QString, QMap<QString, QString> > &displayedFieldsMapSeries,
QMap<QString, QMap<QString, QString> > &displayedFieldsMapStudy,
QMap<QString, QMap<QString, QString> > &displayedFieldsMapPatient) CTK_OVERRIDE;
QMap<QString, QMap<QString, QString> > &displayedFieldsMapPatient) override;

protected:
/// Identifier of studies that contain instances of which displayed fields are updated in this run.
Expand Down
4 changes: 2 additions & 2 deletions Libs/Scripting/Python/Widgets/ctkPythonConsole.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<ctkPythonConsoleCompleterPrivate> d_ptr;
Expand Down
8 changes: 4 additions & 4 deletions Libs/Widgets/ctkCheckablePushButton.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Libs/Widgets/ctkPathLineEdit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b9e250d

Please sign in to comment.