void CEditorNodeView
::drawForeground( QPainter* painter,
const QRectF
& rect
) {
QFont Font
( "Arial",
20 );
painter
->setPen
( QColor( 128,
128,
128,
128 ) );
painter->setFont( Font );
const int X = rect.right();
const int Y = rect.bottom();
const int Width = FontMetrics.width( m_Name );
const int Height = FontMetrics.height();
painter->drawText( X - Width - 5, Y - Height, Width, Height, Qt::AlignCenter, m_Name );
}
void CEditorNodeView::drawForeground( QPainter* painter, const QRectF& rect )
{
QFont Font( "Arial", 20 );
QFontMetrics FontMetrics( Font );
painter->setPen( QColor( 128, 128, 128, 128 ) );
painter->setFont( Font );
const int X = rect.right();
const int Y = rect.bottom();
const int Width = FontMetrics.width( m_Name );
const int Height = FontMetrics.height();
painter->drawText( X - Width - 5, Y - Height, Width, Height, Qt::AlignCenter, m_Name );
}
To copy to clipboard, switch view to plain text mode
If I add update() at the end of the function the problem is not visible but that mean that need update all the viewport always.
Bookmarks