void
RadialMap::Widget::paintEvent( QPaintEvent* )
{
    //bltBit for some Qt setups will bitBlt _after_ the labels are painted. Which buggers things up!
    //shame as bitBlt is faster, possibly Qt bug? Should report the bug? - seems to be race condition
    //bitBlt( this, m_offset, &m_map );

    QPainter paint( this );

    paint.drawPixmap( m_offset, m_map );

    //vertical strips
    if( m_map.width() < width() )
    {
        paint.eraseRect( 0, 0, m_offset.x(), height() );
        paint.eraseRect( m_map.width() + m_offset.x(), 0, m_offset.x() + 1, height() );
    }
    //horizontal strips
    if( m_map.height() < height() )
    {
        paint.eraseRect( 0, 0, width(), m_offset.y() );
        paint.eraseRect( 0, m_map.height() + m_offset.y(), width(), m_offset.y() + 1 );
    }

    //exploded labels
    if( !m_map.isNull() && !m_timer.isActive() )
       paintExplodedLabels( paint );
}
Beispiel #2
0
void RadialMap::Widget::paintEvent(QPaintEvent*)
{
    QPainter paint;
    paint.begin(this);

    if (!m_map.isNull())
        paint.drawPixmap(m_offset, m_map.pixmap());
    else
    {
        paint.drawText(rect(), 0, i18nc("We messed up, the user needs to initiate a rescan.", "Internal representation is invalid,\nplease rescan."));
        return;
    }

    //exploded labels
    if (!m_map.isNull() && !m_timer.isActive())
    {
        if (Config::antialias) {
            paint.setRenderHint(QPainter::Antialiasing);
            //make lines appear on pixel boundaries
            paint.translate(0.5, 0.5);
        }
        paintExplodedLabels(paint);
    }
}