qt-interest@trolltech.com
[Top] [All Lists]

Re: SetParent in Qt 4.4.1

Subject: Re: SetParent in Qt 4.4.1
From: "Volker Hilsheimer"
Date: Wed, 6 Aug 2008 20:21:41 +0200
"Perepelica Alexander" <alexondi@xxxxxxxxxx> wrote in message 
news:4899D7C5.8010300@xxxxxxxxxxxxx
> Hi!
> I try to move my project to 4.4.1. And I have some problem with this.
> I create objects and move him to my thread. But when in GUI I try add some 
> objects I receive error in setParent method:
> ASSERT failure in QCoreApplication::sendEvent: "Cannot send events yo 
> objects owned by a different thread...."
> Why my code is working in 4.4.0 and not in 4.4.1? Or how can I change 
> parents in 4.4.1 from different thread?
> Thanks.
> Alexander

setParent sends an event to the new parent to inform about the new child. 
The message implies that you call setParent in a thread that is not the 
thread that drives the parent object. This would at the very least be a 
race-condition bug. You can only change parents in the thread that owns the 
object tree, and all objects in a tree have to belong to the same thread.

Volker


--
To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with 
"unsubscribe" in the subject or the body.
List archive and information: http://lists.trolltech.com/qt-interest/

<Prev in Thread] Current Thread [Next in Thread>