Gui: Workaround for #14350
This commit is contained in:
committed by
Chris Hennes
parent
ffb2ebe4c6
commit
7c797b5a10
@@ -261,7 +261,23 @@ void PropertyEditor::closeEditor()
|
||||
if (editingIndex.isValid()) {
|
||||
Base::StateLocker guard(closingEditor);
|
||||
bool hasFocus = activeEditor && activeEditor->hasFocus();
|
||||
#ifdef Q_OS_MACOS
|
||||
// Brute-force workaround for https://github.com/FreeCAD/FreeCAD/issues/14350
|
||||
int currentIndex = 0;
|
||||
QTabBar *tabBar = nullptr;
|
||||
if (auto mdiArea = Gui::MainWindow::getInstance()->findChild<QMdiArea*>()) {
|
||||
tabBar = mdiArea->findChild<QTabBar*>();
|
||||
if (tabBar) {
|
||||
currentIndex = tabBar->currentIndex();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
closePersistentEditor(editingIndex);
|
||||
#ifdef Q_OS_MACOS
|
||||
if (tabBar) {
|
||||
tabBar->setCurrentIndex(currentIndex);
|
||||
}
|
||||
#endif
|
||||
editingIndex = QPersistentModelIndex();
|
||||
activeEditor = nullptr;
|
||||
if(hasFocus)
|
||||
|
||||
Reference in New Issue
Block a user