diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx index 90f5ac2e2a..8c7801b4a6 100644 --- a/Source/QtDialog/QCMakeCacheView.cxx +++ b/Source/QtDialog/QCMakeCacheView.cxx @@ -187,7 +187,7 @@ QCMakeCacheModel::QCMakeCacheModel(QObject* p) QCMakeCacheModel::~QCMakeCacheModel() = default; -static uint qHash(QCMakeProperty const& p) +static size_t qHash(QCMakeProperty const& p) { return qHash(p.Key); } @@ -349,7 +349,7 @@ void QCMakeCacheModel::setViewType(QCMakeCacheModel::ViewType t) QCMakePropertyList props = this->properties(); QCMakePropertyList oldProps; - int numNew = this->NewPropertyCount; + cm_qsizetype numNew = this->NewPropertyCount; cm_qsizetype numTotal = props.count(); for (cm_qsizetype i = numNew; i < numTotal; i++) { oldProps.append(props[i]); @@ -530,7 +530,7 @@ bool QCMakeCacheModel::editEnabled() const return this->EditEnabled; } -int QCMakeCacheModel::newPropertyCount() const +cm_qsizetype QCMakeCacheModel::newPropertyCount() const { return this->NewPropertyCount; } diff --git a/Source/QtDialog/QCMakeCacheView.h b/Source/QtDialog/QCMakeCacheView.h index 4df17f7aed..879caf5bf7 100644 --- a/Source/QtDialog/QCMakeCacheView.h +++ b/Source/QtDialog/QCMakeCacheView.h @@ -3,6 +3,7 @@ #pragma once #include "QCMake.h" +#include "QCMakeSizeType.h" #include #include #include @@ -99,7 +100,7 @@ public: bool editEnabled() const; // returns how many new properties there are - int newPropertyCount() const; + cm_qsizetype newPropertyCount() const; // return flags (overloaded to modify flag based on EditEnabled flag) Qt::ItemFlags flags(QModelIndex const& index) const; @@ -114,7 +115,7 @@ public: protected: bool EditEnabled; - int NewPropertyCount; + cm_qsizetype NewPropertyCount; bool ShowNewProperties; ViewType View; diff --git a/Source/QtDialog/QCMakePresetItemModel.cxx b/Source/QtDialog/QCMakePresetItemModel.cxx index ac071f2f2c..4df9b1ca8a 100644 --- a/Source/QtDialog/QCMakePresetItemModel.cxx +++ b/Source/QtDialog/QCMakePresetItemModel.cxx @@ -83,7 +83,8 @@ int QCMakePresetItemModel::rowCount(QModelIndex const& parent) const if (this->m_presets.empty()) { return 1; } - return this->m_presets.size() + 2; + // NOLINTNEXTLINE(readability-redundant-casting) + return static_cast(this->m_presets.size() + 2); } int QCMakePresetItemModel::columnCount(QModelIndex const& parent) const @@ -144,5 +145,6 @@ int QCMakePresetItemModel::presetNameToRow(QString const& name) const index++; } - return this->m_presets.size() + 1; + // NOLINTNEXTLINE(readability-redundant-casting) + return static_cast(this->m_presets.size() + 1); }