Qt-interest Archive, September 2002
Problem with threads and update..
Message 1 in thread
Hi, everyone.
I have a problem with QT application using threads.
it works like this.
There is an interface, which launches a thread (pthread) that listens to a
daemon which is sending it data, and then calls the Applications's SLOTS.
The problem is:
though i see that data comes, in console the SLOT called does the qDebug just
fine and regular, BUT:
if i don't move the MOUSE no actual update happens.
Lets say I insert data in a ListBox.
So what happens is:
case 1 (mouse moves constantly) :
the list gets updated regularly and OK
case 2 (the mouse isn't moved):
I get the SLOTS qDebug messages but, the list doesn't get updated,
until i move the mouse, then, all the update happens.
What can be the problem and how can i fix that?
Thanks in advance,
Vadim
Message 2 in thread
A nasty solution I found, but
it's really not what i want.
I put a QTimer doing update every now and then, so it works like this, but
why doesn't it work when i explicitly issue update command in a SLOT that is
being called by the thread?
On Friday 06 September 2002 10:57, Vadim Tarasov wrote:
> Hi, everyone.
> I have a problem with QT application using threads.
> it works like this.
> There is an interface, which launches a thread (pthread) that listens to a
> daemon which is sending it data, and then calls the Applications's SLOTS.
> The problem is:
> though i see that data comes, in console the SLOT called does the qDebug
> just fine and regular, BUT:
> if i don't move the MOUSE no actual update happens.
>
> Lets say I insert data in a ListBox.
> So what happens is:
> case 1 (mouse moves constantly) :
> the list gets updated regularly and OK
>
> case 2 (the mouse isn't moved):
> I get the SLOTS qDebug messages but, the list doesn't get updated,
> until i move the mouse, then, all the update happens.
>
> What can be the problem and how can i fix that?
>
> Thanks in advance,
> Vadim
Message 3 in thread
Hi,
> I have a problem with QT application using threads.
> it works like this.
> There is an interface, which launches a thread (pthread) that listens to a
> daemon which is sending it data, and then calls the Applications's SLOTS.
If I understand correctly, there's a problem with this application. Sending a
signal will result in an immediate call to a slot function - but functions
are not necessarily thread-safe, especially GUI-related functions.
For more information on how to rewrite your application please read:
http://doc.trolltech.com/3.0/threads.html
Dimitri