[Development] RFC: RAII for property changes

Giuseppe D'Angelo dangelog at gmail.com
Wed Apr 15 19:18:15 CEST 2015


On 15 April 2015 at 17:12, Matthew Woehlke
<mw_triad at users.sourceforge.net> wrote:
>
> Then the slot is broken. What if the sender needs to do something after
> it delivers the signal? What if other slots are connected? Deleting a
> signal sender from a slot connected to the signal is inherently
> dangerous. Don't do it.

For the record, there's some code in Qt to protect against this. I
believe the entire signal emission mechanism is designed to work
nonetheless (and tested), and you can probably grep for QPointer.*this
(f.i. in widgets code) to see other interesting cases. But I agree
it's damn difficult to design robust code this way.

-- 
Giuseppe D'Angelo



More information about the Development mailing list