Gui: recreate NaviCubes of all 3D views

This commit is contained in:
wmayer
2023-02-03 16:50:25 +01:00
committed by Uwe
parent e50dd7d2d2
commit 39502e8c57
2 changed files with 13 additions and 5 deletions

View File

@@ -112,13 +112,20 @@ void DlgSettingsNavigation::saveSettings()
"User parameter:BaseApp/Preferences/NaviCube");
hGrp->SetASCII("FontString", ui->naviCubeFontName->currentText().toLatin1());
recreateNaviCubes();
}
void DlgSettingsNavigation::recreateNaviCubes()
{
// we changed the cube's layout, therefore we must re-initialize it
// by deleting and the subsequently recreating
auto mdi = qobject_cast<View3DInventor*>(getMainWindow()->activeWindow());
if (mdi) {
auto currentView = mdi->getViewer();
currentView->deleteNavigationCube();
currentView->createNavigationCube();
auto views = getMainWindow()->windows();
for (auto view : views) {
if (auto view3d = qobject_cast<View3DInventor*>(view)) {
auto viewer = view3d->getViewer();
viewer->deleteNavigationCube();
viewer->createNavigationCube();
}
}
}

View File

@@ -53,6 +53,7 @@ public:
private:
void onMouseButtonClicked();
void onNewDocViewChanged(int);
void recreateNaviCubes();
protected:
void changeEvent(QEvent *e) override;