[Qt-interest] need help with qobject connect

Ivan Lyapunov qt4box at gmail.com
Mon Aug 10 15:54:52 CEST 2009


2009/8/9 Thiago Macieira <thiago.macieira at trolltech.com>

> Ivan Lyapunov wrote:
> >It's not the only one purpuse to indicate something to signal emitter
> > with non-const reference.
> >I want to change my struct during the emission, since the emission queue
> > is serialized by Qt and it's not a multithread.
>
> That's where you're wrong.
>
> It's not serialised. It's a simple copy and you cannot create copies of
> references.
>

I mean SLOTs called consistently in a queue order.


>
> >So i can change any parameter in struct in first SLOT to the end of
> >connectors in a connection order, like in a filter.
>
> Signals and slots should be regarded as all independent from each other.
> Depending on an earlier slot running sounds like a bad design to me.


I can't see any technical problems to do this - only design complexity.



> >But unfortunately i should rewrite my code to void* calls because of
> > strange architect prohibition.
>
> I would recommend instead that the called slots' objects have a link to
> the structure that they're filtering an acting on.
>
> Alternatively, you can pass a type that wraps the reference but is
> copyable.
>

I just want to use this queue feature as i described and i knew that its may
be hard
to understand and support the result code.
Making a link is not really good idea for me because it's dynamically
created
object in a private class and i haven't access to it.
It's not really trouble, but it's the Qt prohibition and that I can't
understand, especially
because of SIGNAL/SLOT mechanist does not have a real safe type checking.

Regards,
 Ivan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090810/355c38af/attachment.html 


More information about the Qt-interest-old mailing list