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 22babc0995
commit 503f987cf6
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()));