Review Request 117478: Convert dolphin (frameworks) to Qt5 signal/slot syntax

Olivier Goffart olivier at woboq.com
Tue Apr 15 18:23:13 BST 2014


On Tuesday 15 April 2014 09:47:13 Thiago Macieira wrote:
> Em ter 15 abr 2014, às 02:36:58, Alexander Richardson escreveu:
> > I didn't see see Thiago's message since I am not subscribed to kfm-devel.
> > From what I saw in the Qt documentation I always assumed they were
> > equivalent (except for not allowing default arguments in the slot), which
> > other differences exist?
> 
> The major difference is the problem of what gets called when the target
> object is being destroyed. Olivier has more details.
> 
> Olivier?

In general, if it compiles, there is no difference.

But there is some things to take care of:
Using the string syntax, signals and slot behave as virtual, which means that 
the connection will use signals or slots in the most derived class with the 
same name if one exist even while connecting to the base class.  While the Qt5 
syntax really connects to the slot of the class specified.  In order to get 
the same behaviour, you need to mark the slot as virtual explicitly.

And as Thiago mentioned there is also the problem that if a signal is emitted 
from a destructor and is connected to a slot of the object being destroyed, 
the slot will be called on the partially destroyed object.  This is more like 
a bug but i have no clear idea how to fix it.

-- 
Olivier 

Woboq - Qt services and support - http://woboq.com - http://code.woboq.org




More information about the kfm-devel mailing list