Add virtual method allowOverrideViewProviderName to DocumentObject to indicate if a DocumentObject's view provider type can be overriden.

For most object types this is not allowed to avoid to create incompatible combinations via Python or manipulated project files and possibly provoke crashes.

For more details see also: https://forum.freecadweb.org/viewtopic.php?f=10&t=38970&p=333951#p333951
This commit is contained in:
wmayer
2019-09-14 00:52:09 +02:00
parent 44e853c2f8
commit 1cdd2d166f
4 changed files with 75 additions and 13 deletions

View File

@@ -410,6 +410,11 @@ int FeaturePythonImp::setElementVisible(const char *element, bool visible) {
return -2;
}
bool FeaturePythonImp::allowOverrideViewProviderName() const
{
return true;
}
std::string FeaturePythonImp::getViewProviderName()
{
_FC_PY_CALL_CHECK(getViewProviderName,return(std::string()));