[Qt-interest] bliking when overpainting on the XvImage with QPainter
Byoung-young Lee
darklin20 at gmail.com
Wed Jul 8 17:24:17 CEST 2009
I'm writing some codes for playing video frames with Xv like next:
void paintEvent(QPaintEvent */*event*/) {
...
m_scene->put(m_window, m_gc, rect());
QPainter painter(this);
painter.setPen(Qt::white);
painter.drawText(QPoint(5, 5), "Video Title");
QApplication::syncX();
}
m_scene is an instance of the class I made, it has a XvImage of video frame.
The member function, m_scene->put(), just calls XvPutImage.
Then, I draw "Video Title" text on the screen at (5, 5).
The result looks good at a glance, but it has a problem.
The video plays well, but the texts on the screen is bliking (or maybe
I should say flikering... I'm now sure that wich word is proper).
I also tried with next window options:
setAutoFillBackground(true);
setAttribute(Qt::WA_PaintOnScreen, true);
setAttribute(Qt::WA_OpaquePaintEvent, true);
setAttribute(Qt::WA_PaintUnclipped, true);
setAttribute(Qt::WA_StaticContents, true);
setAttribute(Qt::WA_NoSystemBackground, true);
but, the problem still occurs.
Is there any solution?
Thanks for reading.
More information about the Qt-interest-old
mailing list