diff --git a/src/Gui/View3DInventor.cpp b/src/Gui/View3DInventor.cpp index b83a4388f96c..d49d9d886769 100644 --- a/src/Gui/View3DInventor.cpp +++ b/src/Gui/View3DInventor.cpp @@ -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); }