[TD]fix lost parent on undo

This commit is contained in:
wandererfan
2023-06-24 14:36:19 -04:00
committed by WandererFan
parent 542223f5b6
commit cb25671863
6 changed files with 76 additions and 22 deletions

View File

@@ -76,7 +76,6 @@
#include "Rez.h"
#include "ViewProviderPage.h"
using namespace TechDrawGui;
using namespace TechDraw;
namespace bp = boost::placeholders;
@@ -194,6 +193,7 @@ bool MDIViewPage::onMsg(const char* pMsg, const char**)
else if (strcmp("Undo", pMsg) == 0) {
doc->undo(1);
Gui::Command::updateActive();
fixSceneDependencies(); // check QGraphicsScene item parenting
return true;
}
else if (strcmp("Redo", pMsg) == 0) {
@@ -246,6 +246,14 @@ void MDIViewPage::setTabText(std::string tabText)
}
}
// advise the page to check QGraphicsScene parent/child relationships after undo
void MDIViewPage::fixSceneDependencies()
{
if (getViewProviderPage()) {
getViewProviderPage()->fixSceneDependencies();
}
}
//**** printing routines
void MDIViewPage::getPaperAttributes()