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:
{
....some drawing
if(m_draw)
{
painter
->drawText
(QPointF(0,
0),
"Text");
}
}
void GScene::drawBackground(QPainter *painter, const QRectF &rect)
{
....some drawing
if(m_draw)
{
painter->drawText(QPointF(0,0),"Text");
}
}
To copy to clipboard, switch view to plain text mode
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");
}
}
.....
....
if(1)
{
if(1)
{
painter->drawText(QPointF(0,0),"Text2");
}
}
.....
To copy to clipboard, switch view to plain text mode
Bookmarks