Too many signals fired in short timespan: one step closer to solution

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Too many signals fired in short timespan: one step closer to solution

kristof.mulier
Dear PyQt users,

I believe we're one step closer to the solution. Please read the EDIT at the very end of the StackOverflow question:

https://stackoverflow.com/questions/50841486/pyqt5-too-many-signals-fired-in-short-timespan-causes-a-stack-overflow

I noticed that the repeated call to app.processEvents() is the culprit, when called too often in a short timespan. Removing that line from the code in the slot, solved the issue. But it takes down the responsiveness of my GUI. So I thought, why not query first if there are any events to get processed anyway? Unfortunately, the function hasPendingEvents() is not safe to use when there are any non-main-threads running in the entire application. That's not okay.

Please help...

_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
Reply | Threaded
Open this post in threaded view
|

Re: Too many signals fired in short timespan: one step closer to solution

Dariusz
I think you can specify a time for that processEvents() as well so it does larger process than a small one. Maybe that could help?



On 13/06/2018 18:29, [hidden email] wrote:
Dear PyQt users,

I believe we're one step closer to the solution. Please read the EDIT at the very end of the StackOverflow question:


I noticed that the repeated call to app.processEvents() is the culprit, when called too often in a short timespan. Removing that line from the code in the slot, solved the issue. But it takes down the responsiveness of my GUI. So I thought, why not query first if there are any events to get processed anyway? Unfortunately, the function hasPendingEvents() is not safe to use when there are any non-main-threads running in the entire application. That's not okay.

Please help...


_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt

-- 
DARIUSZ MAKOWSKi
CGI-Photographer
07 590 530 854
[hidden email]
www.dariuszmakowski.com

_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
Reply | Threaded
Open this post in threaded view
|

Re: Too many signals fired in short timespan: one step closer to solution

kristof.mulier
Hi Dariusz.
What do you mean precisely?




On Wed, Jun 13, 2018 at 7:52 PM +0200, "Dariusz Makowski" <[hidden email]> wrote:

I think you can specify a time for that processEvents() as well so it does larger process than a small one. Maybe that could help?



On 13/06/2018 18:29, [hidden email] wrote:
Dear PyQt users,

I believe we're one step closer to the solution. Please read the EDIT at the very end of the StackOverflow question:


I noticed that the repeated call to app.processEvents() is the culprit, when called too often in a short timespan. Removing that line from the code in the slot, solved the issue. But it takes down the responsiveness of my GUI. So I thought, why not query first if there are any events to get processed anyway? Unfortunately, the function hasPendingEvents() is not safe to use when there are any non-main-threads running in the entire application. That's not okay.

Please help...


_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt

-- 
DARIUSZ MAKOWSKi
CGI-Photographer
07 590 530 854
[hidden email]
www.dariuszmakowski.com

_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
Reply | Threaded
Open this post in threaded view
|

Re: Too many signals fired in short timespan: one step closer to solution

Dariusz

http://doc.qt.io/qt-5/qeventloop.html#processEvents-1
void
 QEventLoop::processEvents(QEventLoop::ProcessEventsFlags flags, int maxTime)

Regards
Dariusz


On 13/06/2018 21:42, Telenet wrote:
Hi Dariusz.
What do you mean precisely?




On Wed, Jun 13, 2018 at 7:52 PM +0200, "Dariusz Makowski" <[hidden email]> wrote:

I think you can specify a time for that processEvents() as well so it does larger process than a small one. Maybe that could help?



On 13/06/2018 18:29, [hidden email] wrote:
Dear PyQt users,

I believe we're one step closer to the solution. Please read the EDIT at the very end of the StackOverflow question:


I noticed that the repeated call to app.processEvents() is the culprit, when called too often in a short timespan. Removing that line from the code in the slot, solved the issue. But it takes down the responsiveness of my GUI. So I thought, why not query first if there are any events to get processed anyway? Unfortunately, the function hasPendingEvents() is not safe to use when there are any non-main-threads running in the entire application. That's not okay.

Please help...


_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt

-- 
DARIUSZ MAKOWSKi
CGI-Photographer
07 590 530 854
[hidden email]
www.dariuszmakowski.com

-- 
DARIUSZ MAKOWSKi
CGI-Photographer
07 590 530 854
[hidden email]
www.dariuszmakowski.com

_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
Reply | Threaded
Open this post in threaded view
|

Re: Too many signals fired in short timespan: one step closer to solution

michael h
In reply to this post by kristof.mulier

I noticed that the repeated call to app.processEvents() is the culprit, when called too often in a short timespan. Removing that line from the code in the slot, solved the issue. But it takes down the responsiveness of my GUI. So I thought, why not query first if there are any events to get processed anyway? Unfortunately, the function hasPendingEvents() is not safe to use when there are any non-main-threads running in the entire application. That's not okay.


I would've thought that you would not need to call processEvents if you are using background threads and sending update signals simply to refresh the UI. The GUI is blocked by actual GUI updates?
In your example you have added actual work to the main thread which seem will obviously block it... what is blocking the GUI your actual app?




_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt