From 9b4d1f76128bc46a5ea85d33ce67f81029b8017e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristi=C3=A1n=20Maureira-Fredes?= Date: Mon, 24 Jan 2022 12:45:25 +0100 Subject: QFileDialog: allow threads with modal dialogs The snippets that were used to get the return from a QFileDialog modal call was blocking, so we explicitly allow threads around the C++ call. Fixes: PYSIDE-1792 Pick-to: 6.2 Change-Id: Ifb06e8726fece6a9b8248bc91e7616101a8a99a2 Reviewed-by: Christian Tismer --- sources/pyside6/PySide6/glue/qtwidgets.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/pyside6/PySide6/glue/qtwidgets.cpp b/sources/pyside6/PySide6/glue/qtwidgets.cpp index c2c787c68..7511e89cc 100644 --- a/sources/pyside6/PySide6/glue/qtwidgets.cpp +++ b/sources/pyside6/PySide6/glue/qtwidgets.cpp @@ -100,7 +100,9 @@ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QFormLayout::ItemRole](_role)); // @snippet qformlayout-fix-args // @snippet qfiledialog-return +%BEGIN_ALLOW_THREADS %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, &%5, %6); +%END_ALLOW_THREADS %PYARG_0 = PyTuple_New(2); PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval_)); PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[%ARG5_TYPE](%5)); -- cgit v1.2.3