From 3623f8baf50f924fd2a213495c72a5e316cf9341 Mon Sep 17 00:00:00 2001 From: Furgo <148809153+furgo16@users.noreply.github.com> Date: Thu, 13 Feb 2025 17:45:27 +0100 Subject: [PATCH] BIM: fix ability to cancel file dialog on BIM_TDPage command (#19518) * BIM: use tuple return value from QFileDialog.getOpenFileName Fixes: https://github.com/FreeCAD/FreeCAD/issues/19466 * BIM: remove filename assignment from tuple --- src/Mod/BIM/bimcommands/BimTDPage.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Mod/BIM/bimcommands/BimTDPage.py b/src/Mod/BIM/bimcommands/BimTDPage.py index a2702470df..f1f5966dd0 100644 --- a/src/Mod/BIM/bimcommands/BimTDPage.py +++ b/src/Mod/BIM/bimcommands/BimTDPage.py @@ -57,14 +57,13 @@ class BIM_TDPage: ).GetString("TDTemplateDir", "") if not templatedir: templatedir = None - filename = QtGui.QFileDialog.getOpenFileName( + filename, _ = QtGui.QFileDialog.getOpenFileName( QtGui.QApplication.activeWindow(), translate("BIM", "Select page template"), templatedir, "SVG file (*.svg)", ) if filename: - filename = filename[0] name = os.path.splitext(os.path.basename(filename))[0] FreeCAD.ActiveDocument.openTransaction("Create page") page = FreeCAD.ActiveDocument.addObject("TechDraw::DrawPage", "Page")