Fem: modernize C++: return braced init list

This commit is contained in:
wmayer
2023-08-19 01:02:07 +02:00
parent 5f0ec490e6
commit f2b46996d4
6 changed files with 8 additions and 8 deletions

View File

@@ -37,7 +37,7 @@ using namespace Fem;
// returns a string which represents the object e.g. when printed in python
std::string FemPostPipelinePy::representation() const
{
return std::string("<FemPostPipeline object>");
return {"<FemPostPipeline object>"};
}
PyObject* FemPostPipelinePy::read(PyObject *args)

View File

@@ -115,7 +115,7 @@ QVariant PropertyFemMeshItem::value(const App::Property*) const
out << QObject::tr("Polyhedrons") << ": " << ctH << ", ";
out << QObject::tr("Groups") << ": " << ctG;
out << ']';
return QVariant(str);
return {str};
}
QVariant PropertyFemMeshItem::toolTip(const App::Property* prop) const
@@ -145,7 +145,7 @@ void PropertyFemMeshItem::setEditorData(QWidget* editor, const QVariant& data) c
QVariant PropertyFemMeshItem::editorData(QWidget* editor) const
{
Q_UNUSED(editor);
return QVariant();
return {};
}
int PropertyFemMeshItem::countNodes() const

View File

@@ -130,7 +130,7 @@ void ViewProviderFemConstraint::setDisplayMode(const char* ModeName)
std::vector<App::DocumentObject*> ViewProviderFemConstraint::claimChildren()const
{
return std::vector<App::DocumentObject*>();
return {};
}
void ViewProviderFemConstraint::setupContextMenu(QMenu *menu, QObject *receiver, const char *member)

View File

@@ -416,7 +416,7 @@ std::string ViewProviderFemMesh::getElement(const SoDetail* detail) const
str << "Node" << vertex;
}
else {
return std::string();
return {};
}
}
}
@@ -455,7 +455,7 @@ SoDetail* ViewProviderFemMesh::getDetail(const char* subelement) const
std::vector<Base::Vector3d> ViewProviderFemMesh::getSelectionShape(const char* /*Element*/) const
{
return std::vector<Base::Vector3d>();
return {};
}
std::set<long> ViewProviderFemMesh::getHighlightNodes() const

View File

@@ -21,7 +21,7 @@ using namespace FemGui;
// returns a string which represents the object e.g. when printed in python
std::string ViewProviderFemMeshPy::representation() const
{
return std::string("<ViewProviderFemMesh object>");
return {"<ViewProviderFemMesh object>"};
}

View File

@@ -33,7 +33,7 @@ using namespace FemGui;
// returns a string which represents the object e.g. when printed in python
std::string ViewProviderFemPostPipelinePy::representation() const
{
return std::string("<ViewProviderFemPostPipeline object>");
return {"<ViewProviderFemPostPipeline object>"};
}
PyObject *ViewProviderFemPostPipelinePy::updateColorBars(PyObject *args)