[Interest] Destroy all queued events on QObject::disconnect?

Jason H jhihn at gmx.com
Fri Jan 18 15:17:44 CET 2019



> Sent: Friday, January 18, 2019 at 4:06 AM
> From: "Alexander Dyagilev" <alervdvcw at gmail.com>
> To: "interest at qt-project.org Interest" <interest at qt-project.org>
> Subject: [Interest] Destroy all queued events on QObject::disconnect?
>
> Hello again,
> 
> The previous problem I recently wrote about was caused by me thinking 
> that QObject::disconnect also destroys all queued events caused by this 
> connection. This was obviously wrong.
> 
> But, I still want Qt to behave so. Is there a way to achieve such behavior?

I don't see why when you disconnect you can't also set a flag bool ignoreFutureEvents=true and in your slots check it. I would be hesitant to mess with the QEventLoop, but you might be able to also use an eventFilter() on the object.




More information about the Interest mailing list