aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/PySide2/glue
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-09-17 07:56:30 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-09-17 08:22:55 +0200
commit4c5e405e691f707f2765b5f920c28213a36d22e5 (patch)
tree48000f220fc2c4365b276146e3d08a05c3a90312 /sources/pyside2/PySide2/glue
parent53181fb95d3884cc067d005f37accd92d128bccc (diff)
parent38814354ff6a30258b79947304fd3a6be4dc7089 (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Diffstat (limited to 'sources/pyside2/PySide2/glue')
-rw-r--r--sources/pyside2/PySide2/glue/qtcore.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/sources/pyside2/PySide2/glue/qtcore.cpp b/sources/pyside2/PySide2/glue/qtcore.cpp
index d35a73289..45e0e8c25 100644
--- a/sources/pyside2/PySide2/glue/qtcore.cpp
+++ b/sources/pyside2/PySide2/glue/qtcore.cpp
@@ -357,9 +357,15 @@ static bool getReceiver(QObject *source, const char *signal, PyObject *callback,
usingGlobalReceiver = true;
}
+ const auto receiverThread = *receiver ? (*receiver)->thread() : nullptr;
+
if (usingGlobalReceiver) {
PySide::SignalManager &signalManager = PySide::SignalManager::instance();
*receiver = signalManager.globalReceiver(source, callback);
+ // PYSIDE-1354: Move the global receiver to the original receivers's thread
+ // so that autoconnections work correctly.
+ if (receiverThread && receiverThread != (*receiver)->thread())
+ (*receiver)->moveToThread(receiverThread);
*callbackSig = PySide::Signal::getCallbackSignature(signal, *receiver, callback, usingGlobalReceiver).toLatin1();
}