[Qt-interest] Can't draw pixmap above of QHeaderView

Iurii Gordiienko hordi at ukr.net
Tue Nov 17 15:43:50 CET 2009


Hi          
        I want to draw something above of the QHeaderView section. I use paintSection function but have no positive results. Please, look to the code - after comment the QHeaderView::paintSection function I see my draw's results, but I need apply the parent's draw... Am I wrong?          
        void DetailsHeaderView::paintSection( QPainter* painter, const QRect& rect, int logicalIndex )const    
{    
QHeaderView::paintSection(painter,rect,logicalIndex);    
    
    if(0==logicalIndex){    
      QPixmap pxm(":/images/xxx.png");    
    
      int w = sectionSize(logicalIndex);    
    
      int dx = (w-pxm.width())/2;    
    
      QRect rct(sectionViewportPosition(logicalIndex)+dx,0,pxm.width(),pxm.height());    
    
      painter->drawPixmap(rct,pxm);    
    }    
}    
          
        Qt-4.5.3    
          
        Thanks  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091117/1d498b19/attachment.html 


More information about the Qt-interest-old mailing list