as said in tutorial... update() will not call the paintEvent() everytime.
but repaint() should call it.

i have not used cout<< in any of my qt programs. try this...

Qt Code:
  1. #include<QDebug>
  2. #include<QTime>
  3.  
  4. void ForceIndicator::paintEvent(QPaintEvent* /*event*/)
  5. {
  6. //std::cout << "blub" << std::endl;
  7. qWarning()<<"Current Time ="<<QTime::currentTime();
  8.  
  9. QPainter painter(this);
  10.  
  11. //paint the current time somewhere it is visible in your widget.
  12. painter.drawText(50,50,QTime::currentTime().toString());
  13.  
  14. /* stuff */
  15.  
  16. }
To copy to clipboard, switch view to plain text mode