Merge pull request #1132 from oleg-alexandrov/master

Update menus only after the viewers update to get the geometry right
This commit is contained in:
Alessandro Muntoni 2021-10-26 09:46:48 +02:00 committed by GitHub
commit 3e3d461d39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View File

@ -669,6 +669,8 @@ void GLArea::paintEvent(QPaintEvent* /*event*/)
glFlush();
glFinish();
painter.endNativePainting();
emit currentViewerRefreshed();
}
void GLArea::displayMatrix(QPainter *painter, QRect areaRect)

View File

@ -279,6 +279,7 @@ signals:
void glareaClosed(); //someone has closed the glarea
void insertRenderingDataForNewlyGeneratedMesh(int);
void currentViewerChanged(int currentId);
void currentViewerRefreshed();
public slots:

View File

@ -475,8 +475,13 @@ void MainWindow::setUnsplit()
assert(mvc->viewerCounter() >1);
mvc->removeView(mvc->currentView()->getId());
updateMenus();
// After the view is removed and the remaining viewers
// are refreshed to fill the freed area, the geometry
// of these viewers becomes known, and then the menus
// can be updated correctly.
QObject::connect(mvc->currentView(), SIGNAL(currentViewerRefreshed()),
this, SLOT(updateMenus()));
}
}