qt_user
26th August 2010, 20:34
i want to draw a rectangle on an image label without overloading paintEvent function......... I don't want to use paintEvent b'coz i have to pas the name of the image to be displayed(frameName) each time I display an image out of a series of images.
Earlier I had drawn suing the following code in the paintEvent function.Now how should I do it without using the paintEvent function.
if((i >= startFrameMarkerPosition)&&(i < endFrameMarkerPosition))
{
painter.drawPixmap(0,0,QPixmap(localFileName.at(i) ));
int x,y,w,h;
x=100; y=200; w=TIME_INTERVAL_PROCESSING_PLAY;h=60;
painter.setPen(Qt::red);
painter.drawRect(x,y,w,h);
QLabel::paintEvent(event);
localSlider->setValue(i);
i++;
}
Thanx in advance!!
Earlier I had drawn suing the following code in the paintEvent function.Now how should I do it without using the paintEvent function.
if((i >= startFrameMarkerPosition)&&(i < endFrameMarkerPosition))
{
painter.drawPixmap(0,0,QPixmap(localFileName.at(i) ));
int x,y,w,h;
x=100; y=200; w=TIME_INTERVAL_PROCESSING_PLAY;h=60;
painter.setPen(Qt::red);
painter.drawRect(x,y,w,h);
QLabel::paintEvent(event);
localSlider->setValue(i);
i++;
}
Thanx in advance!!