Prefer to use BaseClass's isDerivedFrom<T> over non template or Base::Type's

Regex based changes, manually verified
This commit is contained in:
Benjamin Nauck
2025-01-16 21:27:50 +01:00
parent 6a3eb2ab49
commit 6f535f19fb
166 changed files with 484 additions and 497 deletions

View File

@@ -286,7 +286,7 @@ QVariant SheetModel::data(const QModelIndex& index, int role) const
return {};
}
}
else if (prop->isDerivedFrom(App::PropertyString::getClassTypeId())) {
else if (prop->isDerivedFrom<App::PropertyString>()) {
/* String */
const App::PropertyString* stringProp = static_cast<const App::PropertyString*>(prop);
@@ -321,7 +321,7 @@ QVariant SheetModel::data(const QModelIndex& index, int role) const
return {};
}
}
else if (prop->isDerivedFrom(App::PropertyQuantity::getClassTypeId())) {
else if (prop->isDerivedFrom<App::PropertyQuantity>()) {
/* Number */
const App::PropertyQuantity* floatProp = static_cast<const App::PropertyQuantity*>(prop);
@@ -386,13 +386,13 @@ QVariant SheetModel::data(const QModelIndex& index, int role) const
return {};
}
}
else if (prop->isDerivedFrom(App::PropertyFloat::getClassTypeId())
|| prop->isDerivedFrom(App::PropertyInteger::getClassTypeId())) {
else if (prop->isDerivedFrom<App::PropertyFloat>()
|| prop->isDerivedFrom<App::PropertyInteger>()) {
/* Number */
double d {};
long l {};
bool isInteger = false;
if (prop->isDerivedFrom(App::PropertyFloat::getClassTypeId())) {
if (prop->isDerivedFrom<App::PropertyFloat>()) {
d = static_cast<const App::PropertyFloat*>(prop)->getValue();
}
else {
@@ -454,7 +454,7 @@ QVariant SheetModel::data(const QModelIndex& index, int role) const
return {};
}
}
else if (prop->isDerivedFrom(App::PropertyPythonObject::getClassTypeId())) {
else if (prop->isDerivedFrom<App::PropertyPythonObject>()) {
auto pyProp = static_cast<const App::PropertyPythonObject*>(prop);
switch (role) {