Gui: Allow to override onBeforeChange in view objects

This commit is contained in:
wmayer
2024-11-27 19:52:00 +01:00
committed by wwmayer
parent 597e42d12f
commit 238390127b
2 changed files with 39 additions and 0 deletions

View File

@@ -72,6 +72,7 @@ public:
void attach(App::DocumentObject *pcObject);
void updateData(const App::Property*);
void onChanged(const App::Property* prop);
void onBeforeChange(const App::Property* prop);
void startRestoring();
void finishRestoring();
ValueT onDelete(const std::vector<std::string> & sub);
@@ -149,6 +150,7 @@ private:
FC_PY_ELEMENT(attach) \
FC_PY_ELEMENT(updateData) \
FC_PY_ELEMENT(onChanged) \
FC_PY_ELEMENT(onBeforeChange) \
FC_PY_ELEMENT(startRestoring) \
FC_PY_ELEMENT(finishRestoring) \
FC_PY_ELEMENT(onDelete) \
@@ -518,6 +520,11 @@ protected:
imp->onChanged(prop);
ViewProviderT::onChanged(prop);
}
void onBeforeChange(const App::Property* prop) override
{
imp->onBeforeChange(prop);
ViewProviderT::onBeforeChange(prop);
}
/// is called by the document when the provider goes in edit mode
bool setEdit(int ModNum) override
{