disable ESC button support in View3DInventor::keyEvent() for Qt5 because changing MDI view mode causes rendering artifacts

This commit is contained in:
wmayer
2019-06-05 15:44:23 +02:00
parent 57b3ca6f77
commit 960d612547

View File

@@ -964,6 +964,12 @@ bool View3DInventor::eventFilter(QObject* watched, QEvent* e)
void View3DInventor::keyPressEvent (QKeyEvent* e)
{
// See StdViewDockUndockFullscreen::activated()
// With Qt5 one cannot directly use 'setCurrentViewMode'
// of an MDI view because it causes rendering problems.
// The only reliable solution is to clone the MDI view,
// set its view mode and close the original MDI view.
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
ViewMode mode = MDIView::currentViewMode();
if (mode != Child) {
// If the widget is in fullscreen mode then we can return to normal mode either
@@ -972,6 +978,7 @@ void View3DInventor::keyPressEvent (QKeyEvent* e)
setCurrentViewMode(Child);
}
}
#endif
QMainWindow::keyPressEvent(e);
}