Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
QT problem : updating text in a QLabel
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
xavier.allamigeon
n00b
n00b


Joined: 09 Aug 2002
Posts: 5

PostPosted: Fri Aug 09, 2002 9:24 am    Post subject: QT problem : updating text in a QLabel Reply with quote

Hello,

I would want to update a QLabel text (this QLabel displays the temperature of the CPU). But repaint() or update() have no effects until the main window is in focus, and I want the text to update without returning focus to the main window to show the visual change. Any idea ?

Regards
Xavier
Back to top
View user's profile Send private message
tschortsch
n00b
n00b


Joined: 09 Aug 2002
Posts: 6

PostPosted: Fri Aug 09, 2002 12:11 pm    Post subject: Reply with quote

i don't really understand what you want to do. why not use setText(QString)?
Back to top
View user's profile Send private message
xavier.allamigeon
n00b
n00b


Joined: 09 Aug 2002
Posts: 5

PostPosted: Fri Aug 09, 2002 12:34 pm    Post subject: Reply with quote

I use setText, but the new text is not displayed until the main windows is in focus or until I do something over the window (moving the mouse, click on the window...). For example, when you look at the window without doing anything with the computer, nothing happens : the text isn't updated. That's why I wanted to use update or repaint method, but it doesn't work. I have tried with a slot : the signal is emitted when the temperature is changed, and the slot is a QLabel setText. But it doesn't work. Any idea ?

Regards
Xavier
Back to top
View user's profile Send private message
credmp
Apprentice
Apprentice


Joined: 02 Jul 2002
Posts: 207
Location: Netherlands

PostPosted: Fri Aug 09, 2002 2:40 pm    Post subject: Reply with quote

Mmm... are you in a thread or something? try qApp->processEvents() else you could force it to redraw by calling update() though this just makes another event....

if the processEvents() doesn't help, please paste some code showing the generation + setting of the label...

-- Arjen
Back to top
View user's profile Send private message
xavier.allamigeon
n00b
n00b


Joined: 09 Aug 2002
Posts: 5

PostPosted: Fri Aug 09, 2002 4:13 pm    Post subject: Reply with quote

Great ! It works ! Thank you for your help !

Xavier
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum