#NEWLINE# def sizeHintForColumn( self , column_index ) : #NEWLINE# #INDENT# 'Reimplemented to support absolute width specification via\n        TableColumns and to improve the metric for autosizing columns.' #NEWLINE# editor = self . _editor #NEWLINE# column = editor . columns [ column_index ] #NEWLINE# requested_width = column . get_width ( ) #NEWLINE# if ( requested_width < 1 ) : #NEWLINE# #INDENT# base_width = QtGui . QTableView . sizeHintForColumn ( self , column_index ) #NEWLINE# font = column . get_text_font ( None ) #NEWLINE# if ( font is None ) : #NEWLINE# #INDENT# font = self . font ( ) #NEWLINE# font . setBold ( True ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# font = QtGui . QFont ( font ) #NEWLINE# #UNINDENT# text = column . get_label ( ) #NEWLINE# width = QtGui . QFontMetrics ( font ) . width ( text ) #NEWLINE# style = self . style ( ) #NEWLINE# option = QtGui . QStyleOptionHeader ( ) #NEWLINE# width += ( style . pixelMetric ( QtGui . QStyle . PM_HeaderGripMargin , option , self ) * 2 ) #NEWLINE# if ( editor . factory . sortable and ( not editor . factory . reorderable ) ) : #NEWLINE# #INDENT# width += style . pixelMetric ( QtGui . QStyle . PM_HeaderMarkSize , option , self ) #NEWLINE# width += style . pixelMetric ( QtGui . QStyle . PM_HeaderMargin , option , self ) #NEWLINE# #UNINDENT# return max ( base_width , width ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return requested_width