View previous topic :: View next topic |
Author |
Message |
xavier.allamigeon n00b
Joined: 09 Aug 2002 Posts: 5
|
Posted: Fri Aug 09, 2002 9:24 am Post subject: QT problem : updating text in a QLabel |
|
|
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 |
|
|
tschortsch n00b
Joined: 09 Aug 2002 Posts: 6
|
Posted: Fri Aug 09, 2002 12:11 pm Post subject: |
|
|
i don't really understand what you want to do. why not use setText(QString)? |
|
Back to top |
|
|
xavier.allamigeon n00b
Joined: 09 Aug 2002 Posts: 5
|
Posted: Fri Aug 09, 2002 12:34 pm Post subject: |
|
|
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 |
|
|
credmp Apprentice
Joined: 02 Jul 2002 Posts: 207 Location: Netherlands
|
Posted: Fri Aug 09, 2002 2:40 pm Post subject: |
|
|
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 |
|
|
xavier.allamigeon n00b
Joined: 09 Aug 2002 Posts: 5
|
Posted: Fri Aug 09, 2002 4:13 pm Post subject: |
|
|
Great ! It works ! Thank you for your help !
Xavier |
|
Back to top |
|
|
|