Lele
4th February 2008, 11:34
Hi,
I would like to display a QLabel (basically just a text) on top of an QGlWidget.
In paintGL() I render my OpenGL stuff, I would like to have a number displayed over the OpenGL context.
I tried overriding paintEvent but I think the Gl context is always on top.
Any idea?
Thanks in advance
void Player::paintEvent(QPaintEvent *event)
{
QPainter painter(this);
painter.setRenderHint(QPainter::Antialiasing);
painter.drawText(250, 250, "1");
QGLWidget::paintEvent(event);
}
I would like to display a QLabel (basically just a text) on top of an QGlWidget.
In paintGL() I render my OpenGL stuff, I would like to have a number displayed over the OpenGL context.
I tried overriding paintEvent but I think the Gl context is always on top.
Any idea?
Thanks in advance
void Player::paintEvent(QPaintEvent *event)
{
QPainter painter(this);
painter.setRenderHint(QPainter::Antialiasing);
painter.drawText(250, 250, "1");
QGLWidget::paintEvent(event);
}