mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-07 00:15:48 -04:00
Don't try to draw characters which don't exist in current font
This commit is contained in:
parent
30f1c97341
commit
5a57336880
@ -247,9 +247,12 @@ void CharacterWidget::paintEvent( QPaintEvent *event )
|
||||
if ( key == mLastKey )
|
||||
painter.fillRect( column * mSquareSize + 1, row * mSquareSize + 1, mSquareSize, mSquareSize, QBrush( palette.color( QPalette::Highlight ) ) );
|
||||
|
||||
painter.drawText( column * mSquareSize + ( mSquareSize / 2 ) - fontMetrics.width( QChar( key ) ) / 2,
|
||||
row * mSquareSize + 4 + fontMetrics.ascent(),
|
||||
QString( QChar( key ) ) );
|
||||
if ( fontMetrics.inFont( QChar( key ) ) )
|
||||
{
|
||||
painter.drawText( column * mSquareSize + ( mSquareSize / 2 ) - fontMetrics.width( QChar( key ) ) / 2,
|
||||
row * mSquareSize + 4 + fontMetrics.ascent(),
|
||||
QString( QChar( key ) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user