# Qt single shots freezes

**URL:** <https://discourse.slicer.org/t/qt-single-shots-freezes/19516>\
**Category:** Development\
**Created:** [September 5, 2021, 1:21pm UTC](https://discourse.slicer.org/t/qt-single-shots-freezes/19516 "2021-09-05T13:21:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chintha\_Siva\_Prasad](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chintha_siva_prasad/32/7766_2.png) [@Chintha\_Siva\_Prasad](https://discourse.slicer.org/u/Chintha_Siva_Prasad)\
**Post date:** [September 5, 2021, 1:21pm UTC](https://discourse.slicer.org/t/qt-single-shots-freezes/19516/1 "2021-09-05T13:21:26Z")

</div>

I am running a while loop with some processing in a python-script which I load with mainWindow.To stop UI from freezing, I am using qt-singleshot. Even though the UI is still freezing.

---

<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:** [September 5, 2021, 7:42pm UTC](https://discourse.slicer.org/t/qt-single-shots-freezes/19516/2 "2021-09-05T19:42:32Z")

</div>

It is possible that you can overwhelm your computer with your loop so that no much time is left for processing GUI events. Loosen up the loop a bit by calling `slicer.app.processEvents()` and/or increasing the timer’s timeout to a value that makes the application sufficiently responsive.
