PDA

View Full Version : A chronometer (analog clock example with 10 ms) , Qpainter and Qimage. Help



tonnot
5th October 2010, 20:13
I have write some lines to convert the QT analog clock example to a chronometer (with a second and cent-second indicator).
Ok, I have thought that I can draw the hour,minute and second every second, and the cent-second indicator every 10 miliseconds. (both using the paintevent fired by the timer)
When I 'm going to draw the cent-second, first I draw the image on the widget :

QPainter painter(this);
painter.drawImage(image.rect(), image, image.rect());
And I have a flicker ...

I use :
To create the image :
image= QImage(x, y, QImage::Format_ARGB32_Premultiplied); (x, y are the size)
To use it :
QPainter painter(&image);
image.fill(qRgba(255, 255, 255,0)); and after 'painter' functions.

What I doing bad ? I have tried with format and fill color ...
Any help, please.