From c528ce29ebe7f2c4d393f8d9cbb3144e9af83e4f Mon Sep 17 00:00:00 2001 From: tetektoza Date: Sat, 17 May 2025 23:32:39 +0200 Subject: [PATCH] BIM/Help: Access DockWidgetArea QFlag enum correctly Currently, for both Help and BIM Views panels we can get a traceback about incorrect casting if we move the panel. This is because the QFlag of DockWidgetArea that is being passed, as it is not able to be parsed down to an int. Most probably some historical change either in Qt or FC. This error also caused to not write current BIM Views/Help panel setup to config, resulting in the position being resetted every run. --- src/Mod/BIM/bimcommands/BimViews.py | 3 +-- src/Mod/Help/Help.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Mod/BIM/bimcommands/BimViews.py b/src/Mod/BIM/bimcommands/BimViews.py index fba4f65fe7..4a9dcf4b28 100644 --- a/src/Mod/BIM/bimcommands/BimViews.py +++ b/src/Mod/BIM/bimcommands/BimViews.py @@ -523,8 +523,7 @@ class BIM_Views: def onDockLocationChanged(self, area): """Saves dock widget size and location""" - - PARAMS.SetInt("BimViewArea", int(area)) + PARAMS.SetInt("BimViewArea", area.value) mw = FreeCADGui.getMainWindow() vm = findWidget() if vm: diff --git a/src/Mod/Help/Help.py b/src/Mod/Help/Help.py index 773d41f926..32f33b4fcb 100644 --- a/src/Mod/Help/Help.py +++ b/src/Mod/Help/Help.py @@ -460,7 +460,7 @@ def openBrowserHTML(html, baseurl, title, icon, dialog=False): # save dock widget size and location def onDockLocationChanged(area): - PREFS.SetInt("dockWidgetArea", int(area)) + PREFS.SetInt("dockWidgetArea", int(area.value)) mw = FreeCADGui.getMainWindow() dock = mw.findChild(QtWidgets.QDockWidget, "HelpWidget") if dock: