예제 #1
0
 def paint( self, painter, option, index ):
     super(VoxelGridDelegate,self).paint(painter, option, index)
     column = GridManagerColumns.Columns[index.column()]
     # The only change we present here, is a "fake" button (It is a button, but just in appearance),
     # to invoke the Color Picker Widget, in the Color column.
     if( column == GridManagerColumns.Color ):
         button = QStyleOptionButton() # It looks like a button, but similarities ends here. It's just a skin.
         button.rect = self._get_color_picker_button_dimensions(option.rect)
         button.text = "...";
         # By the way, I couldn't change the color of the f***ing button. So i decided to use the background of the cell as the indicator
         button.state = QStyle.State_Enabled
         QApplication.style().drawControl( QStyle.CE_PushButton, button, painter )