[TD}Fix crash on no mdi (fix #16672) #18083
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements a fix for issue #16672.
Background
Issue #16672 is caused by use of stale pointer to switch to a closed/hidden tab in the Ui.
Similar problem affects static printAll function when it attempts to use a closed tab.
Known Issues to be solved
TechDraw: Insert view > Segfault #16672
Replaces PR #17688
Corrects PR #17488
Solution
Remove print and context-switch behaviour with dependencies on MDIViewPage since it is not always available.
MDIViewPage will continue to handle tree selection, message dispatch and widget functions.
Access printing functions through the view provider, since it is always available when the gui is up and
knows about the QGraphicsScene already.
Change context-switch behaviour to use standard show() method instead of manipulating the mdiview directly.
Add preference for forced WB switch on change of tabs.
Change exporter to not rely on MDIViewPage.
change Commandxxxx reliance on MDIViewPage.