Hi,

On 11 February 2015 at 06:48, Alan Ezust <[email protected]> wrote:
> from the documentation of QObject::moveToThread():
>
>     \note A QObject's member variables \e{do not} automatically become
>     its children. The parent-child relationship must be set by either
>     passing a pointer to the child's \l{QObject()}{constructor}, or by
>     calling setParent(). Without this step, the object's member variables
>     will remain in the old thread when moveToThread() is called.
>
> Is this talking about member variables of type QObject ?
> As in, "subobjects" ?

It is talking about member variables of type "QObject*" -- pointers to
QObject. I believe that's the recommended practice.


> subobjects of type QObject that also have a parent set, might get destructed
> twice, but is that what this above paragraph is recommending?

They won't get destructed twice if your member variable is a pointer,
rather than the full object.


Regards,
Sze-Howe
_______________________________________________
Interest mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to