[TD]handle AutoDistribute property toggle
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
|
||||
#include "TaskProjGroup.h"
|
||||
#include "QGIViewPart.h"
|
||||
#include "QGIProjGroup.h"
|
||||
#include "QGSPage.h"
|
||||
#include "ViewProviderPage.h"
|
||||
#include "ViewProviderProjGroup.h"
|
||||
@@ -240,3 +241,33 @@ void ViewProviderProjGroup::regroupSubViews()
|
||||
}
|
||||
}
|
||||
|
||||
void ViewProviderProjGroup::updateData(const App::Property* prop)
|
||||
{
|
||||
TechDraw::DrawProjGroup* group = getViewObject();
|
||||
if (prop == &group->AutoDistribute) {
|
||||
onChangeAutoDistribute();
|
||||
return;
|
||||
}
|
||||
|
||||
ViewProviderDrawingView::updateData(prop);
|
||||
}
|
||||
|
||||
void ViewProviderProjGroup::onChangeAutoDistribute()
|
||||
{
|
||||
auto* groupQGI = static_cast<QGIProjGroup*>(getQView());
|
||||
if (!groupQGI) {
|
||||
// our QGItem does not exist yet
|
||||
return;
|
||||
}
|
||||
|
||||
QList<QGIViewPart*> secondaryQViews = groupQGI->secondaryQViews();
|
||||
for (auto& secondary : secondaryQViews) {
|
||||
if (secondary == groupQGI->getAnchorQItem()) {
|
||||
// do not touch the anchor
|
||||
continue;
|
||||
}
|
||||
secondary->updateView(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -55,6 +55,9 @@ public:
|
||||
bool canDelete(App::DocumentObject* obj) const override;
|
||||
|
||||
void regroupSubViews();
|
||||
void updateData(const App::Property* prop) override;
|
||||
void onChangeAutoDistribute();
|
||||
|
||||
|
||||
protected:
|
||||
bool setEdit(int ModNum) override;
|
||||
|
||||
Reference in New Issue
Block a user