maverick_pol
7th January 2008, 19:44
Hi,
I have a question about some painter behaviour.
I have overloaded the the drawBackground for my scene. When a user sets m_draw flag to true some text should be drawn:
void GScene::drawBackground(QPainter *painter, const QRectF &rect)
{
....some drawing
if(m_draw)
{
painter->drawText(QPointF(0,0),"Text");
}
}
But the "Text" is not drawn. When I invalidate the scene and (m_draw==TRUE), while debugging, I see that the code is invoked, but nothing is drawn. In the console nothing is printed, no warning, no error.
Thanks for any help.
P.S.
I have also tried this, and it works...
....
if(1)
{
if(1)
{
painter->drawText(QPointF(0,0),"Text2");
}
}
.....
I have a question about some painter behaviour.
I have overloaded the the drawBackground for my scene. When a user sets m_draw flag to true some text should be drawn:
void GScene::drawBackground(QPainter *painter, const QRectF &rect)
{
....some drawing
if(m_draw)
{
painter->drawText(QPointF(0,0),"Text");
}
}
But the "Text" is not drawn. When I invalidate the scene and (m_draw==TRUE), while debugging, I see that the code is invoked, but nothing is drawn. In the console nothing is printed, no warning, no error.
Thanks for any help.
P.S.
I have also tried this, and it works...
....
if(1)
{
if(1)
{
painter->drawText(QPointF(0,0),"Text2");
}
}
.....