Hi,
I'm trying to draw a background grid with the text on the QGraphicsView. The grid is fine, but I can't make it to draw a text. I've played with fonts, brushes etc., setting different values there but the text doesn't appear. There's probably something silly, but I've no more ideas. Does anybody see what's wrong on this?

Qt Code:
  1. void DgChartView::drawBackground( QPainter* painter, const QRectF& rect )
  2. {
  3. painter->drawText( rect.center(), "SOME TEXT SOME TEXT" );
  4.  
  5. for ( QVector<GridData>::iterator it = m_bgGridVert.begin( ); it < m_bgGridVert.end( ); it++ )
  6. {
  7. GridData& data = *it;
  8. QLineF line( QPointF( data.pos, rect.top( ) ), QPointF( data.pos, rect.bottom( ) ) );
  9. painter->drawLine( line );
  10. }
  11.  
  12. }
To copy to clipboard, switch view to plain text mode 

Once again, the lines drawn in the loop are displayed correctly, but no text (here's just an example of drawing to the center of the visible rect).

Thanks,
Vit