[TD]refactor scene/view/mdi

- move scene related functions out of mdiViewPage
  and QGVPage.
- route requests for scene/view/mdi through
  ViewProviderPage
This commit is contained in:
Wanderer Fan
2022-07-17 18:43:57 -04:00
committed by WandererFan
parent 9c929897ac
commit bdf4cea14e
27 changed files with 938 additions and 922 deletions

View File

@@ -79,8 +79,11 @@ void DrawRichAnno::onChanged(const App::Property* prop)
//NOTE: DocumentObject::mustExecute returns 1/0 and not true/false
short DrawRichAnno::mustExecute() const
{
if (!isRestoring() && AnnoText.isTouched()) {
return 1;
if (!isRestoring()) {
if (AnnoText.isTouched() ||
AnnoParent.isTouched()) {
return 1;
}
}
return DrawView::mustExecute();
@@ -101,6 +104,22 @@ DrawView* DrawRichAnno::getBaseView() const
return dynamic_cast<DrawView*>(AnnoParent.getValue());
}
//finds the first DrawPage in this Document that claims to own this DrawRichAnno
//note that it is possible to manipulate the Views property of DrawPage so that
//more than 1 DrawPage claims a DrawRichAnno.
DrawPage* DrawRichAnno::findParentPage() const
{
// Base::Console().Message("DRA::findParentPage()\n");
DrawPage *page = nullptr;
if (AnnoParent.getValue() != nullptr) {
DrawView* parent = dynamic_cast<DrawView*>(AnnoParent.getValue());
page = parent->findParentPage();
} else {
page = DrawView::findParentPage();
}
return page;
}
PyObject *DrawRichAnno::getPyObject()
{