I'm trying to set up a static function and QLabel so that non-Qt parts of my application can call this function and change the setNum() value of the QLabel. I've done it like so:

Qt Code:
  1. //--window.h
  2. class Window : public QWidget
  3. {
  4. Q_OBJECT
  5.  
  6. public:
  7. Window();
  8. static void setText(int value);
  9. // etc...
  10.  
  11.  
  12. //--window.cpp
  13. #include <QtGui>
  14. #include "window.h"
  15.  
  16. static QLabel *vuXLocLabel=0;
  17.  
  18.  
  19. vuXLocLabel = new QLabel;
  20. vuXLocLabel->setText("hello");
  21.  
  22.  
  23.  
  24. void Window::setText(int value)
  25. {
  26. vuXLocLabel->setNum(value);
  27. //vuXLocLabel->setText("goodbye");
  28. qDebug(" HERE %d", value);
  29. }
To copy to clipboard, switch view to plain text mode 

The QLabel is displayed correctly initially: "hello". But when I call

Window::setText(value);

from the non-Qt part of the program, the value is sent and qDebug("HERE %d") is called (with correct value), but the QLabel isn't changed (using either setNum() or setText().)

I also tried setting up the vuXLocLabel like so:
Qt Code:
  1. //--window.h
  2.  
  3. static QLabel *vuXLocLabel;
  4.  
  5. //--window.cpp
  6.  
  7. QLabel *Window::vuXLocLabel=0;
To copy to clipboard, switch view to plain text mode 

but got the same result: code compiled, program didn't crash, but setNum/setText didn't work. Any insights greatly appreciated. (of course )