MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / addDynamicProperty

Method addDynamicProperty

src/Gui/ViewProviderDocumentObject.cpp:158–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156}
157
158App::Property* ViewProviderDocumentObject::addDynamicProperty(
159 std::string_view type,
160 const char* name,
161 const char* group,
162 const char* doc,
163 short attr,
164 bool ro,
165 bool hidden
166)
167{
168 auto prop = ViewProvider::addDynamicProperty(type, name, group, doc, attr, ro, hidden);
169 if (prop) {
170 // transactions of view providers are also managed in App::Document.
171 App::DocumentObject* docobject = getObject();
172 App::Document* document = docobject ? docobject->getDocument() : nullptr;
173 if (document) {
174 document->addOrRemovePropertyOfObject(this, prop, true);
175 }
176 }
177 return prop;
178}
179
180void ViewProviderDocumentObject::onBeforeChange(const App::Property* prop)
181{

Callers 3

addPropertyMethod · 0.45
acceptWithVarSetMethod · 0.45
createPropertyMethod · 0.45

Calls 3

getObjectFunction · 0.70
getDocumentMethod · 0.45

Tested by

no test coverage detected