# Crash when emitting PythonQt.Signal

**URL:** https://discourse.slicer.org/t/crash-when-emitting-pythonqt-signal/11861
**Category:** Development
**Tags:** python, qt
**Created:** [June 4, 2020, 1:27pm UTC](https://discourse.slicer.org/t/crash-when-emitting-pythonqt-signal/11861 "2020-06-04T13:27:14Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Felipe\_Silveira](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/felipe_silveira/32/5677_2.png) [@Felipe\_Silveira](https://discourse.slicer.org/u/Felipe_Silveira)
#### Post date: [June 4, 2020, 1:27pm UTC](https://discourse.slicer.org/t/crash-when-emitting-pythonqt-signal/11861/1 "2020-06-04T13:27:14Z")

</div>

Hi, I have some qt widgets that have some extra callbacks as signals, but I have a crash every time that I call `emit`. I have this problem with the latest stable and also the nightly build from a few days ago.

The repro steps are quite simple:  
import qt  
qt.Signal().emit()

This issue seems to already have been reported but I can’t work around it by using another mechanism because I’d have to change a lot UI code that’s already written.

The mentioned threads are: [Custom Signal/Slots with PythonQt](https://discourse.slicer.org/t/custom-signal-slots-with-pythonqt/3278) and [Use of qt.Signal leads to a crash on exit](https://discourse.slicer.org/t/use-of-qt-signal-leads-to-a-crash-on-exit/8321)

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [June 6, 2020, 5:33am UTC](https://discourse.slicer.org/t/crash-when-emitting-pythonqt-signal/11861/2 "2020-06-06T05:33:40Z")

</div>

You must not emit signals on behalf of another Qt object.

Tell us a bit more about what you are trying to achieve and we can help with finding a good design for it.

---

<div class="post-metadata">

### Author: ![Felipe\_Silveira](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/felipe_silveira/32/5677_2.png) [@Felipe\_Silveira](https://discourse.slicer.org/u/Felipe_Silveira)
#### Post date: [June 9, 2020, 12:19pm UTC](https://discourse.slicer.org/t/crash-when-emitting-pythonqt-signal/11861/3 "2020-06-09T12:19:34Z")

</div>

Sorry, the example was a bit too contrived.

As I was trying things out I was calling emit from the console and got the mentioned crash.  
Instantiating the widget and actually using the UI doesn’t show the crash.
