Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

void QStyle::drawItemPixmap ( QPainter painter,
const QRect rectangle,
int  alignment,
const QPixmap pixmap 
) const [virtual, inherited]

Draws the given pixmap in the specified rectangle, according to the specified alignment, using the provided painter.

See also:
drawItemText()

Reimplemented in QCleanlooksStyle.

Definition at line 514 of file qstyle.cpp.

References QStyle::alignedRect(), QPainter::drawPixmap(), QRect::intersected(), QPixmap::size(), QRect::x(), and QRect::y().

Referenced by QCommonStyle::drawComplexControl(), QPlastiqueStyle::drawComplexControl(), drawComplexControl(), QPlastiqueStyle::drawControl(), QWindowsVistaStyle::drawControl(), drawControl(), QCommonStyle::drawControl(), QCleanlooksStyle::drawItemPixmap(), QStylePainter::drawItemPixmap(), and QLabel::paintEvent().

{
    QRect aligned = alignedRect(QApplication::layoutDirection(), QFlag(alignment), pixmap.size(), rect);
    QRect inter = aligned.intersected(rect);

    painter->drawPixmap(inter.x(), inter.y(), pixmap, inter.x() - aligned.x(), inter.y() - aligned.y(), inter.width(), inter.height());
}


Generated by  Doxygen 1.6.0   Back to index