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...
#include<QDebug>
#include<QTime>
void ForceIndicator
::paintEvent(QPaintEvent* /*event*/) {
//std::cout << "blub" << std::endl;
qWarning()<<"Current Time ="<<QTime::currentTime();
//paint the current time somewhere it is visible in your widget.
painter.
drawText(50,
50,
QTime::currentTime().
toString());
/* stuff */
}
#include<QDebug>
#include<QTime>
void ForceIndicator::paintEvent(QPaintEvent* /*event*/)
{
//std::cout << "blub" << std::endl;
qWarning()<<"Current Time ="<<QTime::currentTime();
QPainter painter(this);
//paint the current time somewhere it is visible in your widget.
painter.drawText(50,50,QTime::currentTime().toString());
/* stuff */
}
To copy to clipboard, switch view to plain text mode
Bookmarks