Navigation Menu

Skip to content

Commit

Permalink
disable ESC button support in View3DInventor::keyEvent() for Qt5 beca…
Browse files Browse the repository at this point in the history
…use changing MDI view mode causes rendering artifacts
  • Loading branch information
wwmayer committed Jun 5, 2019
1 parent 57b3ca6 commit 960d612
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Gui/View3DInventor.cpp
Expand Up @@ -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
Expand All @@ -972,6 +978,7 @@ void View3DInventor::keyPressEvent (QKeyEvent* e)
setCurrentViewMode(Child);
}
}
#endif

QMainWindow::keyPressEvent(e);
}
Expand Down

0 comments on commit 960d612

Please sign in to comment.