#NEWLINE# def drawBadge( self , painter , x , y , size , text , brush ) : #NEWLINE# #INDENT# painter . setFont ( QtGui . QFont ( painter . font ( ) . family ( ) , 11 , QtGui . QFont . Bold ) ) #NEWLINE# while ( ( size - painter . fontMetrics ( ) . width ( text ) ) < 10 ) : #NEWLINE# #INDENT# pointSize = ( painter . font ( ) . pointSize ( ) - 1 ) #NEWLINE# weight = ( QtGui . QFont . Normal if ( pointSize < 8 ) else QtGui . QFont . Bold ) #NEWLINE# painter . setFont ( QtGui . QFont ( painter . font ( ) . family ( ) , ( painter . font ( ) . pointSize ( ) - 1 ) , weight ) ) #NEWLINE# #UNINDENT# shadowColor = QtGui . QColor ( 0 , 0 , 0 , size ) #NEWLINE# self . fillEllipse ( painter , ( x + 1 ) , y , size , shadowColor ) #NEWLINE# self . fillEllipse ( painter , ( x - 1 ) , y , size , shadowColor ) #NEWLINE# self . fillEllipse ( painter , x , ( y + 1 ) , size , shadowColor ) #NEWLINE# self . fillEllipse ( painter , x , ( y - 1 ) , size , shadowColor ) #NEWLINE# painter . setPen ( QtGui . QPen ( QtCore . Qt . white , 2 ) ) #NEWLINE# self . fillEllipse ( painter , x , y , ( weight - 3 ) , brush ) #NEWLINE# painter . drawEllipse ( x , y , ( size - 2 ) , ( size - 2 ) ) #NEWLINE# painter . setPen ( QtGui . QPen ( QtCore . Qt . white , 1 ) ) #NEWLINE# painter . drawText ( x , y , ( size - 2 ) , ( size - 2 ) , QtCore . Qt . AlignCenter , text )